wined3d: Remove object creation methods from the IWineD3DDevice interface.
This commit is contained in:
parent
5e4145d0ff
commit
00a5f38595
|
@ -204,8 +204,8 @@ HRESULT d3d10_buffer_init(struct d3d10_buffer *buffer, struct d3d10_device *devi
|
|||
wined3d_desc.cpu_access_flags = desc->CPUAccessFlags;
|
||||
wined3d_desc.misc_flags = desc->MiscFlags;
|
||||
|
||||
hr = IWineD3DDevice_CreateBuffer(device->wined3d_device, &wined3d_desc,
|
||||
data ? data->pSysMem : NULL, (IUnknown *)buffer, &d3d10_buffer_wined3d_parent_ops,
|
||||
hr = wined3d_buffer_create(device->wined3d_device, &wined3d_desc,
|
||||
data ? data->pSysMem : NULL, buffer, &d3d10_buffer_wined3d_parent_ops,
|
||||
&buffer->wined3d_buffer);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
|
@ -138,7 +138,7 @@ struct d3d10_rendertarget_view
|
|||
D3D10_RENDER_TARGET_VIEW_DESC desc;
|
||||
};
|
||||
|
||||
HRESULT d3d10_rendertarget_view_init(struct d3d10_rendertarget_view *view, struct d3d10_device *device,
|
||||
HRESULT d3d10_rendertarget_view_init(struct d3d10_rendertarget_view *view,
|
||||
ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc) DECLSPEC_HIDDEN;
|
||||
|
||||
/* ID3D10ShaderResourceView */
|
||||
|
|
|
@ -760,7 +760,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Devic
|
|||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = d3d10_rendertarget_view_init(object, (struct d3d10_device *)iface, resource, desc);
|
||||
hr = d3d10_rendertarget_view_init(object, resource, desc);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize rendertarget view, hr %#x.\n", hr);
|
||||
|
@ -1453,7 +1453,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent
|
|||
TRACE("iface %p, container_parent %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p.\n",
|
||||
iface, container_parent, width, height, depth, format, pool, usage, volume);
|
||||
|
||||
hr = IWineD3DDevice_CreateVolume(device_from_device_parent(iface)->wined3d_device,
|
||||
hr = wined3d_volume_create(device_from_device_parent(iface)->wined3d_device,
|
||||
width, height, depth, usage, format, pool, NULL, &d3d10_subresource_parent_ops, volume);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
|
@ -227,7 +227,7 @@ HRESULT d3d10_input_layout_init(struct d3d10_input_layout *layout, struct d3d10_
|
|||
return hr;
|
||||
}
|
||||
|
||||
hr = IWineD3DDevice_CreateVertexDeclaration(device->wined3d_device, wined3d_elements, wined3d_element_count,
|
||||
hr = wined3d_vertex_declaration_create(device->wined3d_device, wined3d_elements, wined3d_element_count,
|
||||
layout, &d3d10_input_layout_wined3d_parent_ops, &layout->wined3d_decl);
|
||||
HeapFree(GetProcessHeap(), 0, wined3d_elements);
|
||||
if (FAILED(hr))
|
||||
|
|
|
@ -255,7 +255,7 @@ HRESULT d3d10_vertex_shader_init(struct d3d10_vertex_shader *shader, struct d3d1
|
|||
return hr;
|
||||
}
|
||||
|
||||
hr = IWineD3DDevice_CreateVertexShader(device->wined3d_device, shader_info.shader_code,
|
||||
hr = wined3d_shader_create_vs(device->wined3d_device, shader_info.shader_code,
|
||||
&shader->output_signature, shader, &d3d10_vertex_shader_wined3d_parent_ops, &shader->wined3d_shader);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
@ -387,7 +387,7 @@ HRESULT d3d10_geometry_shader_init(struct d3d10_geometry_shader *shader, struct
|
|||
return hr;
|
||||
}
|
||||
|
||||
hr = IWineD3DDevice_CreateGeometryShader(device->wined3d_device, shader_info.shader_code,
|
||||
hr = wined3d_shader_create_gs(device->wined3d_device, shader_info.shader_code,
|
||||
&shader->output_signature, shader, &d3d10_geometry_shader_wined3d_parent_ops, &shader->wined3d_shader);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
@ -522,7 +522,7 @@ HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d10_
|
|||
return hr;
|
||||
}
|
||||
|
||||
hr = IWineD3DDevice_CreatePixelShader(device->wined3d_device, shader_info.shader_code,
|
||||
hr = wined3d_shader_create_ps(device->wined3d_device, shader_info.shader_code,
|
||||
&shader->output_signature, shader, &d3d10_pixel_shader_wined3d_parent_ops, &shader->wined3d_shader);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
|
@ -230,7 +230,7 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
|
|||
|
||||
FIXME("Implement DXGI<->wined3d usage conversion\n");
|
||||
|
||||
hr = IWineD3DDevice_CreateSurface(device->wined3d_device, desc->Width, desc->Height,
|
||||
hr = wined3d_surface_create(device->wined3d_device, desc->Width, desc->Height,
|
||||
wined3dformat_from_dxgi_format(desc->Format), FALSE, FALSE, 0, desc->Usage, WINED3DPOOL_DEFAULT,
|
||||
desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3DMULTISAMPLE_NONE,
|
||||
desc->SampleDesc.Quality, SURFACE_OPENGL, texture, &d3d10_texture2d_wined3d_parent_ops,
|
||||
|
@ -436,7 +436,7 @@ HRESULT d3d10_texture3d_init(struct d3d10_texture3d *texture, struct d3d10_devic
|
|||
|
||||
FIXME("Implement DXGI<->wined3d usage conversion.\n");
|
||||
|
||||
hr = IWineD3DDevice_CreateVolumeTexture(device->wined3d_device, desc->Width, desc->Height, desc->Depth,
|
||||
hr = wined3d_texture_create_3d(device->wined3d_device, desc->Width, desc->Height, desc->Depth,
|
||||
desc->MipLevels, desc->Usage, wined3dformat_from_dxgi_format(desc->Format), WINED3DPOOL_DEFAULT,
|
||||
texture, &d3d10_texture3d_wined3d_parent_ops, &texture->wined3d_texture);
|
||||
if (FAILED(hr))
|
||||
|
|
|
@ -427,7 +427,7 @@ static const struct ID3D10RenderTargetViewVtbl d3d10_rendertarget_view_vtbl =
|
|||
d3d10_rendertarget_view_GetDesc,
|
||||
};
|
||||
|
||||
HRESULT d3d10_rendertarget_view_init(struct d3d10_rendertarget_view *view, struct d3d10_device *device,
|
||||
HRESULT d3d10_rendertarget_view_init(struct d3d10_rendertarget_view *view,
|
||||
ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc)
|
||||
{
|
||||
struct wined3d_resource *wined3d_resource;
|
||||
|
@ -453,8 +453,7 @@ HRESULT d3d10_rendertarget_view_init(struct d3d10_rendertarget_view *view, struc
|
|||
return E_FAIL;
|
||||
}
|
||||
|
||||
hr = IWineD3DDevice_CreateRendertargetView(device->wined3d_device,
|
||||
wined3d_resource, (IUnknown *)view, &view->wined3d_view);
|
||||
hr = wined3d_rendertarget_view_create(wined3d_resource, view, &view->wined3d_view);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create a wined3d rendertarget view, hr %#x.\n", hr);
|
||||
|
|
|
@ -270,7 +270,7 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Im
|
|||
buffer->fvf = fvf;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexBuffer(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
|
||||
hr = wined3d_buffer_create_vb(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
|
||||
(WINED3DPOOL)pool, buffer, &d3d8_vertexbuffer_wined3d_parent_ops, &buffer->wineD3DVertexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
|
@ -533,7 +533,7 @@ HRESULT indexbuffer_init(IDirect3DIndexBuffer8Impl *buffer, IDirect3DDevice8Impl
|
|||
buffer->format = wined3dformat_from_d3dformat(format);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateIndexBuffer(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
|
||||
hr = wined3d_buffer_create_ib(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
|
||||
(WINED3DPOOL)pool, buffer, &d3d8_indexbuffer_wined3d_parent_ops, &buffer->wineD3DIndexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
|
|
|
@ -425,7 +425,7 @@ HRESULT cubetexture_init(IDirect3DCubeTexture8Impl *texture, IDirect3DDevice8Imp
|
|||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateCubeTexture(device->WineD3DDevice, edge_length, levels,
|
||||
hr = wined3d_texture_create_cube(device->WineD3DDevice, edge_length, levels,
|
||||
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool, texture,
|
||||
&d3d8_cubetexture_wined3d_parent_ops, &texture->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -1671,7 +1671,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(IDirect3DDevice8 *if
|
|||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateStateBlock(This->WineD3DDevice, (WINED3DSTATEBLOCKTYPE)Type, &stateblock);
|
||||
hr = wined3d_stateblock_create(This->WineD3DDevice, (WINED3DSTATEBLOCKTYPE)Type, &stateblock);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -176,7 +176,7 @@ HRESULT vertexshader_init(IDirect3DVertexShader8Impl *shader, IDirect3DDevice8Im
|
|||
if (usage) FIXME("Usage %#x not implemented.\n", usage);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexShader(device->WineD3DDevice, byte_code, NULL /* output signature */,
|
||||
hr = wined3d_shader_create_vs(device->WineD3DDevice, byte_code, NULL /* output signature */,
|
||||
shader, &d3d8_vertexshader_wined3d_parent_ops, &shader->wined3d_shader);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
|
@ -277,7 +277,7 @@ HRESULT pixelshader_init(IDirect3DPixelShader8Impl *shader, IDirect3DDevice8Impl
|
|||
shader->handle = shader_handle;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code, NULL, shader,
|
||||
hr = wined3d_shader_create_ps(device->WineD3DDevice, byte_code, NULL, shader,
|
||||
&d3d8_pixelshader_wined3d_parent_ops, &shader->wined3d_shader);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
|
|
|
@ -304,7 +304,7 @@ HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *devic
|
|||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
|
||||
hr = wined3d_surface_create(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
|
||||
lockable, discard, level, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, multisample_type,
|
||||
multisample_quality, SURFACE_OPENGL, surface, &d3d8_surface_wined3d_parent_ops, &surface->wined3d_surface);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -174,7 +174,7 @@ HRESULT swapchain_init(IDirect3DSwapChain8Impl *swapchain, IDirect3DDevice8Impl
|
|||
wined3d_parameters.AutoRestoreDisplayMode = TRUE;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateSwapChain(device->WineD3DDevice, &wined3d_parameters,
|
||||
hr = wined3d_swapchain_create(device->WineD3DDevice, &wined3d_parameters,
|
||||
SURFACE_OPENGL, swapchain, &d3d8_swapchain_wined3d_parent_ops,
|
||||
&swapchain->wined3d_swapchain);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -413,7 +413,7 @@ HRESULT texture_init(IDirect3DTexture8Impl *texture, IDirect3DDevice8Impl *devic
|
|||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels,
|
||||
hr = wined3d_texture_create_2d(device->WineD3DDevice, width, height, levels,
|
||||
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
|
||||
texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -400,7 +400,7 @@ HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration8Impl *declaration,
|
|||
memcpy(declaration->elements, elements, declaration->elements_size);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexDeclaration(device->WineD3DDevice, wined3d_elements, wined3d_element_count,
|
||||
hr = wined3d_vertex_declaration_create(device->WineD3DDevice, wined3d_elements, wined3d_element_count,
|
||||
declaration, &d3d8_vertexdeclaration_wined3d_parent_ops, &declaration->wined3d_vertex_declaration);
|
||||
wined3d_mutex_unlock();
|
||||
HeapFree(GetProcessHeap(), 0, wined3d_elements);
|
||||
|
@ -425,7 +425,7 @@ HRESULT vertexdeclaration_init_fvf(IDirect3DVertexDeclaration8Impl *declaration,
|
|||
declaration->elements_size = 0;
|
||||
declaration->shader_handle = fvf;
|
||||
|
||||
hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(device->WineD3DDevice, fvf, declaration,
|
||||
hr = wined3d_vertex_declaration_create_from_fvf(device->WineD3DDevice, fvf, declaration,
|
||||
&d3d8_vertexdeclaration_wined3d_parent_ops, &declaration->wined3d_vertex_declaration);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
|
@ -277,7 +277,7 @@ HRESULT volume_init(IDirect3DVolume8Impl *volume, IDirect3DDevice8Impl *device,
|
|||
volume->IDirect3DVolume8_iface.lpVtbl = &Direct3DVolume8_Vtbl;
|
||||
volume->ref = 1;
|
||||
|
||||
hr = IWineD3DDevice_CreateVolume(device->WineD3DDevice, width, height, depth, usage,
|
||||
hr = wined3d_volume_create(device->WineD3DDevice, width, height, depth, usage,
|
||||
format, pool, volume, &d3d8_volume_wined3d_parent_ops, &volume->wined3d_volume);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
|
@ -401,7 +401,7 @@ HRESULT volumetexture_init(IDirect3DVolumeTexture8Impl *texture, IDirect3DDevice
|
|||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVolumeTexture(device->WineD3DDevice, width, height, depth, levels,
|
||||
hr = wined3d_texture_create_3d(device->WineD3DDevice, width, height, depth, levels,
|
||||
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool, texture,
|
||||
&d3d8_volumetexture_wined3d_parent_ops, &texture->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -272,7 +272,7 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer9Impl *buffer, IDirect3DDevice9Im
|
|||
buffer->fvf = fvf;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexBuffer(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
|
||||
hr = wined3d_buffer_create_vb(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
|
||||
(WINED3DPOOL)pool, buffer, &d3d9_vertexbuffer_wined3d_parent_ops, &buffer->wineD3DVertexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
|
@ -535,7 +535,7 @@ HRESULT indexbuffer_init(IDirect3DIndexBuffer9Impl *buffer, IDirect3DDevice9Impl
|
|||
buffer->format = wined3dformat_from_d3dformat(format);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateIndexBuffer(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
|
||||
hr = wined3d_buffer_create_ib(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
|
||||
(WINED3DPOOL)pool, buffer, &d3d9_indexbuffer_wined3d_parent_ops, &buffer->wineD3DIndexBuffer);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
|
|
|
@ -470,7 +470,7 @@ HRESULT cubetexture_init(IDirect3DCubeTexture9Impl *texture, IDirect3DDevice9Imp
|
|||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateCubeTexture(device->WineD3DDevice, edge_length,
|
||||
hr = wined3d_texture_create_cube(device->WineD3DDevice, edge_length,
|
||||
levels, usage, wined3dformat_from_d3dformat(format), pool, texture,
|
||||
&d3d9_cubetexture_wined3d_parent_ops, &texture->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -171,7 +171,7 @@ HRESULT query_init(IDirect3DQuery9Impl *query, IDirect3DDevice9Impl *device, D3D
|
|||
query->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateQuery(device->WineD3DDevice, type, &query->wineD3DQuery);
|
||||
hr = wined3d_query_create(device->WineD3DDevice, type, &query->wineD3DQuery);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
|
@ -135,7 +135,7 @@ HRESULT vertexshader_init(IDirect3DVertexShader9Impl *shader, IDirect3DDevice9Im
|
|||
shader->lpVtbl = &d3d9_vertexshader_vtbl;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexShader(device->WineD3DDevice, byte_code, NULL,
|
||||
hr = wined3d_shader_create_vs(device->WineD3DDevice, byte_code, NULL,
|
||||
shader, &d3d9_vertexshader_wined3d_parent_ops, &shader->wined3d_shader);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
|
@ -262,7 +262,7 @@ HRESULT pixelshader_init(IDirect3DPixelShader9Impl *shader, IDirect3DDevice9Impl
|
|||
shader->lpVtbl = &d3d9_pixelshader_vtbl;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code, NULL, shader,
|
||||
hr = wined3d_shader_create_ps(device->WineD3DDevice, byte_code, NULL, shader,
|
||||
&d3d9_pixelshader_wined3d_parent_ops, &shader->wined3d_shader);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
|
|
|
@ -149,7 +149,7 @@ HRESULT stateblock_init(IDirect3DStateBlock9Impl *stateblock, IDirect3DDevice9Im
|
|||
else
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateStateBlock(device->WineD3DDevice,
|
||||
hr = wined3d_stateblock_create(device->WineD3DDevice,
|
||||
(WINED3DSTATEBLOCKTYPE)type, &stateblock->wined3d_stateblock);
|
||||
wined3d_mutex_unlock();
|
||||
if (FAILED(hr))
|
||||
|
|
|
@ -392,7 +392,7 @@ HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *devic
|
|||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
|
||||
hr = wined3d_surface_create(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
|
||||
lockable, discard, level, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, multisample_type,
|
||||
multisample_quality, SURFACE_OPENGL, surface, &d3d9_surface_wined3d_parent_ops, &surface->wined3d_surface);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -259,7 +259,7 @@ HRESULT swapchain_init(IDirect3DSwapChain9Impl *swapchain, IDirect3DDevice9Impl
|
|||
wined3d_parameters.AutoRestoreDisplayMode = TRUE;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateSwapChain(device->WineD3DDevice, &wined3d_parameters,
|
||||
hr = wined3d_swapchain_create(device->WineD3DDevice, &wined3d_parameters,
|
||||
SURFACE_OPENGL, swapchain, &d3d9_swapchain_wined3d_parent_ops,
|
||||
&swapchain->wined3d_swapchain);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -457,7 +457,7 @@ HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *devic
|
|||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels,
|
||||
hr = wined3d_texture_create_2d(device->WineD3DDevice, width, height, levels,
|
||||
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
|
||||
texture, &d3d9_texture_wined3d_parent_ops, &texture->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -395,7 +395,7 @@ HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration9Impl *declaration,
|
|||
declaration->element_count = element_count;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVertexDeclaration(device->WineD3DDevice, wined3d_elements, wined3d_element_count,
|
||||
hr = wined3d_vertex_declaration_create(device->WineD3DDevice, wined3d_elements, wined3d_element_count,
|
||||
declaration, &d3d9_vertexdeclaration_wined3d_parent_ops, &declaration->wineD3DVertexDeclaration);
|
||||
wined3d_mutex_unlock();
|
||||
HeapFree(GetProcessHeap(), 0, wined3d_elements);
|
||||
|
|
|
@ -275,7 +275,7 @@ HRESULT volume_init(IDirect3DVolume9Impl *volume, IDirect3DDevice9Impl *device,
|
|||
volume->IDirect3DVolume9_iface.lpVtbl = &Direct3DVolume9_Vtbl;
|
||||
volume->ref = 1;
|
||||
|
||||
hr = IWineD3DDevice_CreateVolume(device->WineD3DDevice, width, height, depth, usage & WINED3DUSAGE_MASK,
|
||||
hr = wined3d_volume_create(device->WineD3DDevice, width, height, depth, usage & WINED3DUSAGE_MASK,
|
||||
format, pool, volume, &d3d9_volume_wined3d_parent_ops, &volume->wined3d_volume);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
|
@ -443,7 +443,7 @@ HRESULT volumetexture_init(IDirect3DVolumeTexture9Impl *texture, IDirect3DDevice
|
|||
texture->ref = 1;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_CreateVolumeTexture(device->WineD3DDevice, width, height, depth, levels,
|
||||
hr = wined3d_texture_create_3d(device->WineD3DDevice, width, height, depth, levels,
|
||||
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool, texture,
|
||||
&d3d9_volumetexture_wined3d_parent_ops, &texture->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
|
|
@ -2558,7 +2558,7 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE
|
|||
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
|
||||
|
||||
parent = wined3d_surface_get_parent(wined3d_surface);
|
||||
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, wined3d_desc.width, wined3d_desc.height,
|
||||
hr = wined3d_surface_create(This->wineD3DDevice, wined3d_desc.width, wined3d_desc.height,
|
||||
wined3d_desc.format, TRUE, FALSE, surfImpl->mipmap_level, wined3d_desc.usage, wined3d_desc.pool,
|
||||
wined3d_desc.multisample_type, wined3d_desc.multisample_quality, This->ImplType,
|
||||
parent, &ddraw_surface_wined3d_parent_ops, &surfImpl->wined3d_surface);
|
||||
|
@ -5612,7 +5612,7 @@ struct wined3d_vertex_declaration *ddraw_find_decl(IDirectDrawImpl *This, DWORD
|
|||
}
|
||||
TRACE("not found. Creating and inserting at position %d.\n", low);
|
||||
|
||||
hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(This->wineD3DDevice,
|
||||
hr = wined3d_vertex_declaration_create_from_fvf(This->wineD3DDevice,
|
||||
fvf, This, &ddraw_null_wined3d_parent_ops, &pDecl);
|
||||
if (hr != S_OK) return NULL;
|
||||
|
||||
|
@ -5870,7 +5870,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar
|
|||
|
||||
TRACE("iface %p, present_parameters %p, swapchain %p\n", iface, present_parameters, swapchain);
|
||||
|
||||
hr = IWineD3DDevice_CreateSwapChain(This->wineD3DDevice, present_parameters,
|
||||
hr = wined3d_swapchain_create(This->wineD3DDevice, present_parameters,
|
||||
This->ImplType, NULL, &ddraw_null_wined3d_parent_ops, swapchain);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
|
@ -4204,7 +4204,7 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
|
|||
|
||||
TRACE("Growing index buffer to %u bytes\n", size);
|
||||
|
||||
hr = IWineD3DDevice_CreateIndexBuffer(This->wineD3DDevice, size, WINED3DUSAGE_DYNAMIC /* Usage */,
|
||||
hr = wined3d_buffer_create_ib(This->wineD3DDevice, size, WINED3DUSAGE_DYNAMIC /* Usage */,
|
||||
WINED3DPOOL_DEFAULT, NULL, &ddraw_null_wined3d_parent_ops, &buffer);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
@ -5819,7 +5819,7 @@ IDirect3DDeviceImpl_7_CreateStateBlock(IDirect3DDevice7 *iface,
|
|||
EnterCriticalSection(&ddraw_cs);
|
||||
|
||||
/* The D3DSTATEBLOCKTYPE enum is fine here. */
|
||||
hr = IWineD3DDevice_CreateStateBlock(This->wineD3DDevice, Type, &wined3d_sb);
|
||||
hr = wined3d_stateblock_create(This->wineD3DDevice, Type, &wined3d_sb);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create stateblock, hr %#x.\n", hr);
|
||||
|
@ -6811,7 +6811,7 @@ HRESULT d3d_device_init(IDirect3DDeviceImpl *device, IDirectDrawImpl *ddraw, IDi
|
|||
device->legacyTextureBlending = FALSE;
|
||||
|
||||
/* Create an index buffer, it's needed for indexed drawing */
|
||||
hr = IWineD3DDevice_CreateIndexBuffer(ddraw->wineD3DDevice, 0x40000 /* Length. Don't know how long it should be */,
|
||||
hr = wined3d_buffer_create_ib(ddraw->wineD3DDevice, 0x40000 /* Length. Don't know how long it should be */,
|
||||
WINED3DUSAGE_DYNAMIC /* Usage */, WINED3DPOOL_DEFAULT, NULL,
|
||||
&ddraw_null_wined3d_parent_ops, &device->indexbuffer);
|
||||
if (FAILED(hr))
|
||||
|
|
|
@ -266,7 +266,7 @@ HRESULT ddraw_palette_init(IDirectDrawPaletteImpl *palette,
|
|||
palette->lpVtbl = &ddraw_palette_vtbl;
|
||||
palette->ref = 1;
|
||||
|
||||
hr = IWineD3DDevice_CreatePalette(ddraw->wineD3DDevice, flags,
|
||||
hr = wined3d_palette_create(ddraw->wineD3DDevice, flags,
|
||||
entries, palette, &palette->wineD3DPalette);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
|
@ -3483,10 +3483,10 @@ HRESULT ddraw_surface_create_texture(IDirectDrawSurfaceImpl *surface)
|
|||
|
||||
format = PixelFormat_DD2WineD3D(&surface->surface_desc.u4.ddpfPixelFormat);
|
||||
if (desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
|
||||
return IWineD3DDevice_CreateCubeTexture(surface->ddraw->wineD3DDevice, desc->dwWidth,
|
||||
return wined3d_texture_create_cube(surface->ddraw->wineD3DDevice, desc->dwWidth,
|
||||
levels, 0, format, pool, surface, &ddraw_texture_wined3d_parent_ops, &surface->wined3d_texture);
|
||||
else
|
||||
return IWineD3DDevice_CreateTexture(surface->ddraw->wineD3DDevice, desc->dwWidth, desc->dwHeight,
|
||||
return wined3d_texture_create_2d(surface->ddraw->wineD3DDevice, desc->dwWidth, desc->dwHeight,
|
||||
levels, 0, format, pool, surface, &ddraw_texture_wined3d_parent_ops, &surface->wined3d_texture);
|
||||
}
|
||||
|
||||
|
@ -3572,7 +3572,7 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
|
|||
surface->first_attached = surface;
|
||||
surface->ImplType = surface_type;
|
||||
|
||||
hr = IWineD3DDevice_CreateSurface(ddraw->wineD3DDevice, desc->dwWidth, desc->dwHeight, format,
|
||||
hr = wined3d_surface_create(ddraw->wineD3DDevice, desc->dwWidth, desc->dwHeight, format,
|
||||
TRUE /* Lockable */, FALSE /* Discard */, mip_level, usage, pool,
|
||||
WINED3DMULTISAMPLE_NONE, 0 /* MultiSampleQuality */, surface_type, surface,
|
||||
&ddraw_surface_wined3d_parent_ops, &surface->wined3d_surface);
|
||||
|
|
|
@ -572,7 +572,7 @@ HRESULT d3d_vertex_buffer_init(IDirect3DVertexBufferImpl *buffer,
|
|||
|
||||
EnterCriticalSection(&ddraw_cs);
|
||||
|
||||
hr = IWineD3DDevice_CreateVertexBuffer(ddraw->wineD3DDevice,
|
||||
hr = wined3d_buffer_create_vb(ddraw->wineD3DDevice,
|
||||
get_flexible_vertex_size(desc->dwFVF) * desc->dwNumVertices,
|
||||
usage, desc->dwCaps & D3DVBCAPS_SYSTEMMEMORY ? WINED3DPOOL_SYSTEMMEM : WINED3DPOOL_DEFAULT,
|
||||
buffer, &ddraw_null_wined3d_parent_ops, &buffer->wineD3DVertexBuffer);
|
||||
|
|
|
@ -274,7 +274,7 @@ HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device
|
|||
swapchain->vtbl = &dxgi_swapchain_vtbl;
|
||||
swapchain->refcount = 1;
|
||||
|
||||
hr = IWineD3DDevice_CreateSwapChain(device->wined3d_device, present_parameters,
|
||||
hr = wined3d_swapchain_create(device->wined3d_device, present_parameters,
|
||||
SURFACE_OPENGL, swapchain, &dxgi_swapchain_wined3d_parent_ops,
|
||||
&swapchain->wined3d_swapchain);
|
||||
if (FAILED(hr))
|
||||
|
|
|
@ -1194,7 +1194,7 @@ static const struct wined3d_resource_ops buffer_resource_ops =
|
|||
buffer_unload,
|
||||
};
|
||||
|
||||
HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
|
||||
static HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
|
||||
UINT size, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, GLenum bind_hint,
|
||||
const char *data, void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -1279,3 +1279,114 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
|
|||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_buffer_create(IWineD3DDevice *iface, struct wined3d_buffer_desc *desc, const void *data,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_buffer *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, desc %p, data %p, parent %p, buffer %p\n", device, desc, data, parent, buffer);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate memory\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
FIXME("Ignoring access flags (pool)\n");
|
||||
|
||||
hr = buffer_init(object, device, desc->byte_width, desc->usage, WINED3DFMT_UNKNOWN,
|
||||
WINED3DPOOL_MANAGED, GL_ARRAY_BUFFER_ARB, data, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize buffer, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
object->desc = *desc;
|
||||
|
||||
TRACE("Created buffer %p.\n", object);
|
||||
|
||||
*buffer = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_buffer_create_vb(IWineD3DDevice *iface, UINT size, DWORD usage, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_buffer *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, size %u, usage %#x, pool %#x, parent %p, parent_ops %p, buffer %p.\n",
|
||||
device, size, usage, pool, parent, parent_ops, buffer);
|
||||
|
||||
if (pool == WINED3DPOOL_SCRATCH)
|
||||
{
|
||||
/* The d3d9 tests shows that this is not allowed. It doesn't make much
|
||||
* sense anyway, SCRATCH buffers wouldn't be usable anywhere. */
|
||||
WARN("Vertex buffer in WINED3DPOOL_SCRATCH requested, returning WINED3DERR_INVALIDCALL.\n");
|
||||
*buffer = NULL;
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*buffer = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = buffer_init(object, device, size, usage, WINED3DFMT_VERTEXDATA,
|
||||
pool, GL_ARRAY_BUFFER_ARB, NULL, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize buffer, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created buffer %p.\n", object);
|
||||
*buffer = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_buffer_create_ib(IWineD3DDevice *iface, UINT size, DWORD usage, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_buffer *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, size %u, usage %#x, pool %#x, parent %p, parent_ops %p, buffer %p.\n",
|
||||
device, size, usage, pool, parent, parent_ops, buffer);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*buffer = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = buffer_init(object, device, size, usage | WINED3DUSAGE_STATICDECL,
|
||||
WINED3DFMT_UNKNOWN, pool, GL_ELEMENT_ARRAY_BUFFER_ARB, NULL,
|
||||
parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize buffer, hr %#x\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created buffer %p.\n", object);
|
||||
*buffer = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -902,413 +902,6 @@ static ULONG WINAPI IWineD3DDeviceImpl_Release(IWineD3DDevice *iface) {
|
|||
return refCount;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateBuffer(IWineD3DDevice *iface, struct wined3d_buffer_desc *desc,
|
||||
const void *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_buffer *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, desc %p, data %p, parent %p, buffer %p\n", iface, desc, data, parent, buffer);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate memory\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
FIXME("Ignoring access flags (pool)\n");
|
||||
|
||||
hr = buffer_init(object, This, desc->byte_width, desc->usage, WINED3DFMT_UNKNOWN,
|
||||
WINED3DPOOL_MANAGED, GL_ARRAY_BUFFER_ARB, data, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize buffer, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
object->desc = *desc;
|
||||
|
||||
TRACE("Created buffer %p.\n", object);
|
||||
|
||||
*buffer = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *iface, UINT Size, DWORD Usage,
|
||||
WINED3DPOOL Pool, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_buffer *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, size %u, usage %#x, pool %#x, parent %p, parent_ops %p, buffer %p.\n",
|
||||
iface, Size, Usage, Pool, parent, parent_ops, buffer);
|
||||
|
||||
if (Pool == WINED3DPOOL_SCRATCH)
|
||||
{
|
||||
/* The d3d9 testsuit shows that this is not allowed. It doesn't make much sense
|
||||
* anyway, SCRATCH vertex buffers aren't usable anywhere
|
||||
*/
|
||||
WARN("Vertex buffer in D3DPOOL_SCRATCH requested, returning WINED3DERR_INVALIDCALL\n");
|
||||
*buffer = NULL;
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*buffer = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = buffer_init(object, This, Size, Usage, WINED3DFMT_VERTEXDATA,
|
||||
Pool, GL_ARRAY_BUFFER_ARB, NULL, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize buffer, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created buffer %p.\n", object);
|
||||
*buffer = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface, UINT Length, DWORD Usage,
|
||||
WINED3DPOOL Pool, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_buffer *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, size %u, usage %#x, pool %#x, parent %p, parent_ops %p, buffer %p.\n",
|
||||
iface, Length, Usage, Pool, parent, parent_ops, buffer);
|
||||
|
||||
/* Allocate the storage for the device */
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*buffer = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = buffer_init(object, This, Length, Usage | WINED3DUSAGE_STATICDECL,
|
||||
WINED3DFMT_UNKNOWN, Pool, GL_ELEMENT_ARRAY_BUFFER_ARB, NULL,
|
||||
parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize buffer, hr %#x\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created buffer %p.\n", object);
|
||||
|
||||
*buffer = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice *iface,
|
||||
WINED3DSTATEBLOCKTYPE type, struct wined3d_stateblock **stateblock)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_stateblock *object;
|
||||
HRESULT hr;
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if(!object)
|
||||
{
|
||||
ERR("Failed to allocate stateblock memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = stateblock_init(object, This, type);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize stateblock, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created stateblock %p.\n", object);
|
||||
*stateblock = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Width, UINT Height,
|
||||
enum wined3d_format_id Format, BOOL Lockable, BOOL Discard, UINT Level, DWORD Usage, WINED3DPOOL Pool,
|
||||
WINED3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, WINED3DSURFTYPE Impl,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_surface **surface)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_surface *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, width %u, height %u, format %s (%#x), lockable %#x, discard %#x, level %u\n",
|
||||
iface, Width, Height, debug_d3dformat(Format), Format, Lockable, Discard, Level);
|
||||
TRACE("surface %p, usage %s (%#x), pool %s (%#x), multisample_type %#x, multisample_quality %u\n",
|
||||
surface, debug_d3dusage(Usage), Usage, debug_d3dpool(Pool), Pool, MultiSample, MultisampleQuality);
|
||||
TRACE("surface_type %#x, parent %p, parent_ops %p.\n", Impl, parent, parent_ops);
|
||||
|
||||
if (Impl == SURFACE_OPENGL && !This->adapter)
|
||||
{
|
||||
ERR("OpenGL surfaces are not available without OpenGL.\n");
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate surface memory.\n");
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = surface_init(object, Impl, This->surface_alignment, Width, Height, Level, Lockable,
|
||||
Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize surface, returning %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("(%p) : Created surface %p\n", This, object);
|
||||
|
||||
*surface = object;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateRendertargetView(IWineD3DDevice *iface,
|
||||
struct wined3d_resource *resource, void *parent, struct wined3d_rendertarget_view **rendertarget_view)
|
||||
{
|
||||
struct wined3d_rendertarget_view *object;
|
||||
|
||||
TRACE("iface %p, resource %p, parent %p, rendertarget_view %p.\n",
|
||||
iface, resource, parent, rendertarget_view);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate memory\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
wined3d_rendertarget_view_init(object, resource, parent);
|
||||
|
||||
TRACE("Created render target view %p.\n", object);
|
||||
*rendertarget_view = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
|
||||
UINT Width, UINT Height, UINT Levels, DWORD Usage, enum wined3d_format_id Format, WINED3DPOOL Pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_texture *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : Width %d, Height %d, Levels %d, Usage %#x\n", This, Width, Height, Levels, Usage);
|
||||
TRACE("Format %#x (%s), Pool %#x, texture %p, parent %p\n",
|
||||
Format, debug_d3dformat(Format), Pool, texture, parent);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*texture = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = texture_init(object, Width, Height, Levels, This, Usage, Format, Pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize texture, returning %#x\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*texture = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
*texture = object;
|
||||
|
||||
TRACE("(%p) : Created texture %p\n", This, object);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *iface,
|
||||
UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, enum wined3d_format_id Format, WINED3DPOOL Pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_texture *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : W(%u) H(%u) D(%u), Lvl(%u) Usage(%#x), Fmt(%u,%s), Pool(%s)\n", This, Width, Height,
|
||||
Depth, Levels, Usage, Format, debug_d3dformat(Format), debug_d3dpool(Pool));
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*texture = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = volumetexture_init(object, Width, Height, Depth, Levels, This, Usage, Format, Pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize volumetexture, returning %#x\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*texture = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("(%p) : Created volume texture %p.\n", This, object);
|
||||
*texture = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface, UINT Width, UINT Height,
|
||||
UINT Depth, DWORD Usage, enum wined3d_format_id Format, WINED3DPOOL Pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_volume **volume)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_volume *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) : W(%d) H(%d) D(%d), Usage(%d), Fmt(%u,%s), Pool(%s)\n", This, Width, Height,
|
||||
Depth, Usage, Format, debug_d3dformat(Format), debug_d3dpool(Pool));
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*volume = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = volume_init(object, This, Width, Height, Depth, Usage, Format, Pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize volume, returning %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("(%p) : Created volume %p.\n", This, object);
|
||||
*volume = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, UINT EdgeLength, UINT Levels,
|
||||
DWORD Usage, enum wined3d_format_id Format, WINED3DPOOL Pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_texture *object;
|
||||
HRESULT hr;
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*texture = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = cubetexture_init(object, EdgeLength, Levels, This, Usage, Format, Pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize cubetexture, returning %#x\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*texture = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("(%p) : Created Cube Texture %p\n", This, object);
|
||||
*texture = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface,
|
||||
WINED3DQUERYTYPE type, struct wined3d_query **query)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_query *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, type %#x, query %p.\n", iface, type, query);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate query memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = query_init(object, This, type);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize query, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created query %p.\n", object);
|
||||
*query = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
/* Do not call while under the GL lock. */
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateSwapChain(IWineD3DDevice *iface,
|
||||
WINED3DPRESENT_PARAMETERS *present_parameters, WINED3DSURFTYPE surface_type,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops,
|
||||
struct wined3d_swapchain **swapchain)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_swapchain *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, present_parameters %p, swapchain %p, parent %p, surface_type %#x.\n",
|
||||
iface, present_parameters, swapchain, parent, surface_type);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate swapchain memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = swapchain_init(object, surface_type, This, present_parameters, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize swapchain, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created swapchain %p.\n", object);
|
||||
*swapchain = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static UINT WINAPI IWineD3DDeviceImpl_GetNumberOfSwapChains(IWineD3DDevice *iface)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
|
@ -1342,322 +935,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSwapChain(IWineD3DDevice *iface,
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice *iface,
|
||||
const WINED3DVERTEXELEMENT *elements, UINT element_count, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_vertex_declaration **declaration)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_vertex_declaration *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, elements %p, element_count %u, parent %p, parent_ops %p, declaration %p.\n",
|
||||
iface, elements, element_count, parent, parent_ops, declaration);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if(!object)
|
||||
{
|
||||
ERR("Failed to allocate vertex declaration memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = vertexdeclaration_init(object, This, elements, element_count, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize vertex declaration, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created vertex declaration %p.\n", object);
|
||||
*declaration = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
struct wined3d_fvf_convert_state
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
WINED3DVERTEXELEMENT *elements;
|
||||
UINT offset;
|
||||
UINT idx;
|
||||
};
|
||||
|
||||
static void append_decl_element(struct wined3d_fvf_convert_state *state,
|
||||
enum wined3d_format_id format_id, WINED3DDECLUSAGE usage, UINT usage_idx)
|
||||
{
|
||||
WINED3DVERTEXELEMENT *elements = state->elements;
|
||||
const struct wined3d_format *format;
|
||||
UINT offset = state->offset;
|
||||
UINT idx = state->idx;
|
||||
|
||||
elements[idx].format = format_id;
|
||||
elements[idx].input_slot = 0;
|
||||
elements[idx].offset = offset;
|
||||
elements[idx].output_slot = 0;
|
||||
elements[idx].method = WINED3DDECLMETHOD_DEFAULT;
|
||||
elements[idx].usage = usage;
|
||||
elements[idx].usage_idx = usage_idx;
|
||||
|
||||
format = wined3d_get_format(state->gl_info, format_id);
|
||||
state->offset += format->component_count * format->component_size;
|
||||
++state->idx;
|
||||
}
|
||||
|
||||
static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the GL info, which has the type table */
|
||||
DWORD fvf, WINED3DVERTEXELEMENT **ppVertexElements)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
|
||||
BOOL has_pos = !!(fvf & WINED3DFVF_POSITION_MASK);
|
||||
BOOL has_blend = (fvf & WINED3DFVF_XYZB5) > WINED3DFVF_XYZRHW;
|
||||
BOOL has_blend_idx = has_blend &&
|
||||
(((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB5) ||
|
||||
(fvf & WINED3DFVF_LASTBETA_D3DCOLOR) ||
|
||||
(fvf & WINED3DFVF_LASTBETA_UBYTE4));
|
||||
BOOL has_normal = !!(fvf & WINED3DFVF_NORMAL);
|
||||
BOOL has_psize = !!(fvf & WINED3DFVF_PSIZE);
|
||||
BOOL has_diffuse = !!(fvf & WINED3DFVF_DIFFUSE);
|
||||
BOOL has_specular = !!(fvf & WINED3DFVF_SPECULAR);
|
||||
|
||||
DWORD num_textures = (fvf & WINED3DFVF_TEXCOUNT_MASK) >> WINED3DFVF_TEXCOUNT_SHIFT;
|
||||
DWORD texcoords = (fvf & 0xFFFF0000) >> 16;
|
||||
struct wined3d_fvf_convert_state state;
|
||||
unsigned int size;
|
||||
unsigned int idx;
|
||||
DWORD num_blends = 1 + (((fvf & WINED3DFVF_XYZB5) - WINED3DFVF_XYZB1) >> 1);
|
||||
if (has_blend_idx) num_blends--;
|
||||
|
||||
/* Compute declaration size */
|
||||
size = has_pos + (has_blend && num_blends > 0) + has_blend_idx + has_normal +
|
||||
has_psize + has_diffuse + has_specular + num_textures;
|
||||
|
||||
state.gl_info = gl_info;
|
||||
state.elements = HeapAlloc(GetProcessHeap(), 0, size * sizeof(*state.elements));
|
||||
if (!state.elements) return ~0U;
|
||||
state.offset = 0;
|
||||
state.idx = 0;
|
||||
|
||||
if (has_pos)
|
||||
{
|
||||
if (!has_blend && (fvf & WINED3DFVF_XYZRHW))
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32A32_FLOAT, WINED3DDECLUSAGE_POSITIONT, 0);
|
||||
else if ((fvf & WINED3DFVF_XYZW) == WINED3DFVF_XYZW)
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32A32_FLOAT, WINED3DDECLUSAGE_POSITION, 0);
|
||||
else
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32_FLOAT, WINED3DDECLUSAGE_POSITION, 0);
|
||||
}
|
||||
|
||||
if (has_blend && (num_blends > 0))
|
||||
{
|
||||
if ((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2 && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR))
|
||||
append_decl_element(&state, WINED3DFMT_B8G8R8A8_UNORM, WINED3DDECLUSAGE_BLENDWEIGHT, 0);
|
||||
else
|
||||
{
|
||||
switch (num_blends)
|
||||
{
|
||||
case 1:
|
||||
append_decl_element(&state, WINED3DFMT_R32_FLOAT, WINED3DDECLUSAGE_BLENDWEIGHT, 0);
|
||||
break;
|
||||
case 2:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32_FLOAT, WINED3DDECLUSAGE_BLENDWEIGHT, 0);
|
||||
break;
|
||||
case 3:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32_FLOAT, WINED3DDECLUSAGE_BLENDWEIGHT, 0);
|
||||
break;
|
||||
case 4:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32A32_FLOAT, WINED3DDECLUSAGE_BLENDWEIGHT, 0);
|
||||
break;
|
||||
default:
|
||||
ERR("Unexpected amount of blend values: %u\n", num_blends);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (has_blend_idx)
|
||||
{
|
||||
if ((fvf & WINED3DFVF_LASTBETA_UBYTE4)
|
||||
|| ((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2 && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR)))
|
||||
append_decl_element(&state, WINED3DFMT_R8G8B8A8_UINT, WINED3DDECLUSAGE_BLENDINDICES, 0);
|
||||
else if (fvf & WINED3DFVF_LASTBETA_D3DCOLOR)
|
||||
append_decl_element(&state, WINED3DFMT_B8G8R8A8_UNORM, WINED3DDECLUSAGE_BLENDINDICES, 0);
|
||||
else
|
||||
append_decl_element(&state, WINED3DFMT_R32_FLOAT, WINED3DDECLUSAGE_BLENDINDICES, 0);
|
||||
}
|
||||
|
||||
if (has_normal) append_decl_element(&state, WINED3DFMT_R32G32B32_FLOAT, WINED3DDECLUSAGE_NORMAL, 0);
|
||||
if (has_psize) append_decl_element(&state, WINED3DFMT_R32_FLOAT, WINED3DDECLUSAGE_PSIZE, 0);
|
||||
if (has_diffuse) append_decl_element(&state, WINED3DFMT_B8G8R8A8_UNORM, WINED3DDECLUSAGE_COLOR, 0);
|
||||
if (has_specular) append_decl_element(&state, WINED3DFMT_B8G8R8A8_UNORM, WINED3DDECLUSAGE_COLOR, 1);
|
||||
|
||||
for (idx = 0; idx < num_textures; ++idx)
|
||||
{
|
||||
switch ((texcoords >> (idx * 2)) & 0x03)
|
||||
{
|
||||
case WINED3DFVF_TEXTUREFORMAT1:
|
||||
append_decl_element(&state, WINED3DFMT_R32_FLOAT, WINED3DDECLUSAGE_TEXCOORD, idx);
|
||||
break;
|
||||
case WINED3DFVF_TEXTUREFORMAT2:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32_FLOAT, WINED3DDECLUSAGE_TEXCOORD, idx);
|
||||
break;
|
||||
case WINED3DFVF_TEXTUREFORMAT3:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32_FLOAT, WINED3DDECLUSAGE_TEXCOORD, idx);
|
||||
break;
|
||||
case WINED3DFVF_TEXTUREFORMAT4:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32A32_FLOAT, WINED3DDECLUSAGE_TEXCOORD, idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*ppVertexElements = state.elements;
|
||||
return size;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF(IWineD3DDevice *iface,
|
||||
DWORD fvf, void *parent, const struct wined3d_parent_ops *parent_ops,
|
||||
struct wined3d_vertex_declaration **declaration)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
|
||||
WINED3DVERTEXELEMENT *elements;
|
||||
unsigned int size;
|
||||
DWORD hr;
|
||||
|
||||
TRACE("iface %p, fvf %#x, parent %p, parent_ops %p, declaration %p.\n",
|
||||
iface, fvf, parent, parent_ops, declaration);
|
||||
|
||||
size = ConvertFvfToDeclaration(This, fvf, &elements);
|
||||
if (size == ~0U) return E_OUTOFMEMORY;
|
||||
|
||||
hr = IWineD3DDeviceImpl_CreateVertexDeclaration(iface, elements, size, parent, parent_ops, declaration);
|
||||
HeapFree(GetProcessHeap(), 0, elements);
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice *iface,
|
||||
const DWORD *pFunction, const struct wined3d_shader_signature *output_signature,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops,
|
||||
struct wined3d_shader **shader)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_shader *object;
|
||||
HRESULT hr;
|
||||
|
||||
if (This->vs_selected_mode == SHADER_NONE)
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = vertexshader_init(object, This, pFunction, output_signature, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize vertex shader, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created vertex shader %p.\n", object);
|
||||
*shader = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreateGeometryShader(IWineD3DDevice *iface,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops,
|
||||
struct wined3d_shader **shader)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_shader *object;
|
||||
HRESULT hr;
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = geometryshader_init(object, This, byte_code, output_signature, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize geometry shader, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created geometry shader %p.\n", object);
|
||||
*shader = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface,
|
||||
const DWORD *pFunction, const struct wined3d_shader_signature *output_signature,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops,
|
||||
struct wined3d_shader **shader)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_shader *object;
|
||||
HRESULT hr;
|
||||
|
||||
if (This->ps_selected_mode == SHADER_NONE)
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = pixelshader_init(object, This, pFunction, output_signature, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize pixel shader, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created pixel shader %p.\n", object);
|
||||
*shader = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DWORD flags,
|
||||
const PALETTEENTRY *entries, void *parent, struct wined3d_palette **palette)
|
||||
{
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
|
||||
struct wined3d_palette *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, flags %#x, entries %p, palette %p, parent %p.\n",
|
||||
iface, flags, entries, palette, parent);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate palette memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = wined3d_palette_init(object, This, flags, entries, parent);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize palette, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created palette %p.\n", object);
|
||||
*palette = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static void IWineD3DDeviceImpl_LoadLogo(IWineD3DDeviceImpl *This, const char *filename) {
|
||||
HBITMAP hbm;
|
||||
BITMAP bm;
|
||||
|
@ -1683,7 +960,7 @@ static void IWineD3DDeviceImpl_LoadLogo(IWineD3DDeviceImpl *This, const char *fi
|
|||
bm.bmHeight = 32;
|
||||
}
|
||||
|
||||
hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *)This, bm.bmWidth, bm.bmHeight, WINED3DFMT_B5G6R5_UNORM, TRUE,
|
||||
hr = wined3d_surface_create((IWineD3DDevice *)This, bm.bmWidth, bm.bmHeight, WINED3DFMT_B5G6R5_UNORM, TRUE,
|
||||
FALSE, 0, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, NULL,
|
||||
&wined3d_null_parent_ops, &This->logo_surface);
|
||||
if (FAILED(hr))
|
||||
|
@ -1907,7 +1184,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
|
|||
if(!This->adapter->opengl) return WINED3DERR_INVALIDCALL;
|
||||
|
||||
TRACE("(%p) : Creating stateblock\n", This);
|
||||
hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, &This->stateBlock);
|
||||
hr = wined3d_stateblock_create(iface, WINED3DSBT_INIT, &This->stateBlock);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create stateblock\n");
|
||||
|
@ -4700,7 +3977,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_BeginStateBlock(IWineD3DDevice *iface)
|
|||
|
||||
if (This->isRecordingState) return WINED3DERR_INVALIDCALL;
|
||||
|
||||
hr = IWineD3DDeviceImpl_CreateStateBlock(iface, WINED3DSBT_RECORDED, &stateblock);
|
||||
hr = wined3d_stateblock_create(iface, WINED3DSBT_RECORDED, &stateblock);
|
||||
if (FAILED(hr)) return hr;
|
||||
|
||||
wined3d_stateblock_decref(This->updateStateBlock);
|
||||
|
@ -6597,7 +5874,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice *iface,
|
|||
}
|
||||
|
||||
/* Note: No parent needed for initial internal stateblock */
|
||||
hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, &This->stateBlock);
|
||||
hr = wined3d_stateblock_create(iface, WINED3DSBT_INIT, &This->stateBlock);
|
||||
if (FAILED(hr)) ERR("Resetting the stateblock failed with error 0x%08x\n", hr);
|
||||
else TRACE("Created stateblock %p\n", This->stateBlock);
|
||||
This->updateStateBlock = This->stateBlock;
|
||||
|
@ -6863,25 +6140,6 @@ static const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
|
|||
IWineD3DDeviceImpl_AddRef,
|
||||
IWineD3DDeviceImpl_Release,
|
||||
/*** IWineD3DDevice methods ***/
|
||||
/*** Creation methods**/
|
||||
IWineD3DDeviceImpl_CreateBuffer,
|
||||
IWineD3DDeviceImpl_CreateVertexBuffer,
|
||||
IWineD3DDeviceImpl_CreateIndexBuffer,
|
||||
IWineD3DDeviceImpl_CreateStateBlock,
|
||||
IWineD3DDeviceImpl_CreateSurface,
|
||||
IWineD3DDeviceImpl_CreateRendertargetView,
|
||||
IWineD3DDeviceImpl_CreateTexture,
|
||||
IWineD3DDeviceImpl_CreateVolumeTexture,
|
||||
IWineD3DDeviceImpl_CreateVolume,
|
||||
IWineD3DDeviceImpl_CreateCubeTexture,
|
||||
IWineD3DDeviceImpl_CreateQuery,
|
||||
IWineD3DDeviceImpl_CreateSwapChain,
|
||||
IWineD3DDeviceImpl_CreateVertexDeclaration,
|
||||
IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF,
|
||||
IWineD3DDeviceImpl_CreateVertexShader,
|
||||
IWineD3DDeviceImpl_CreateGeometryShader,
|
||||
IWineD3DDeviceImpl_CreatePixelShader,
|
||||
IWineD3DDeviceImpl_CreatePalette,
|
||||
/*** Odd functions **/
|
||||
IWineD3DDeviceImpl_Init3D,
|
||||
IWineD3DDeviceImpl_InitGDI,
|
||||
|
|
|
@ -158,7 +158,7 @@ void * CDECL wined3d_palette_get_parent(const struct wined3d_palette *palette)
|
|||
return palette->parent;
|
||||
}
|
||||
|
||||
HRESULT wined3d_palette_init(struct wined3d_palette *palette, IWineD3DDeviceImpl *device,
|
||||
static HRESULT wined3d_palette_init(struct wined3d_palette *palette, IWineD3DDeviceImpl *device,
|
||||
DWORD flags, const PALETTEENTRY *entries, void *parent)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
@ -186,3 +186,34 @@ HRESULT wined3d_palette_init(struct wined3d_palette *palette, IWineD3DDeviceImpl
|
|||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_palette_create(IWineD3DDevice *iface, DWORD flags,
|
||||
const PALETTEENTRY *entries, void *parent, struct wined3d_palette **palette)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_palette *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, flags %#x, entries %p, palette %p, parent %p.\n",
|
||||
device, flags, entries, palette, parent);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate palette memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = wined3d_palette_init(object, device, flags, entries, parent);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize palette, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created palette %p.\n", object);
|
||||
*palette = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -547,7 +547,7 @@ static const struct wined3d_query_ops occlusion_query_ops =
|
|||
wined3d_occlusion_query_ops_issue,
|
||||
};
|
||||
|
||||
HRESULT query_init(struct wined3d_query *query, IWineD3DDeviceImpl *device, WINED3DQUERYTYPE type)
|
||||
static HRESULT query_init(struct wined3d_query *query, IWineD3DDeviceImpl *device, WINED3DQUERYTYPE type)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
|
||||
|
@ -615,3 +615,33 @@ HRESULT query_init(struct wined3d_query *query, IWineD3DDeviceImpl *device, WINE
|
|||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_query_create(IWineD3DDevice *iface,
|
||||
WINED3DQUERYTYPE type, struct wined3d_query **query)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_query *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, type %#x, query %p.\n", device, type, query);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate query memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = query_init(object, device, type);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize query, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created query %p.\n", object);
|
||||
*query = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -1795,7 +1795,7 @@ static void vertexshader_set_limits(struct wined3d_shader *shader)
|
|||
}
|
||||
}
|
||||
|
||||
HRESULT vertexshader_init(struct wined3d_shader *shader, IWineD3DDeviceImpl *device,
|
||||
static HRESULT vertexshader_init(struct wined3d_shader *shader, IWineD3DDeviceImpl *device,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -1844,7 +1844,7 @@ HRESULT vertexshader_init(struct wined3d_shader *shader, IWineD3DDeviceImpl *dev
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT geometryshader_init(struct wined3d_shader *shader, IWineD3DDeviceImpl *device,
|
||||
static HRESULT geometryshader_init(struct wined3d_shader *shader, IWineD3DDeviceImpl *device,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -2050,7 +2050,7 @@ static void pixelshader_set_limits(struct wined3d_shader *shader)
|
|||
}
|
||||
}
|
||||
|
||||
HRESULT pixelshader_init(struct wined3d_shader *shader, IWineD3DDeviceImpl *device,
|
||||
static HRESULT pixelshader_init(struct wined3d_shader *shader, IWineD3DDeviceImpl *device,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -2159,3 +2159,105 @@ void pixelshader_update_samplers(struct wined3d_shader_reg_maps *reg_maps, struc
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_shader_create_gs(IWineD3DDevice *iface, const DWORD *byte_code,
|
||||
const struct wined3d_shader_signature *output_signature, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_shader *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, byte_code %p, output_signature %p, parent %p, parent_ops %p, shader %p.\n",
|
||||
device, byte_code, output_signature, parent, parent_ops, shader);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = geometryshader_init(object, device, byte_code, output_signature, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize geometry shader, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created geometry shader %p.\n", object);
|
||||
*shader = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_shader_create_ps(IWineD3DDevice *iface, const DWORD *byte_code,
|
||||
const struct wined3d_shader_signature *output_signature, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_shader *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, byte_code %p, output_signature %p, parent %p, parent_ops %p, shader %p.\n",
|
||||
device, byte_code, output_signature, parent, parent_ops, shader);
|
||||
|
||||
if (device->ps_selected_mode == SHADER_NONE)
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = pixelshader_init(object, device, byte_code, output_signature, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize pixel shader, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created pixel shader %p.\n", object);
|
||||
*shader = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_shader_create_vs(IWineD3DDevice *iface, const DWORD *byte_code,
|
||||
const struct wined3d_shader_signature *output_signature, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_shader *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, byte_code %p, output_signature %p, parent %p, parent_ops %p, shader %p.\n",
|
||||
device, byte_code, output_signature, parent, parent_ops, shader);
|
||||
|
||||
if (device->vs_selected_mode == SHADER_NONE)
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = vertexshader_init(object, device, byte_code, output_signature, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize vertex shader, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created vertex shader %p.\n", object);
|
||||
*shader = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -1327,7 +1327,8 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
|
|||
TRACE("Done.\n");
|
||||
}
|
||||
|
||||
HRESULT stateblock_init(struct wined3d_stateblock *stateblock, IWineD3DDeviceImpl *device, WINED3DSTATEBLOCKTYPE type)
|
||||
static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
|
||||
IWineD3DDeviceImpl *device, WINED3DSTATEBLOCKTYPE type)
|
||||
{
|
||||
unsigned int i;
|
||||
HRESULT hr;
|
||||
|
@ -1378,3 +1379,34 @@ HRESULT stateblock_init(struct wined3d_stateblock *stateblock, IWineD3DDeviceImp
|
|||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_stateblock_create(IWineD3DDevice *iface,
|
||||
WINED3DSTATEBLOCKTYPE type, struct wined3d_stateblock **stateblock)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_stateblock *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, type %#x, stateblock %p.\n",
|
||||
device, type, stateblock);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate stateblock memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = stateblock_init(object, device, type);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize stateblock, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created stateblock %p.\n", object);
|
||||
*stateblock = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -3304,7 +3304,7 @@ static struct wined3d_surface *surface_convert_format(struct wined3d_surface *so
|
|||
return NULL;
|
||||
}
|
||||
|
||||
IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.device, source->resource.width,
|
||||
wined3d_surface_create((IWineD3DDevice *)source->resource.device, source->resource.width,
|
||||
source->resource.height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */,
|
||||
0 /* usage */, WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */,
|
||||
0 /* MultiSampleQuality */, source->surface_type, NULL /* parent */, &wined3d_null_parent_ops, &ret);
|
||||
|
@ -7325,7 +7325,7 @@ const struct blit_shader cpu_blit = {
|
|||
cpu_blit_depth_fill,
|
||||
};
|
||||
|
||||
HRESULT surface_init(struct wined3d_surface *surface, WINED3DSURFTYPE surface_type, UINT alignment,
|
||||
static HRESULT surface_init(struct wined3d_surface *surface, WINED3DSURFTYPE surface_type, UINT alignment,
|
||||
UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type,
|
||||
UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id,
|
||||
WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
|
@ -7451,3 +7451,46 @@ HRESULT surface_init(struct wined3d_surface *surface, WINED3DSURFTYPE surface_ty
|
|||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_surface_create(IWineD3DDevice *iface, UINT width, UINT height,
|
||||
enum wined3d_format_id format_id, BOOL lockable, BOOL discard, UINT level, DWORD usage, WINED3DPOOL pool,
|
||||
WINED3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, WINED3DSURFTYPE surface_type,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_surface **surface)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_surface *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, width %u, height %u, format %s, lockable %#x, discard %#x, level %u\n",
|
||||
device, width, height, debug_d3dformat(format_id), lockable, discard, level);
|
||||
TRACE("surface %p, usage %s (%#x), pool %s, multisample_type %#x, multisample_quality %u\n",
|
||||
surface, debug_d3dusage(usage), usage, debug_d3dpool(pool), multisample_type, multisample_quality);
|
||||
TRACE("surface_type %#x, parent %p, parent_ops %p.\n", surface_type, parent, parent_ops);
|
||||
|
||||
if (surface_type == SURFACE_OPENGL && !device->adapter)
|
||||
{
|
||||
ERR("OpenGL surfaces are not available without OpenGL.\n");
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate surface memory.\n");
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = surface_init(object, surface_type, device->surface_alignment, width, height, level, lockable,
|
||||
discard, multisample_type, multisample_quality, device, usage, format_id, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize surface, returning %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created surface %p.\n", object);
|
||||
*surface = object;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -801,7 +801,7 @@ static const struct wined3d_swapchain_ops swapchain_gdi_ops =
|
|||
};
|
||||
|
||||
/* Do not call while under the GL lock. */
|
||||
HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surface_type,
|
||||
static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surface_type,
|
||||
IWineD3DDeviceImpl *device, WINED3DPRESENT_PARAMETERS *present_parameters,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -1091,6 +1091,40 @@ err:
|
|||
return hr;
|
||||
}
|
||||
|
||||
/* Do not call while under the GL lock. */
|
||||
HRESULT CDECL wined3d_swapchain_create(IWineD3DDevice *iface,
|
||||
WINED3DPRESENT_PARAMETERS *present_parameters, WINED3DSURFTYPE surface_type,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops,
|
||||
struct wined3d_swapchain **swapchain)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_swapchain *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, present_parameters %p, swapchain %p, parent %p, surface_type %#x.\n",
|
||||
device, present_parameters, swapchain, parent, surface_type);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate swapchain memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = swapchain_init(object, surface_type, device, present_parameters, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize swapchain, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created swapchain %p.\n", object);
|
||||
*swapchain = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
/* Do not call while under the GL lock. */
|
||||
static struct wined3d_context *swapchain_create_context(struct wined3d_swapchain *swapchain)
|
||||
{
|
||||
|
|
|
@ -796,7 +796,7 @@ static const struct wined3d_resource_ops texture2d_resource_ops =
|
|||
texture2d_unload,
|
||||
};
|
||||
|
||||
HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT levels,
|
||||
static HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -915,7 +915,7 @@ HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, UINT levels,
|
||||
static HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -1186,7 +1186,7 @@ static const struct wined3d_resource_ops texture3d_resource_ops =
|
|||
texture3d_unload,
|
||||
};
|
||||
|
||||
HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, UINT height,
|
||||
static HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, UINT height,
|
||||
UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id,
|
||||
WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -1280,3 +1280,114 @@ HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, UINT hei
|
|||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_texture_create_2d(IWineD3DDevice *iface, UINT width, UINT height,
|
||||
UINT level_count, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_texture *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, width %u, height %u, level_count %u, usage %#x\n",
|
||||
device, width, height, level_count, usage);
|
||||
TRACE("format %s, pool %#x, parent %p, parent_ops %p, texture %p.\n",
|
||||
debug_d3dformat(format_id), pool, parent, parent_ops, texture);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory.\n");
|
||||
*texture = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = texture_init(object, width, height, level_count,
|
||||
device, usage, format_id, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize texture, returning %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*texture = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created texture %p.\n", object);
|
||||
*texture = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_texture_create_3d(IWineD3DDevice *iface, UINT width, UINT height, UINT depth,
|
||||
UINT level_count, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_texture *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, width %u, height %u, depth %u, level_count %u, usage %#x\n",
|
||||
device, width, height, depth, level_count, usage);
|
||||
TRACE("format %s, pool %#x, parent %p, parent_ops %p, texture %p.\n",
|
||||
debug_d3dformat(format_id), pool, parent, parent_ops, texture);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*texture = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = volumetexture_init(object, width, height, depth, level_count,
|
||||
device, usage, format_id, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize volumetexture, returning %#x\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*texture = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created texture %p.\n", object);
|
||||
*texture = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_texture_create_cube(IWineD3DDevice *iface, UINT edge_length,
|
||||
UINT level_count, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_texture *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, edge_length %u, level_count %u, usage %#x\n",
|
||||
device, edge_length, level_count, usage);
|
||||
TRACE("format %s, pool %#x, parent %p, parent_ops %p, texture %p.\n",
|
||||
debug_d3dformat(format_id), pool, parent, parent_ops, texture);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*texture = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = cubetexture_init(object, edge_length, level_count,
|
||||
device, usage, format_id, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize cubetexture, returning %#x\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
*texture = NULL;
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created texture %p.\n", object);
|
||||
*texture = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
|
|||
}
|
||||
}
|
||||
|
||||
HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declaration, IWineD3DDeviceImpl *device,
|
||||
static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declaration, IWineD3DDeviceImpl *device,
|
||||
const WINED3DVERTEXELEMENT *elements, UINT element_count,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -236,3 +236,191 @@ HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declaration, I
|
|||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_vertex_declaration_create(IWineD3DDevice *iface,
|
||||
const WINED3DVERTEXELEMENT *elements, UINT element_count, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_vertex_declaration **declaration)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_vertex_declaration *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, elements %p, element_count %u, parent %p, parent_ops %p, declaration %p.\n",
|
||||
device, elements, element_count, parent, parent_ops, declaration);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if(!object)
|
||||
{
|
||||
ERR("Failed to allocate vertex declaration memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = vertexdeclaration_init(object, device, elements, element_count, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize vertex declaration, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created vertex declaration %p.\n", object);
|
||||
*declaration = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
struct wined3d_fvf_convert_state
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
WINED3DVERTEXELEMENT *elements;
|
||||
UINT offset;
|
||||
UINT idx;
|
||||
};
|
||||
|
||||
static void append_decl_element(struct wined3d_fvf_convert_state *state,
|
||||
enum wined3d_format_id format_id, WINED3DDECLUSAGE usage, UINT usage_idx)
|
||||
{
|
||||
WINED3DVERTEXELEMENT *elements = state->elements;
|
||||
const struct wined3d_format *format;
|
||||
UINT offset = state->offset;
|
||||
UINT idx = state->idx;
|
||||
|
||||
elements[idx].format = format_id;
|
||||
elements[idx].input_slot = 0;
|
||||
elements[idx].offset = offset;
|
||||
elements[idx].output_slot = 0;
|
||||
elements[idx].method = WINED3DDECLMETHOD_DEFAULT;
|
||||
elements[idx].usage = usage;
|
||||
elements[idx].usage_idx = usage_idx;
|
||||
|
||||
format = wined3d_get_format(state->gl_info, format_id);
|
||||
state->offset += format->component_count * format->component_size;
|
||||
++state->idx;
|
||||
}
|
||||
|
||||
static unsigned int convert_fvf_to_declaration(const struct wined3d_gl_info *gl_info,
|
||||
DWORD fvf, WINED3DVERTEXELEMENT **elements)
|
||||
{
|
||||
BOOL has_pos = !!(fvf & WINED3DFVF_POSITION_MASK);
|
||||
BOOL has_blend = (fvf & WINED3DFVF_XYZB5) > WINED3DFVF_XYZRHW;
|
||||
BOOL has_blend_idx = has_blend &&
|
||||
(((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB5) ||
|
||||
(fvf & WINED3DFVF_LASTBETA_D3DCOLOR) ||
|
||||
(fvf & WINED3DFVF_LASTBETA_UBYTE4));
|
||||
BOOL has_normal = !!(fvf & WINED3DFVF_NORMAL);
|
||||
BOOL has_psize = !!(fvf & WINED3DFVF_PSIZE);
|
||||
BOOL has_diffuse = !!(fvf & WINED3DFVF_DIFFUSE);
|
||||
BOOL has_specular = !!(fvf & WINED3DFVF_SPECULAR);
|
||||
|
||||
DWORD num_textures = (fvf & WINED3DFVF_TEXCOUNT_MASK) >> WINED3DFVF_TEXCOUNT_SHIFT;
|
||||
DWORD texcoords = (fvf & 0xFFFF0000) >> 16;
|
||||
struct wined3d_fvf_convert_state state;
|
||||
unsigned int size;
|
||||
unsigned int idx;
|
||||
DWORD num_blends = 1 + (((fvf & WINED3DFVF_XYZB5) - WINED3DFVF_XYZB1) >> 1);
|
||||
if (has_blend_idx) num_blends--;
|
||||
|
||||
/* Compute declaration size */
|
||||
size = has_pos + (has_blend && num_blends > 0) + has_blend_idx + has_normal +
|
||||
has_psize + has_diffuse + has_specular + num_textures;
|
||||
|
||||
state.gl_info = gl_info;
|
||||
state.elements = HeapAlloc(GetProcessHeap(), 0, size * sizeof(*state.elements));
|
||||
if (!state.elements) return ~0U;
|
||||
state.offset = 0;
|
||||
state.idx = 0;
|
||||
|
||||
if (has_pos)
|
||||
{
|
||||
if (!has_blend && (fvf & WINED3DFVF_XYZRHW))
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32A32_FLOAT, WINED3DDECLUSAGE_POSITIONT, 0);
|
||||
else if ((fvf & WINED3DFVF_XYZW) == WINED3DFVF_XYZW)
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32A32_FLOAT, WINED3DDECLUSAGE_POSITION, 0);
|
||||
else
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32_FLOAT, WINED3DDECLUSAGE_POSITION, 0);
|
||||
}
|
||||
|
||||
if (has_blend && (num_blends > 0))
|
||||
{
|
||||
if ((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2 && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR))
|
||||
append_decl_element(&state, WINED3DFMT_B8G8R8A8_UNORM, WINED3DDECLUSAGE_BLENDWEIGHT, 0);
|
||||
else
|
||||
{
|
||||
switch (num_blends)
|
||||
{
|
||||
case 1:
|
||||
append_decl_element(&state, WINED3DFMT_R32_FLOAT, WINED3DDECLUSAGE_BLENDWEIGHT, 0);
|
||||
break;
|
||||
case 2:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32_FLOAT, WINED3DDECLUSAGE_BLENDWEIGHT, 0);
|
||||
break;
|
||||
case 3:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32_FLOAT, WINED3DDECLUSAGE_BLENDWEIGHT, 0);
|
||||
break;
|
||||
case 4:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32A32_FLOAT, WINED3DDECLUSAGE_BLENDWEIGHT, 0);
|
||||
break;
|
||||
default:
|
||||
ERR("Unexpected amount of blend values: %u\n", num_blends);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (has_blend_idx)
|
||||
{
|
||||
if ((fvf & WINED3DFVF_LASTBETA_UBYTE4)
|
||||
|| ((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2 && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR)))
|
||||
append_decl_element(&state, WINED3DFMT_R8G8B8A8_UINT, WINED3DDECLUSAGE_BLENDINDICES, 0);
|
||||
else if (fvf & WINED3DFVF_LASTBETA_D3DCOLOR)
|
||||
append_decl_element(&state, WINED3DFMT_B8G8R8A8_UNORM, WINED3DDECLUSAGE_BLENDINDICES, 0);
|
||||
else
|
||||
append_decl_element(&state, WINED3DFMT_R32_FLOAT, WINED3DDECLUSAGE_BLENDINDICES, 0);
|
||||
}
|
||||
|
||||
if (has_normal) append_decl_element(&state, WINED3DFMT_R32G32B32_FLOAT, WINED3DDECLUSAGE_NORMAL, 0);
|
||||
if (has_psize) append_decl_element(&state, WINED3DFMT_R32_FLOAT, WINED3DDECLUSAGE_PSIZE, 0);
|
||||
if (has_diffuse) append_decl_element(&state, WINED3DFMT_B8G8R8A8_UNORM, WINED3DDECLUSAGE_COLOR, 0);
|
||||
if (has_specular) append_decl_element(&state, WINED3DFMT_B8G8R8A8_UNORM, WINED3DDECLUSAGE_COLOR, 1);
|
||||
|
||||
for (idx = 0; idx < num_textures; ++idx)
|
||||
{
|
||||
switch ((texcoords >> (idx * 2)) & 0x03)
|
||||
{
|
||||
case WINED3DFVF_TEXTUREFORMAT1:
|
||||
append_decl_element(&state, WINED3DFMT_R32_FLOAT, WINED3DDECLUSAGE_TEXCOORD, idx);
|
||||
break;
|
||||
case WINED3DFVF_TEXTUREFORMAT2:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32_FLOAT, WINED3DDECLUSAGE_TEXCOORD, idx);
|
||||
break;
|
||||
case WINED3DFVF_TEXTUREFORMAT3:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32_FLOAT, WINED3DDECLUSAGE_TEXCOORD, idx);
|
||||
break;
|
||||
case WINED3DFVF_TEXTUREFORMAT4:
|
||||
append_decl_element(&state, WINED3DFMT_R32G32B32A32_FLOAT, WINED3DDECLUSAGE_TEXCOORD, idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*elements = state.elements;
|
||||
return size;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_vertex_declaration_create_from_fvf(IWineD3DDevice *iface,
|
||||
DWORD fvf, void *parent, const struct wined3d_parent_ops *parent_ops,
|
||||
struct wined3d_vertex_declaration **declaration)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
WINED3DVERTEXELEMENT *elements;
|
||||
unsigned int size;
|
||||
DWORD hr;
|
||||
|
||||
TRACE("device %p, fvf %#x, parent %p, parent_ops %p, declaration %p.\n",
|
||||
device, fvf, parent, parent_ops, declaration);
|
||||
|
||||
size = convert_fvf_to_declaration(&device->adapter->gl_info, fvf, &elements);
|
||||
if (size == ~0U) return E_OUTOFMEMORY;
|
||||
|
||||
hr = wined3d_vertex_declaration_create(iface, elements, size, parent, parent_ops, declaration);
|
||||
HeapFree(GetProcessHeap(), 0, elements);
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -59,10 +59,33 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str
|
|||
return view->resource;
|
||||
}
|
||||
|
||||
void wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view,
|
||||
static void wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view,
|
||||
struct wined3d_resource *resource, void *parent)
|
||||
{
|
||||
view->refcount = 1;
|
||||
view->resource = resource;
|
||||
view->parent = parent;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_rendertarget_view_create(struct wined3d_resource *resource,
|
||||
void *parent, struct wined3d_rendertarget_view **rendertarget_view)
|
||||
{
|
||||
struct wined3d_rendertarget_view *object;
|
||||
|
||||
TRACE("resource %p, parent %p, rendertarget_view %p.\n",
|
||||
resource, parent, rendertarget_view);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate memory\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
wined3d_rendertarget_view_init(object, resource, parent);
|
||||
|
||||
TRACE("Created render target view %p.\n", object);
|
||||
*rendertarget_view = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -296,7 +296,7 @@ static const struct wined3d_resource_ops volume_resource_ops =
|
|||
volume_unload,
|
||||
};
|
||||
|
||||
HRESULT volume_init(struct wined3d_volume *volume, IWineD3DDeviceImpl *device, UINT width,
|
||||
static HRESULT volume_init(struct wined3d_volume *volume, IWineD3DDeviceImpl *device, UINT width,
|
||||
UINT height, UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -329,3 +329,37 @@ HRESULT volume_init(struct wined3d_volume *volume, IWineD3DDeviceImpl *device, U
|
|||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_volume_create(IWineD3DDevice *iface, UINT width, UINT height,
|
||||
UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_volume **volume)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
|
||||
struct wined3d_volume *object;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("device %p, width %u, height %u, depth %u, usage %#x, format %s, pool %s\n",
|
||||
device, width, height, depth, usage, debug_d3dformat(format_id), debug_d3dpool(pool));
|
||||
TRACE("parent %p, parent_ops %p, volume %p.\n", parent, parent_ops, volume);
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Out of memory\n");
|
||||
*volume = NULL;
|
||||
return WINED3DERR_OUTOFVIDEOMEMORY;
|
||||
}
|
||||
|
||||
hr = volume_init(object, device, width, height, depth, usage, format_id, pool, parent, parent_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize volume, returning %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
TRACE("Created volume %p.\n", object);
|
||||
*volume = object;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
@ cdecl wined3d_incref(ptr)
|
||||
@ cdecl wined3d_register_software_device(ptr ptr)
|
||||
|
||||
@ cdecl wined3d_buffer_create(ptr ptr ptr ptr ptr ptr)
|
||||
@ cdecl wined3d_buffer_create_ib(ptr long long long ptr ptr ptr)
|
||||
@ cdecl wined3d_buffer_create_vb(ptr long long long ptr ptr ptr)
|
||||
@ cdecl wined3d_buffer_decref(ptr)
|
||||
@ cdecl wined3d_buffer_free_private_data(ptr ptr)
|
||||
@ cdecl wined3d_buffer_get_parent(ptr)
|
||||
|
@ -43,6 +46,7 @@
|
|||
|
||||
@ cdecl wined3d_device_create(ptr long long ptr long ptr ptr)
|
||||
|
||||
@ cdecl wined3d_palette_create(ptr long ptr ptr ptr)
|
||||
@ cdecl wined3d_palette_decref(ptr)
|
||||
@ cdecl wined3d_palette_get_entries(ptr long long long ptr)
|
||||
@ cdecl wined3d_palette_get_flags(ptr)
|
||||
|
@ -50,6 +54,7 @@
|
|||
@ cdecl wined3d_palette_incref(ptr)
|
||||
@ cdecl wined3d_palette_set_entries(ptr long long long ptr)
|
||||
|
||||
@ cdecl wined3d_query_create(ptr long ptr)
|
||||
@ cdecl wined3d_query_decref(ptr)
|
||||
@ cdecl wined3d_query_get_data(ptr ptr long long)
|
||||
@ cdecl wined3d_query_get_data_size(ptr)
|
||||
|
@ -60,11 +65,15 @@
|
|||
@ cdecl wined3d_resource_get_desc(ptr ptr)
|
||||
@ cdecl wined3d_resource_get_parent(ptr)
|
||||
|
||||
@ cdecl wined3d_rendertarget_view_create(ptr ptr ptr)
|
||||
@ cdecl wined3d_rendertarget_view_decref(ptr)
|
||||
@ cdecl wined3d_rendertarget_view_get_parent(ptr)
|
||||
@ cdecl wined3d_rendertarget_view_get_resource(ptr)
|
||||
@ cdecl wined3d_rendertarget_view_incref(ptr)
|
||||
|
||||
@ cdecl wined3d_shader_create_gs(ptr ptr ptr ptr ptr ptr)
|
||||
@ cdecl wined3d_shader_create_ps(ptr ptr ptr ptr ptr ptr)
|
||||
@ cdecl wined3d_shader_create_vs(ptr ptr ptr ptr ptr ptr)
|
||||
@ cdecl wined3d_shader_decref(ptr)
|
||||
@ cdecl wined3d_shader_get_byte_code(ptr ptr ptr)
|
||||
@ cdecl wined3d_shader_get_parent(ptr)
|
||||
|
@ -73,11 +82,13 @@
|
|||
|
||||
@ cdecl wined3d_stateblock_apply(ptr)
|
||||
@ cdecl wined3d_stateblock_capture(ptr)
|
||||
@ cdecl wined3d_stateblock_create(ptr long ptr)
|
||||
@ cdecl wined3d_stateblock_decref(ptr)
|
||||
@ cdecl wined3d_stateblock_incref(ptr)
|
||||
|
||||
@ cdecl wined3d_surface_blt(ptr ptr ptr ptr long ptr long)
|
||||
@ cdecl wined3d_surface_bltfast(ptr long long ptr ptr long)
|
||||
@ cdecl wined3d_surface_create(ptr long long long long long long long long long long long ptr ptr ptr)
|
||||
@ cdecl wined3d_surface_decref(ptr)
|
||||
@ cdecl wined3d_surface_flip(ptr ptr long)
|
||||
@ cdecl wined3d_surface_free_private_data(ptr ptr)
|
||||
|
@ -110,6 +121,7 @@
|
|||
@ cdecl wined3d_surface_update_overlay(ptr ptr ptr ptr long ptr)
|
||||
@ cdecl wined3d_surface_update_overlay_z_order(ptr long ptr)
|
||||
|
||||
@ cdecl wined3d_swapchain_create(ptr ptr long ptr ptr ptr)
|
||||
@ cdecl wined3d_swapchain_decref(ptr)
|
||||
@ cdecl wined3d_swapchain_get_back_buffer(ptr long long ptr)
|
||||
@ cdecl wined3d_swapchain_get_device(ptr)
|
||||
|
@ -125,6 +137,9 @@
|
|||
@ cdecl wined3d_swapchain_set_window(ptr ptr)
|
||||
|
||||
@ cdecl wined3d_texture_add_dirty_region(ptr long ptr)
|
||||
@ cdecl wined3d_texture_create_2d(ptr long long long long long long ptr ptr ptr)
|
||||
@ cdecl wined3d_texture_create_3d(ptr long long long long long long long ptr ptr ptr)
|
||||
@ cdecl wined3d_texture_create_cube(ptr long long long long long ptr ptr ptr)
|
||||
@ cdecl wined3d_texture_decref(ptr)
|
||||
@ cdecl wined3d_texture_free_private_data(ptr ptr)
|
||||
@ cdecl wined3d_texture_generate_mipmaps(ptr)
|
||||
|
@ -143,10 +158,13 @@
|
|||
@ cdecl wined3d_texture_set_priority(ptr long)
|
||||
@ cdecl wined3d_texture_set_private_data(ptr ptr ptr long long)
|
||||
|
||||
@ cdecl wined3d_vertex_declaration_create(ptr ptr long ptr ptr ptr)
|
||||
@ cdecl wined3d_vertex_declaration_create_from_fvf(ptr long ptr ptr ptr)
|
||||
@ cdecl wined3d_vertex_declaration_decref(ptr)
|
||||
@ cdecl wined3d_vertex_declaration_get_parent(ptr)
|
||||
@ cdecl wined3d_vertex_declaration_incref(ptr)
|
||||
|
||||
@ cdecl wined3d_volume_create(ptr long long long long long long ptr ptr ptr)
|
||||
@ cdecl wined3d_volume_decref(ptr)
|
||||
@ cdecl wined3d_volume_free_private_data(ptr ptr)
|
||||
@ cdecl wined3d_volume_from_resource(ptr)
|
||||
|
|
|
@ -1935,18 +1935,6 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
|
|||
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_set_dirty(struct wined3d_texture *texture, BOOL dirty) DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, UINT height,
|
||||
UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id,
|
||||
WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
|
||||
struct wined3d_volume
|
||||
{
|
||||
struct wined3d_resource resource;
|
||||
|
@ -1964,9 +1952,6 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc
|
|||
}
|
||||
|
||||
void volume_add_dirty_box(struct wined3d_volume *volume, const WINED3DBOX *dirty_box) DECLSPEC_HIDDEN;
|
||||
HRESULT volume_init(struct wined3d_volume *volume, IWineD3DDeviceImpl *device, UINT width,
|
||||
UINT height, UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
void volume_load(struct wined3d_volume *volume, UINT level, BOOL srgb_mode) DECLSPEC_HIDDEN;
|
||||
void volume_set_container(struct wined3d_volume *volume, struct wined3d_texture *container) DECLSPEC_HIDDEN;
|
||||
|
||||
|
@ -2115,10 +2100,6 @@ void surface_add_dirty_rect(struct wined3d_surface *surface, const WINED3DBOX *d
|
|||
void surface_bind(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN;
|
||||
GLenum surface_get_gl_buffer(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
|
||||
HRESULT surface_init(struct wined3d_surface *surface, WINED3DSURFTYPE surface_type, UINT alignment,
|
||||
UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type,
|
||||
UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id,
|
||||
WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
BOOL surface_init_sysmem(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
|
||||
void surface_internal_preload(struct wined3d_surface *surface, enum WINED3DSRGB srgb) DECLSPEC_HIDDEN;
|
||||
BOOL surface_is_offscreen(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
|
||||
|
@ -2239,10 +2220,6 @@ struct wined3d_vertex_declaration
|
|||
BOOL half_float_conv_needed;
|
||||
};
|
||||
|
||||
HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declaration,
|
||||
IWineD3DDeviceImpl *device, const WINED3DVERTEXELEMENT *elements, UINT element_count,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Internal state Block for Begin/End/Capture/Create/Apply info */
|
||||
/* Note: Very long winded but gl Lists are not flexible enough */
|
||||
/* to resolve everything we need, so doing it manually for now */
|
||||
|
@ -2361,8 +2338,6 @@ struct wined3d_stateblock
|
|||
unsigned int num_contained_sampler_states;
|
||||
};
|
||||
|
||||
HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
|
||||
IWineD3DDeviceImpl *device, WINED3DSTATEBLOCKTYPE type) DECLSPEC_HIDDEN;
|
||||
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
|
||||
void stateblock_init_default_state(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
|
||||
|
||||
|
@ -2401,8 +2376,6 @@ struct wined3d_query
|
|||
void *extendedData;
|
||||
};
|
||||
|
||||
HRESULT query_init(struct wined3d_query *query, IWineD3DDeviceImpl *device, WINED3DQUERYTYPE type) DECLSPEC_HIDDEN;
|
||||
|
||||
/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
|
||||
* fixed function semantics as D3DCOLOR or FLOAT16 */
|
||||
enum wined3d_buffer_conversion_type
|
||||
|
@ -2461,9 +2434,6 @@ static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resourc
|
|||
const BYTE *buffer_get_memory(struct wined3d_buffer *buffer, const struct wined3d_gl_info *gl_info,
|
||||
GLuint *buffer_object) DECLSPEC_HIDDEN;
|
||||
BYTE *buffer_get_sysmem(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
|
||||
HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
|
||||
UINT size, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, GLenum bind_hint,
|
||||
const char *data, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
|
||||
struct wined3d_rendertarget_view
|
||||
{
|
||||
|
@ -2473,9 +2443,6 @@ struct wined3d_rendertarget_view
|
|||
void *parent;
|
||||
};
|
||||
|
||||
void wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view,
|
||||
struct wined3d_resource *resource, void *parent) DECLSPEC_HIDDEN;
|
||||
|
||||
struct wined3d_swapchain_ops
|
||||
{
|
||||
HRESULT (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect,
|
||||
|
@ -2514,9 +2481,6 @@ struct wined3d_swapchain
|
|||
void x11_copy_to_screen(struct wined3d_swapchain *swapchain, const RECT *rect) DECLSPEC_HIDDEN;
|
||||
|
||||
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
|
||||
HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surface_type,
|
||||
IWineD3DDeviceImpl *device, WINED3DPRESENT_PARAMETERS *present_parameters,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
|
||||
#define DEFAULT_REFRESH_RATE 0
|
||||
|
||||
|
@ -2676,13 +2640,6 @@ struct wined3d_shader
|
|||
} u;
|
||||
};
|
||||
|
||||
HRESULT geometryshader_init(struct wined3d_shader *shader, IWineD3DDeviceImpl *device,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT pixelshader_init(struct wined3d_shader *shader, IWineD3DDeviceImpl *device,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
void pixelshader_update_samplers(struct wined3d_shader_reg_maps *reg_maps,
|
||||
struct wined3d_texture * const *textures) DECLSPEC_HIDDEN;
|
||||
void find_ps_compile_args(const struct wined3d_state *state,
|
||||
|
@ -2690,9 +2647,6 @@ void find_ps_compile_args(const struct wined3d_state *state,
|
|||
|
||||
void find_vs_compile_args(const struct wined3d_state *state,
|
||||
const struct wined3d_shader *shader, struct vs_compile_args *args) DECLSPEC_HIDDEN;
|
||||
HRESULT vertexshader_init(struct wined3d_shader *shader, IWineD3DDeviceImpl *device,
|
||||
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
|
||||
void shader_buffer_clear(struct wined3d_shader_buffer *buffer) DECLSPEC_HIDDEN;
|
||||
BOOL shader_buffer_init(struct wined3d_shader_buffer *buffer) DECLSPEC_HIDDEN;
|
||||
|
@ -2822,9 +2776,6 @@ struct wined3d_palette
|
|||
DWORD flags;
|
||||
};
|
||||
|
||||
HRESULT wined3d_palette_init(struct wined3d_palette *palette, IWineD3DDeviceImpl *device,
|
||||
DWORD flags, const PALETTEENTRY *entries, void *parent) DECLSPEC_HIDDEN;
|
||||
|
||||
/* DirectDraw utility functions */
|
||||
extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN;
|
||||
|
||||
|
|
|
@ -2170,149 +2170,6 @@ typedef HRESULT (__stdcall *D3DCB_ENUMRESOURCES)(struct wined3d_resource *resour
|
|||
]
|
||||
interface IWineD3DDevice : IUnknown
|
||||
{
|
||||
HRESULT CreateBuffer(
|
||||
[in] struct wined3d_buffer_desc *desc,
|
||||
[in] const void *data,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_buffer **buffer
|
||||
);
|
||||
HRESULT CreateVertexBuffer(
|
||||
[in] UINT length,
|
||||
[in] DWORD usage,
|
||||
[in] WINED3DPOOL pool,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_buffer **vertex_buffer
|
||||
);
|
||||
HRESULT CreateIndexBuffer(
|
||||
[in] UINT length,
|
||||
[in] DWORD usage,
|
||||
[in] WINED3DPOOL pool,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_buffer **index_buffer
|
||||
);
|
||||
HRESULT CreateStateBlock(
|
||||
[in] WINED3DSTATEBLOCKTYPE type,
|
||||
[out] struct wined3d_stateblock **stateblock
|
||||
);
|
||||
HRESULT CreateSurface(
|
||||
[in] UINT width,
|
||||
[in] UINT height,
|
||||
[in] enum wined3d_format_id format_id,
|
||||
[in] BOOL lockable,
|
||||
[in] BOOL discard,
|
||||
[in] UINT level,
|
||||
[in] DWORD usage,
|
||||
[in] WINED3DPOOL pool,
|
||||
[in] WINED3DMULTISAMPLE_TYPE multisample_type,
|
||||
[in] DWORD multisample_quality,
|
||||
[in] WINED3DSURFTYPE surface_type,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_surface **surface
|
||||
);
|
||||
HRESULT CreateRendertargetView(
|
||||
[in] struct wined3d_resource *resource,
|
||||
[in] void *parent,
|
||||
[out] struct wined3d_rendertarget_view **rendertarget_view
|
||||
);
|
||||
HRESULT CreateTexture(
|
||||
[in] UINT width,
|
||||
[in] UINT height,
|
||||
[in] UINT levels,
|
||||
[in] DWORD usage,
|
||||
[in] enum wined3d_format_id format_id,
|
||||
[in] WINED3DPOOL pool,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_texture **texture
|
||||
);
|
||||
HRESULT CreateVolumeTexture(
|
||||
[in] UINT width,
|
||||
[in] UINT height,
|
||||
[in] UINT depth,
|
||||
[in] UINT levels,
|
||||
[in] DWORD usage,
|
||||
[in] enum wined3d_format_id format_id,
|
||||
[in] WINED3DPOOL pool,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_texture **texture
|
||||
);
|
||||
HRESULT CreateVolume(
|
||||
[in] UINT width,
|
||||
[in] UINT height,
|
||||
[in] UINT depth,
|
||||
[in] DWORD usage,
|
||||
[in] enum wined3d_format_id format_id,
|
||||
[in] WINED3DPOOL pool,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_volume **volume
|
||||
);
|
||||
HRESULT CreateCubeTexture(
|
||||
[in] UINT edge_length,
|
||||
[in] UINT levels,
|
||||
[in] DWORD usage,
|
||||
[in] enum wined3d_format_id format_id,
|
||||
[in] WINED3DPOOL pool,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_texture **texture
|
||||
);
|
||||
HRESULT CreateQuery(
|
||||
[in] WINED3DQUERYTYPE type,
|
||||
[out] struct wined3d_query **query
|
||||
);
|
||||
HRESULT CreateSwapChain(
|
||||
[in] WINED3DPRESENT_PARAMETERS *present_parameters,
|
||||
[in] WINED3DSURFTYPE surface_type,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_swapchain **swapchain
|
||||
);
|
||||
HRESULT CreateVertexDeclaration(
|
||||
[in] const WINED3DVERTEXELEMENT *elements,
|
||||
[in] UINT element_count,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_vertex_declaration **declaration
|
||||
);
|
||||
HRESULT CreateVertexDeclarationFromFVF(
|
||||
[in] DWORD fvf,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_vertex_declaration **declaration
|
||||
);
|
||||
HRESULT CreateVertexShader(
|
||||
[in] const DWORD *function,
|
||||
[in] const struct wined3d_shader_signature *output_signature,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_shader **shader
|
||||
);
|
||||
HRESULT CreateGeometryShader(
|
||||
[in] const DWORD *byte_code,
|
||||
[in] const struct wined3d_shader_signature *output_signature,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_shader **shader
|
||||
);
|
||||
HRESULT CreatePixelShader(
|
||||
[in] const DWORD *function,
|
||||
[in] const struct wined3d_shader_signature *output_signature,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] struct wined3d_shader **shader
|
||||
);
|
||||
HRESULT CreatePalette(
|
||||
[in] DWORD flags,
|
||||
[in] const PALETTEENTRY *palette_entry,
|
||||
[in] void *parent,
|
||||
[out] struct wined3d_palette **palette
|
||||
);
|
||||
HRESULT Init3D(
|
||||
[in] WINED3DPRESENT_PARAMETERS *present_parameters
|
||||
);
|
||||
|
@ -2802,6 +2659,12 @@ void * __cdecl wined3d_get_parent(const struct wined3d *wined3d);
|
|||
ULONG __cdecl wined3d_incref(struct wined3d *wined3d);
|
||||
HRESULT __cdecl wined3d_register_software_device(struct wined3d *wined3d, void *init_function);
|
||||
|
||||
HRESULT __cdecl wined3d_buffer_create(IWineD3DDevice *device, struct wined3d_buffer_desc *desc, const void *data,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer);
|
||||
HRESULT __cdecl wined3d_buffer_create_ib(IWineD3DDevice *device, UINT length, DWORD usage, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer);
|
||||
HRESULT __cdecl wined3d_buffer_create_vb(IWineD3DDevice *device, UINT length, DWORD usage, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer);
|
||||
ULONG __cdecl wined3d_buffer_decref(struct wined3d_buffer *buffer);
|
||||
HRESULT __cdecl wined3d_buffer_free_private_data(struct wined3d_buffer *buffer, REFGUID guid);
|
||||
void * __cdecl wined3d_buffer_get_parent(const struct wined3d_buffer *buffer);
|
||||
|
@ -2831,6 +2694,8 @@ HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx,
|
|||
WINED3DDEVTYPE device_type, HWND focus_window, DWORD behaviour_flags,
|
||||
IWineD3DDeviceParent *device_parent, IWineD3DDevice **device);
|
||||
|
||||
HRESULT __cdecl wined3d_palette_create(IWineD3DDevice *device, DWORD flags,
|
||||
const PALETTEENTRY *entries, void *parent, struct wined3d_palette **palette);
|
||||
ULONG __cdecl wined3d_palette_decref(struct wined3d_palette *palette);
|
||||
HRESULT __cdecl wined3d_palette_get_entries(const struct wined3d_palette *palette,
|
||||
DWORD flags, DWORD start, DWORD count, PALETTEENTRY *entries);
|
||||
|
@ -2840,6 +2705,7 @@ ULONG __cdecl wined3d_palette_incref(struct wined3d_palette *palette);
|
|||
HRESULT __cdecl wined3d_palette_set_entries(struct wined3d_palette *palette,
|
||||
DWORD flags, DWORD start, DWORD count, const PALETTEENTRY *entries);
|
||||
|
||||
HRESULT __cdecl wined3d_query_create(IWineD3DDevice *device, WINED3DQUERYTYPE type, struct wined3d_query **query);
|
||||
ULONG __cdecl wined3d_query_decref(struct wined3d_query *query);
|
||||
HRESULT __cdecl wined3d_query_get_data(struct wined3d_query *query, void *data, UINT data_size, DWORD flags);
|
||||
UINT __cdecl wined3d_query_get_data_size(const struct wined3d_query *query);
|
||||
|
@ -2851,11 +2717,22 @@ void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource,
|
|||
struct wined3d_resource_desc *desc);
|
||||
void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource);
|
||||
|
||||
HRESULT __cdecl wined3d_rendertarget_view_create(struct wined3d_resource *resource,
|
||||
void *parent, struct wined3d_rendertarget_view **rendertarget_view);
|
||||
ULONG __cdecl wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view);
|
||||
void * __cdecl wined3d_rendertarget_view_get_parent(const struct wined3d_rendertarget_view *view);
|
||||
struct wined3d_resource * __cdecl wined3d_rendertarget_view_get_resource(const struct wined3d_rendertarget_view *view);
|
||||
ULONG __cdecl wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *view);
|
||||
|
||||
HRESULT __cdecl wined3d_shader_create_gs(IWineD3DDevice *device, const DWORD *byte_code,
|
||||
const struct wined3d_shader_signature *output_signature, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader);
|
||||
HRESULT __cdecl wined3d_shader_create_ps(IWineD3DDevice *device, const DWORD *byte_code,
|
||||
const struct wined3d_shader_signature *output_signature, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader);
|
||||
HRESULT __cdecl wined3d_shader_create_vs(IWineD3DDevice *device, const DWORD *byte_code,
|
||||
const struct wined3d_shader_signature *output_signature, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader);
|
||||
ULONG __cdecl wined3d_shader_decref(struct wined3d_shader *shader);
|
||||
HRESULT __cdecl wined3d_shader_get_byte_code(const struct wined3d_shader *shader,
|
||||
void *byte_code, UINT *byte_code_size);
|
||||
|
@ -2866,6 +2743,8 @@ HRESULT __cdecl wined3d_shader_set_local_constants_float(struct wined3d_shader *
|
|||
|
||||
HRESULT __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock);
|
||||
HRESULT __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock);
|
||||
HRESULT __cdecl wined3d_stateblock_create(IWineD3DDevice *device,
|
||||
WINED3DSTATEBLOCKTYPE type, struct wined3d_stateblock **stateblock);
|
||||
ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock);
|
||||
ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);
|
||||
|
||||
|
@ -2874,6 +2753,10 @@ HRESULT __cdecl wined3d_surface_blt(struct wined3d_surface *dst_surface, const R
|
|||
const WINEDDBLTFX *blt_fx, WINED3DTEXTUREFILTERTYPE filter);
|
||||
HRESULT __cdecl wined3d_surface_bltfast(struct wined3d_surface *dst_surface, DWORD dst_x, DWORD dst_y,
|
||||
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD trans);
|
||||
HRESULT __cdecl wined3d_surface_create(IWineD3DDevice *device, UINT width, UINT height,
|
||||
enum wined3d_format_id format_id, BOOL lockable, BOOL discard, UINT level, DWORD usage, WINED3DPOOL pool,
|
||||
WINED3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, WINED3DSURFTYPE surface_type,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_surface **surface);
|
||||
ULONG __cdecl wined3d_surface_decref(struct wined3d_surface *surface);
|
||||
HRESULT __cdecl wined3d_surface_flip(struct wined3d_surface *surface, struct wined3d_surface *override, DWORD flags);
|
||||
HRESULT __cdecl wined3d_surface_free_private_data(struct wined3d_surface *surface, REFGUID guid);
|
||||
|
@ -2912,6 +2795,9 @@ HRESULT __cdecl wined3d_surface_update_overlay(struct wined3d_surface *surface,
|
|||
HRESULT __cdecl wined3d_surface_update_overlay_z_order(struct wined3d_surface *surface,
|
||||
DWORD flags, struct wined3d_surface *ref);
|
||||
|
||||
HRESULT __cdecl wined3d_swapchain_create(IWineD3DDevice *device,
|
||||
WINED3DPRESENT_PARAMETERS *present_parameters, WINED3DSURFTYPE surface_type, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain);
|
||||
ULONG __cdecl wined3d_swapchain_decref(struct wined3d_swapchain *swapchain);
|
||||
HRESULT __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain,
|
||||
UINT backbuffer_idx, WINED3DBACKBUFFER_TYPE backbuffer_type, struct wined3d_surface **backbuffer);
|
||||
|
@ -2937,6 +2823,15 @@ HRESULT __cdecl wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain
|
|||
|
||||
HRESULT __cdecl wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
|
||||
UINT layer, const WINED3DBOX *dirty_region);
|
||||
HRESULT __cdecl wined3d_texture_create_2d(IWineD3DDevice *device, UINT width, UINT height,
|
||||
UINT level_count, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture);
|
||||
HRESULT __cdecl wined3d_texture_create_3d(IWineD3DDevice *device, UINT width, UINT height, UINT depth,
|
||||
UINT level_count, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture);
|
||||
HRESULT __cdecl wined3d_texture_create_cube(IWineD3DDevice *device, UINT edge_length,
|
||||
UINT level_count, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture);
|
||||
ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture);
|
||||
HRESULT __cdecl wined3d_texture_free_private_data(struct wined3d_texture *texture, REFGUID guid);
|
||||
void __cdecl wined3d_texture_generate_mipmaps(struct wined3d_texture *texture);
|
||||
|
@ -2959,10 +2854,19 @@ DWORD __cdecl wined3d_texture_set_priority(struct wined3d_texture *texture, DWOR
|
|||
HRESULT __cdecl wined3d_texture_set_private_data(struct wined3d_texture *texture,
|
||||
REFGUID guid, const void *data, DWORD data_size, DWORD flags);
|
||||
|
||||
HRESULT __cdecl wined3d_vertex_declaration_create(IWineD3DDevice *device,
|
||||
const WINED3DVERTEXELEMENT *elements, UINT element_count, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_vertex_declaration **declaration);
|
||||
HRESULT __cdecl wined3d_vertex_declaration_create_from_fvf(IWineD3DDevice *device,
|
||||
DWORD fvf, void *parent, const struct wined3d_parent_ops *parent_ops,
|
||||
struct wined3d_vertex_declaration **declaration);
|
||||
ULONG __cdecl wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration);
|
||||
void * __cdecl wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration);
|
||||
ULONG __cdecl wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration);
|
||||
|
||||
HRESULT __cdecl wined3d_volume_create(IWineD3DDevice *device, UINT width, UINT height, UINT depth,
|
||||
DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, struct wined3d_volume **volume);
|
||||
ULONG __cdecl wined3d_volume_decref(struct wined3d_volume *volume);
|
||||
HRESULT __cdecl wined3d_volume_free_private_data(struct wined3d_volume *volume, REFGUID guid);
|
||||
struct wined3d_volume * __cdecl wined3d_volume_from_resource(struct wined3d_resource *resource);
|
||||
|
|
Loading…
Reference in New Issue