From 7715ae4be5498335bbe1a07beb64caef9867d0ed Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 17 May 2018 08:57:30 +1000 Subject: [PATCH] Rebase against ba1d9f3aad85303997635ce8328caffa08992c14 --- ...-Add-stub-deferred-rendering-context.patch | 133 +++++++++--------- ...implementation-for-deferred-contexts.patch | 34 ++--- patches/patchinstall.sh | 2 +- 3 files changed, 84 insertions(+), 85 deletions(-) diff --git a/patches/d3d11-Deferred_Context/0001-d3d11-Add-stub-deferred-rendering-context.patch b/patches/d3d11-Deferred_Context/0001-d3d11-Add-stub-deferred-rendering-context.patch index eac306a1..ae951158 100644 --- a/patches/d3d11-Deferred_Context/0001-d3d11-Add-stub-deferred-rendering-context.patch +++ b/patches/d3d11-Deferred_Context/0001-d3d11-Add-stub-deferred-rendering-context.patch @@ -1,14 +1,14 @@ -From 7bc04189d0ae8f308870b7392311e72d30113d3f Mon Sep 17 00:00:00 2001 +From 05d2fdef11e728574c7551e3a96f3223407027f4 Mon Sep 17 00:00:00 2001 From: Kimmo Myllyvirta Date: Sat, 24 Sep 2016 06:51:24 +0300 Subject: [PATCH] d3d11: Add stub deferred rendering context. --- - dlls/d3d11/device.c | 1264 +++++++++++++++++++++++++++++++++++++++++++++------ - 1 file changed, 1128 insertions(+), 136 deletions(-) + dlls/d3d11/device.c | 1263 +++++++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 1127 insertions(+), 136 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c -index 18fa670..9f5c4ff 100644 +index c930248..80f73de 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -25,6 +25,16 @@ @@ -28,33 +28,33 @@ index 18fa670..9f5c4ff 100644 static void STDMETHODCALLTYPE d3d_null_wined3d_object_destroyed(void *parent) {} static const struct wined3d_parent_ops d3d_null_wined3d_parent_ops = -@@ -2886,214 +2896,1182 @@ static void d3d11_immediate_context_destroy(struct d3d11_immediate_context *cont +@@ -2910,214 +2920,1182 @@ static void d3d11_immediate_context_destroy(struct d3d11_immediate_context *cont wined3d_private_store_cleanup(&context->private_store); } -/* ID3D11Device methods */ +/* ID3D11DeviceContext - deferred context methods */ --static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device1 *iface, REFIID riid, void **out) +-static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device2 *iface, REFIID riid, void **out) +static inline struct d3d11_deferred_context *impl_from_deferred_ID3D11DeviceContext(ID3D11DeviceContext *iface) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - return IUnknown_QueryInterface(device->outer_unk, riid, out); + return CONTAINING_RECORD(iface, struct d3d11_deferred_context, ID3D11DeviceContext_iface); } --static ULONG STDMETHODCALLTYPE d3d11_device_AddRef(ID3D11Device1 *iface) +-static ULONG STDMETHODCALLTYPE d3d11_device_AddRef(ID3D11Device2 *iface) +static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_QueryInterface(ID3D11DeviceContext *iface, + REFIID riid, void **out) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - return IUnknown_AddRef(device->outer_unk); -} + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); --static ULONG STDMETHODCALLTYPE d3d11_device_Release(ID3D11Device1 *iface) +-static ULONG STDMETHODCALLTYPE d3d11_device_Release(ID3D11Device2 *iface) -{ -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - return IUnknown_Release(device->outer_unk); + if (IsEqualGUID(riid, &IID_ID3D11DeviceContext) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) @@ -70,11 +70,11 @@ index 18fa670..9f5c4ff 100644 + return E_NOINTERFACE; } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBuffer(ID3D11Device1 *iface, const D3D11_BUFFER_DESC *desc, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBuffer(ID3D11Device2 *iface, const D3D11_BUFFER_DESC *desc, - const D3D11_SUBRESOURCE_DATA *data, ID3D11Buffer **buffer) +static ULONG STDMETHODCALLTYPE d3d11_deferred_context_AddRef(ID3D11DeviceContext *iface) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct d3d_buffer *object; - HRESULT hr; - @@ -92,11 +92,11 @@ index 18fa670..9f5c4ff 100644 + return refcount; } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture1D(ID3D11Device1 *iface, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture1D(ID3D11Device2 *iface, - const D3D11_TEXTURE1D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture1D **texture) +static ULONG STDMETHODCALLTYPE d3d11_deferred_context_Release(ID3D11DeviceContext *iface) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct d3d_texture1d *object; - HRESULT hr; - @@ -120,11 +120,11 @@ index 18fa670..9f5c4ff 100644 + return refcount; } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture2D(ID3D11Device1 *iface, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture2D(ID3D11Device2 *iface, - const D3D11_TEXTURE2D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture2D **texture) +static void STDMETHODCALLTYPE d3d11_deferred_context_GetDevice(ID3D11DeviceContext *iface, ID3D11Device **device) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct d3d_texture2d *object; - HRESULT hr; - @@ -142,12 +142,12 @@ index 18fa670..9f5c4ff 100644 + *device = context->device; } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture3D(ID3D11Device1 *iface, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture3D(ID3D11Device2 *iface, - const D3D11_TEXTURE3D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture3D **texture) +static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_GetPrivateData(ID3D11DeviceContext *iface, REFGUID guid, + UINT *data_size, void *data) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct d3d_texture3d *object; - HRESULT hr; - @@ -164,12 +164,12 @@ index 18fa670..9f5c4ff 100644 + return d3d_get_private_data(&context->private_store, guid, data_size, data); } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateShaderResourceView(ID3D11Device1 *iface, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateShaderResourceView(ID3D11Device2 *iface, - ID3D11Resource *resource, const D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11ShaderResourceView **view) +static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_SetPrivateData(ID3D11DeviceContext *iface, REFGUID guid, + UINT data_size, const void *data) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct d3d_shader_resource_view *object; - HRESULT hr; + struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface); @@ -196,12 +196,12 @@ index 18fa670..9f5c4ff 100644 + return d3d_set_private_data_interface(&context->private_store, guid, data); } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateUnorderedAccessView(ID3D11Device1 *iface, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateUnorderedAccessView(ID3D11Device2 *iface, - ID3D11Resource *resource, const D3D11_UNORDERED_ACCESS_VIEW_DESC *desc, ID3D11UnorderedAccessView **view) +static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct d3d11_unordered_access_view *object; - HRESULT hr; - @@ -235,12 +235,12 @@ index 18fa670..9f5c4ff 100644 + iface, start_slot, sampler_count, samplers); } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Device1 *iface, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Device2 *iface, - ID3D11Resource *resource, const D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11RenderTargetView **view) +static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShader(ID3D11DeviceContext *iface, + ID3D11VertexShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct d3d_rendertarget_view *object; - HRESULT hr; + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n", @@ -283,12 +283,12 @@ index 18fa670..9f5c4ff 100644 + FIXME("iface %p, resource %p, subresource_idx %u stub!\n", iface, resource, subresource_idx); } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Device1 *iface, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Device2 *iface, - ID3D11Resource *resource, const D3D11_DEPTH_STENCIL_VIEW_DESC *desc, ID3D11DepthStencilView **view) +static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct d3d_depthstencil_view *object; - HRESULT hr; + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", @@ -330,13 +330,13 @@ index 18fa670..9f5c4ff 100644 + base_vertex_location, start_instance_location); } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateInputLayout(ID3D11Device1 *iface, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateInputLayout(ID3D11Device2 *iface, - const D3D11_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code, - SIZE_T shader_byte_code_length, ID3D11InputLayout **input_layout) +static void STDMETHODCALLTYPE d3d11_deferred_context_DrawInstanced(ID3D11DeviceContext *iface, + UINT instance_vertex_count, UINT instance_count, UINT start_vertex_location, UINT start_instance_location) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct d3d_input_layout *object; - HRESULT hr; + FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u, " @@ -379,12 +379,12 @@ index 18fa670..9f5c4ff 100644 + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateVertexShader(ID3D11Device1 *iface, const void *byte_code, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateVertexShader(ID3D11Device2 *iface, const void *byte_code, - SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11VertexShader **shader) +static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct d3d_vertex_shader *object; - HRESULT hr; + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", @@ -426,12 +426,12 @@ index 18fa670..9f5c4ff 100644 + FIXME("iface %p, predicate %p, value %#x stub!\n", iface, predicate, value); } --static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShader(ID3D11Device1 *iface, const void *byte_code, +-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShader(ID3D11Device2 *iface, const void *byte_code, - SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11GeometryShader **shader) +static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) { -- struct d3d_device *device = impl_from_ID3D11Device1(iface); +- struct d3d_device *device = impl_from_ID3D11Device2(iface); + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} + @@ -1136,28 +1136,28 @@ index 18fa670..9f5c4ff 100644 + +/* ID3D11Device methods */ + -+static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device1 *iface, REFIID riid, void **out) ++static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device2 *iface, REFIID riid, void **out) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + return IUnknown_QueryInterface(device->outer_unk, riid, out); +} + -+static ULONG STDMETHODCALLTYPE d3d11_device_AddRef(ID3D11Device1 *iface) ++static ULONG STDMETHODCALLTYPE d3d11_device_AddRef(ID3D11Device2 *iface) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + return IUnknown_AddRef(device->outer_unk); +} + -+static ULONG STDMETHODCALLTYPE d3d11_device_Release(ID3D11Device1 *iface) ++static ULONG STDMETHODCALLTYPE d3d11_device_Release(ID3D11Device2 *iface) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + return IUnknown_Release(device->outer_unk); +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBuffer(ID3D11Device1 *iface, const D3D11_BUFFER_DESC *desc, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBuffer(ID3D11Device2 *iface, const D3D11_BUFFER_DESC *desc, + const D3D11_SUBRESOURCE_DATA *data, ID3D11Buffer **buffer) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + struct d3d_buffer *object; + HRESULT hr; + @@ -1171,10 +1171,10 @@ index 18fa670..9f5c4ff 100644 + return S_OK; +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture1D(ID3D11Device1 *iface, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture1D(ID3D11Device2 *iface, + const D3D11_TEXTURE1D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture1D **texture) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + struct d3d_texture1d *object; + HRESULT hr; + @@ -1188,10 +1188,10 @@ index 18fa670..9f5c4ff 100644 + return S_OK; +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture2D(ID3D11Device1 *iface, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture2D(ID3D11Device2 *iface, + const D3D11_TEXTURE2D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture2D **texture) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + struct d3d_texture2d *object; + HRESULT hr; + @@ -1205,10 +1205,10 @@ index 18fa670..9f5c4ff 100644 + return S_OK; +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture3D(ID3D11Device1 *iface, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture3D(ID3D11Device2 *iface, + const D3D11_TEXTURE3D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture3D **texture) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + struct d3d_texture3d *object; + HRESULT hr; + @@ -1222,10 +1222,10 @@ index 18fa670..9f5c4ff 100644 + return S_OK; +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateShaderResourceView(ID3D11Device1 *iface, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateShaderResourceView(ID3D11Device2 *iface, + ID3D11Resource *resource, const D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11ShaderResourceView **view) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + struct d3d_shader_resource_view *object; + HRESULT hr; + @@ -1242,10 +1242,10 @@ index 18fa670..9f5c4ff 100644 + return S_OK; +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateUnorderedAccessView(ID3D11Device1 *iface, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateUnorderedAccessView(ID3D11Device2 *iface, + ID3D11Resource *resource, const D3D11_UNORDERED_ACCESS_VIEW_DESC *desc, ID3D11UnorderedAccessView **view) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + struct d3d11_unordered_access_view *object; + HRESULT hr; + @@ -1259,10 +1259,10 @@ index 18fa670..9f5c4ff 100644 + return S_OK; +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Device1 *iface, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Device2 *iface, + ID3D11Resource *resource, const D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11RenderTargetView **view) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + struct d3d_rendertarget_view *object; + HRESULT hr; + @@ -1279,10 +1279,10 @@ index 18fa670..9f5c4ff 100644 + return S_OK; +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Device1 *iface, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Device2 *iface, + ID3D11Resource *resource, const D3D11_DEPTH_STENCIL_VIEW_DESC *desc, ID3D11DepthStencilView **view) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + struct d3d_depthstencil_view *object; + HRESULT hr; + @@ -1296,11 +1296,11 @@ index 18fa670..9f5c4ff 100644 + return S_OK; +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateInputLayout(ID3D11Device1 *iface, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateInputLayout(ID3D11Device2 *iface, + const D3D11_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code, + SIZE_T shader_byte_code_length, ID3D11InputLayout **input_layout) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + struct d3d_input_layout *object; + HRESULT hr; + @@ -1317,10 +1317,10 @@ index 18fa670..9f5c4ff 100644 + return S_OK; +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateVertexShader(ID3D11Device1 *iface, const void *byte_code, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateVertexShader(ID3D11Device2 *iface, const void *byte_code, + SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11VertexShader **shader) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); + struct d3d_vertex_shader *object; + HRESULT hr; + @@ -1338,19 +1338,18 @@ index 18fa670..9f5c4ff 100644 + return S_OK; +} + -+static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShader(ID3D11Device1 *iface, const void *byte_code, ++static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShader(ID3D11Device2 *iface, const void *byte_code, + SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11GeometryShader **shader) +{ -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); ++ struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d_geometry_shader *object; HRESULT hr; -@@ -3365,9 +4343,23 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device1 *iface - static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device1 *iface, UINT flags, +@@ -3389,9 +4367,22 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device2 *iface + static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device2 *iface, UINT flags, ID3D11DeviceContext **context) { - FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context); -+ struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d11_deferred_context *object; - return E_NOTIMPL; @@ -1360,17 +1359,17 @@ index 18fa670..9f5c4ff 100644 + return E_OUTOFMEMORY; + + object->ID3D11DeviceContext_iface.lpVtbl = &d3d11_deferred_context_vtbl; -+ object->device = (ID3D11Device*)&device->ID3D11Device1_iface; ++ object->device = iface; + object->refcount = 1; + -+ ID3D11Device_AddRef(object->device); ++ ID3D11Device_AddRef(iface); + wined3d_private_store_init(&object->private_store); + + *context = &object->ID3D11DeviceContext_iface; + return S_OK; } - static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device1 *iface, HANDLE resource, REFIID riid, + static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device2 *iface, HANDLE resource, REFIID riid, -- 1.9.1 diff --git a/patches/d3d11-Deferred_Context/0003-d3d11-Initial-implementation-for-deferred-contexts.patch b/patches/d3d11-Deferred_Context/0003-d3d11-Initial-implementation-for-deferred-contexts.patch index c531e107..c9a55fe7 100644 --- a/patches/d3d11-Deferred_Context/0003-d3d11-Initial-implementation-for-deferred-contexts.patch +++ b/patches/d3d11-Deferred_Context/0003-d3d11-Initial-implementation-for-deferred-contexts.patch @@ -1,4 +1,4 @@ -From dc8d14d3b434e87777d0c1665602a0425197afc6 Mon Sep 17 00:00:00 2001 +From b8d301b085b39fba7f61409a0ebe17a4ff7b810a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 19 Jan 2017 16:56:56 +0100 Subject: [PATCH] d3d11: Initial implementation for deferred contexts. @@ -8,7 +8,7 @@ Subject: [PATCH] d3d11: Initial implementation for deferred contexts. 1 file changed, 1040 insertions(+), 31 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c -index 9f5c4ff..2f13e85 100644 +index 9127d01..94156e4 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -19,12 +19,181 @@ @@ -725,7 +725,7 @@ index 9f5c4ff..2f13e85 100644 static void STDMETHODCALLTYPE d3d_null_wined3d_object_destroyed(void *parent) {} static const struct wined3d_parent_ops d3d_null_wined3d_parent_ops = -@@ -1210,7 +1901,20 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ResolveSubresource(ID3D11D +@@ -1217,7 +1908,20 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ResolveSubresource(ID3D11D static void STDMETHODCALLTYPE d3d11_immediate_context_ExecuteCommandList(ID3D11DeviceContext1 *iface, ID3D11CommandList *command_list, BOOL restore_state) { @@ -747,7 +747,7 @@ index 9f5c4ff..2f13e85 100644 } static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetShaderResources(ID3D11DeviceContext1 *iface, -@@ -2941,6 +3645,7 @@ static ULONG STDMETHODCALLTYPE d3d11_deferred_context_Release(ID3D11DeviceContex +@@ -2972,6 +3676,7 @@ static ULONG STDMETHODCALLTYPE d3d11_deferred_context_Release(ID3D11DeviceContex if (!refcount) { @@ -755,7 +755,7 @@ index 9f5c4ff..2f13e85 100644 wined3d_private_store_cleanup(&context->private_store); ID3D11Device_Release(context->device); HeapFree(GetProcessHeap(), 0, context); -@@ -2992,43 +3697,86 @@ static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_SetPrivateDataInterface( +@@ -3023,43 +3728,86 @@ static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_SetPrivateDataInterface( static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetConstantBuffers(ID3D11DeviceContext *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { @@ -848,7 +848,7 @@ index 9f5c4ff..2f13e85 100644 } static void STDMETHODCALLTYPE d3d11_deferred_context_Draw(ID3D11DeviceContext *iface, -@@ -3041,53 +3789,169 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_Draw(ID3D11DeviceContext *i +@@ -3072,53 +3820,169 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_Draw(ID3D11DeviceContext *i static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_Map(ID3D11DeviceContext *iface, ID3D11Resource *resource, UINT subresource_idx, D3D11_MAP map_type, UINT map_flags, D3D11_MAPPED_SUBRESOURCE *mapped_subresource) { @@ -1027,7 +1027,7 @@ index 9f5c4ff..2f13e85 100644 } static void STDMETHODCALLTYPE d3d11_deferred_context_DrawInstanced(ID3D11DeviceContext *iface, -@@ -3116,7 +3980,16 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShader(ID3D11DeviceCon +@@ -3147,7 +4011,16 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShader(ID3D11DeviceCon static void STDMETHODCALLTYPE d3d11_deferred_context_IASetPrimitiveTopology(ID3D11DeviceContext *iface, D3D11_PRIMITIVE_TOPOLOGY topology) { @@ -1045,7 +1045,7 @@ index 9f5c4ff..2f13e85 100644 } static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShaderResources(ID3D11DeviceContext *iface, -@@ -3176,8 +4049,28 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargets(ID3D11De +@@ -3207,8 +4080,28 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargets(ID3D11De UINT render_target_view_count, ID3D11RenderTargetView *const *render_target_views, ID3D11DepthStencilView *depth_stencil_view) { @@ -1075,7 +1075,7 @@ index 9f5c4ff..2f13e85 100644 } static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargetsAndUnorderedAccessViews( -@@ -3197,15 +4090,44 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargetsAndUnorde +@@ -3228,15 +4121,44 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargetsAndUnorde static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetBlendState(ID3D11DeviceContext *iface, ID3D11BlendState *blend_state, const float blend_factor[4], UINT sample_mask) { @@ -1122,7 +1122,7 @@ index 9f5c4ff..2f13e85 100644 } static void STDMETHODCALLTYPE d3d11_deferred_context_SOSetTargets(ID3D11DeviceContext *iface, UINT buffer_count, -@@ -3247,13 +4169,34 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_DispatchIndirect(ID3D11Devi +@@ -3278,13 +4200,34 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_DispatchIndirect(ID3D11Devi static void STDMETHODCALLTYPE d3d11_deferred_context_RSSetState(ID3D11DeviceContext *iface, ID3D11RasterizerState *rasterizer_state) { @@ -1159,7 +1159,7 @@ index 9f5c4ff..2f13e85 100644 } static void STDMETHODCALLTYPE d3d11_deferred_context_RSSetScissorRects(ID3D11DeviceContext *iface, -@@ -3368,8 +4311,18 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetShaderResources(ID3D11 +@@ -3399,8 +4342,18 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetShaderResources(ID3D11 static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetShader(ID3D11DeviceContext *iface, ID3D11HullShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) { @@ -1179,7 +1179,7 @@ index 9f5c4ff..2f13e85 100644 } static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetSamplers(ID3D11DeviceContext *iface, -@@ -3382,36 +4335,62 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetSamplers(ID3D11DeviceC +@@ -3413,36 +4366,62 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetSamplers(ID3D11DeviceC static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetConstantBuffers(ID3D11DeviceContext *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { @@ -1247,7 +1247,7 @@ index 9f5c4ff..2f13e85 100644 } static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetShaderResources(ID3D11DeviceContext *iface, -@@ -3712,7 +4691,15 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_CSGetConstantBuffers(ID3D11 +@@ -3743,7 +4722,15 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_CSGetConstantBuffers(ID3D11 static void STDMETHODCALLTYPE d3d11_deferred_context_ClearState(ID3D11DeviceContext *iface) { @@ -1264,7 +1264,7 @@ index 9f5c4ff..2f13e85 100644 } static void STDMETHODCALLTYPE d3d11_deferred_context_Flush(ID3D11DeviceContext *iface) -@@ -3737,9 +4724,29 @@ static UINT STDMETHODCALLTYPE d3d11_deferred_context_GetContextFlags(ID3D11Devic +@@ -3768,9 +4755,29 @@ static UINT STDMETHODCALLTYPE d3d11_deferred_context_GetContextFlags(ID3D11Devic static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_FinishCommandList(ID3D11DeviceContext *iface, BOOL restore, ID3D11CommandList **command_list) { @@ -1296,13 +1296,13 @@ index 9f5c4ff..2f13e85 100644 } static const struct ID3D11DeviceContextVtbl d3d11_deferred_context_vtbl = -@@ -4355,6 +5362,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device - object->device = (ID3D11Device*)&device->ID3D11Device1_iface; +@@ -4385,6 +5392,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device + object->device = iface; object->refcount = 1; + list_init(&object->commands); + - ID3D11Device_AddRef(object->device); + ID3D11Device_AddRef(iface); wined3d_private_store_init(&object->private_store); -- diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 95604123..b38dbeca 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "9321aa40f5ba79352d346c04f4d428d143575fb9" + echo "ba1d9f3aad85303997635ce8328caffa08992c14" } # Show version information