From: Kimmo Myllyvirta Subject: [PATCH] d3d11: Add stub implementation for deferred context. Message-Id: <57F0AB91.3080604@gmail.com> Date: Sun, 2 Oct 2016 09:39:13 +0300 For bug 39180. From c21f6b46d8cf3e0b272f4d7605780d1c464e5d70 Mon Sep 17 00:00:00 2001 From: Kimmo Myllyvirta Date: Sun, 2 Oct 2016 09:20:28 +0300 Subject: [PATCH] d3d11: Add stub implementation for deferred context. Signed-off-by: Kimmo Myllyvirta --- dlls/d3d11/Makefile.in | 3 +- dlls/d3d11/d3d11_private.h | 13 + dlls/d3d11/deferred.c | 1032 ++++++++++++++++++++++++++++++++++++++++++++ dlls/d3d11/device.c | 18 +- dlls/d3d11/tests/d3d11.c | 26 ++ 5 files changed, 1089 insertions(+), 3 deletions(-) create mode 100644 dlls/d3d11/deferred.c diff --git a/dlls/d3d11/Makefile.in b/dlls/d3d11/Makefile.in index 5a56fae..f93b451 100644 --- a/dlls/d3d11/Makefile.in +++ b/dlls/d3d11/Makefile.in @@ -12,6 +12,7 @@ C_SRCS = \ state.c \ texture.c \ utils.c \ - view.c + view.c \ + deferred.c RC_SRCS = version.rc diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index 78cd265..7d2b5f2 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -469,6 +469,19 @@ struct d3d_query *unsafe_impl_from_ID3D11Query(ID3D11Query *iface) DECLSPEC_HIDD struct d3d_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) DECLSPEC_HIDDEN; struct d3d_query *unsafe_impl_from_ID3D11Asynchronous(ID3D11Asynchronous *iface) DECLSPEC_HIDDEN; +/* ID3D11DeviceContext - deferred context */ +struct d3d11_deferred_context +{ + ID3D11DeviceContext ID3D11DeviceContext_iface; + LONG refcount; + + struct wined3d_private_store private_store; + ID3D11Device *device; +}; + +HRESULT d3d11_deferred_context_create(struct d3d_device *device, UINT flags, + struct d3d11_deferred_context **context) DECLSPEC_HIDDEN; + /* ID3D11DeviceContext - immediate context */ struct d3d11_immediate_context { diff --git a/dlls/d3d11/deferred.c b/dlls/d3d11/deferred.c new file mode 100644 index 0000000..c28087a --- /dev/null +++ b/dlls/d3d11/deferred.c @@ -0,0 +1,1032 @@ +/* + * Copyright 2008-2012 Henri Verbeet for CodeWeavers + * Copyright 2016 Kimmo Myllyvirta + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" +#include "wine/port.h" + +#define NONAMELESSUNION +#include "d3d11_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3d11); + +/* ID3D11DeviceContext - deferred context methods */ + +static inline struct d3d11_deferred_context *impl_from_ID3D11DeviceContext(ID3D11DeviceContext *iface) +{ + return CONTAINING_RECORD(iface, struct d3d11_deferred_context, ID3D11DeviceContext_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_QueryInterface(ID3D11DeviceContext *iface, + REFIID riid, void **out) +{ + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_ID3D11DeviceContext) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) + || IsEqualGUID(riid, &IID_IUnknown)) + { + ID3D11DeviceContext_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d3d11_deferred_context_AddRef(ID3D11DeviceContext *iface) +{ + struct d3d11_deferred_context *context = impl_from_ID3D11DeviceContext(iface); + ULONG refcount = InterlockedIncrement(&context->refcount); + + TRACE("%p increasing refcount to %u.\n", context, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d3d11_deferred_context_Release(ID3D11DeviceContext *iface) +{ + struct d3d11_deferred_context *context = impl_from_ID3D11DeviceContext(iface); + ULONG refcount = InterlockedDecrement(&context->refcount); + + TRACE("%p decreasing refcount to %u.\n", context, refcount); + + if (!refcount) + { + ID3D11Device_Release(context->device); + wined3d_private_store_cleanup(&context->private_store); + HeapFree(GetProcessHeap(), 0, context); + } + + return refcount; +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GetDevice(ID3D11DeviceContext *iface, ID3D11Device **device) +{ + struct d3d11_deferred_context *context = impl_from_ID3D11DeviceContext(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = context->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_GetPrivateData(ID3D11DeviceContext *iface, REFGUID guid, + UINT *data_size, void *data) +{ + struct d3d11_deferred_context *context = impl_from_ID3D11DeviceContext(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&context->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_SetPrivateData(ID3D11DeviceContext *iface, REFGUID guid, + UINT data_size, const void *data) +{ + struct d3d11_deferred_context *context = impl_from_ID3D11DeviceContext(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&context->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_SetPrivateDataInterface(ID3D11DeviceContext *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d11_deferred_context *context = impl_from_ID3D11DeviceContext(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&context->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetShader(ID3D11DeviceContext *iface, + ID3D11PixelShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShader(ID3D11DeviceContext *iface, + ID3D11VertexShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DrawIndexed(ID3D11DeviceContext *iface, + UINT index_count, UINT start_index_location, INT base_vertex_location) +{ + FIXME("iface %p, index_count %u, start_index_location %u, base_vertex_location %d stub!\n", + iface, index_count, start_index_location, base_vertex_location); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_Draw(ID3D11DeviceContext *iface, + UINT vertex_count, UINT start_vertex_location) +{ + FIXME("iface %p, vertex_count %u, start_vertex_location %u stub!\n", + iface, vertex_count, start_vertex_location); +} + +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) +{ + FIXME("iface %p, resource %p, subresource_idx %u, map_type %u, map_flags %#x, mapped_subresource %p stub!\n", + iface, resource, subresource_idx, map_type, map_flags, mapped_subresource); + + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_Unmap(ID3D11DeviceContext *iface, ID3D11Resource *resource, + UINT subresource_idx) +{ + FIXME("iface %p, resource %p, subresource_idx %u stub!\n", iface, resource, subresource_idx); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_IASetInputLayout(ID3D11DeviceContext *iface, + ID3D11InputLayout *input_layout) +{ + FIXME("iface %p, input_layout %p stub!\n", iface, input_layout); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_IASetVertexBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers, const UINT *strides, const UINT *offsets) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n", + iface, start_slot, buffer_count, buffers, strides, offsets); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_IASetIndexBuffer(ID3D11DeviceContext *iface, + ID3D11Buffer *buffer, DXGI_FORMAT format, UINT offset) +{ + FIXME("iface %p, buffer %p, format %s, offset %u stub!\n", + iface, buffer, debug_dxgi_format(format), offset); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DrawIndexedInstanced(ID3D11DeviceContext *iface, + UINT instance_index_count, UINT instance_count, UINT start_index_location, INT base_vertex_location, + UINT start_instance_location) +{ + FIXME("iface %p, instance_index_count %u, instance_count %u, start_index_location %u, " + "base_vertex_location %d, start_instance_location %u stub!\n", + iface, instance_index_count, instance_count, start_index_location, + base_vertex_location, start_instance_location); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DrawInstanced(ID3D11DeviceContext *iface, + UINT instance_vertex_count, UINT instance_count, UINT start_vertex_location, UINT start_instance_location) +{ + FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u, " + "start_instance_location %u stub!\n", + iface, instance_vertex_count, instance_count, start_vertex_location, + start_instance_location); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShader(ID3D11DeviceContext *iface, + ID3D11GeometryShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_IASetPrimitiveTopology(ID3D11DeviceContext *iface, + D3D11_PRIMITIVE_TOPOLOGY topology) +{ + FIXME("iface %p, topology %u stub!\n", iface, topology); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_Begin(ID3D11DeviceContext *iface, + ID3D11Asynchronous *asynchronous) +{ + FIXME("iface %p, asynchronous %p stub!\n", iface, asynchronous); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_End(ID3D11DeviceContext *iface, + ID3D11Asynchronous *asynchronous) +{ + FIXME("iface %p, asynchronous %p stub!\n", iface, asynchronous); +} + +static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_GetData(ID3D11DeviceContext *iface, + ID3D11Asynchronous *asynchronous, void *data, UINT data_size, UINT data_flags) +{ + FIXME("iface %p, asynchronous %p, data %p, data_size %u, data_flags %#x stub!\n", + iface, asynchronous, data, data_size, data_flags); + + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_SetPredication(ID3D11DeviceContext *iface, + ID3D11Predicate *predicate, BOOL value) +{ + FIXME("iface %p, predicate %p, value %#x stub!\n", iface, predicate, value); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargets(ID3D11DeviceContext *iface, + UINT render_target_view_count, ID3D11RenderTargetView *const *render_target_views, + ID3D11DepthStencilView *depth_stencil_view) +{ + FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p stub!\n", + iface, render_target_view_count, render_target_views, depth_stencil_view); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargetsAndUnorderedAccessViews( + ID3D11DeviceContext *iface, UINT render_target_view_count, + ID3D11RenderTargetView *const *render_target_views, ID3D11DepthStencilView *depth_stencil_view, + UINT unordered_access_view_start_slot, UINT unordered_access_view_count, + ID3D11UnorderedAccessView *const *unordered_access_views, const UINT *initial_counts) +{ + FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p, " + "unordered_access_view_start_slot %u, unordered_access_view_count %u, unordered_access_views %p, " + "initial_counts %p stub!\n", + iface, render_target_view_count, render_target_views, depth_stencil_view, + unordered_access_view_start_slot, unordered_access_view_count, unordered_access_views, + initial_counts); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetBlendState(ID3D11DeviceContext *iface, + ID3D11BlendState *blend_state, const float blend_factor[4], UINT sample_mask) +{ + FIXME("iface %p, blend_state %p, blend_factor %s, sample_mask 0x%08x stub!\n", + iface, blend_state, debug_float4(blend_factor), sample_mask); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetDepthStencilState(ID3D11DeviceContext *iface, + ID3D11DepthStencilState *depth_stencil_state, UINT stencil_ref) +{ + FIXME("iface %p, depth_stencil_state %p, stencil_ref %u stub!\n", + iface, depth_stencil_state, stencil_ref); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_SOSetTargets(ID3D11DeviceContext *iface, UINT buffer_count, + ID3D11Buffer *const *buffers, const UINT *offsets) +{ + FIXME("iface %p, buffer_count %u, buffers %p, offsets %p stub!\n", iface, buffer_count, buffers, offsets); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DrawAuto(ID3D11DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DrawIndexedInstancedIndirect(ID3D11DeviceContext *iface, + ID3D11Buffer *buffer, UINT offset) +{ + FIXME("iface %p, buffer %p, offset %u stub!\n", iface, buffer, offset); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DrawInstancedIndirect(ID3D11DeviceContext *iface, + ID3D11Buffer *buffer, UINT offset) +{ + FIXME("iface %p, buffer %p, offset %u stub!\n", iface, buffer, offset); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_Dispatch(ID3D11DeviceContext *iface, + UINT thread_group_count_x, UINT thread_group_count_y, UINT thread_group_count_z) +{ + FIXME("iface %p, thread_group_count_x %u, thread_group_count_y %u, thread_group_count_z %u stub!\n", + iface, thread_group_count_x, thread_group_count_y, thread_group_count_z); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DispatchIndirect(ID3D11DeviceContext *iface, + ID3D11Buffer *buffer, UINT offset) +{ + FIXME("iface %p, buffer %p, offset %u stub!\n", iface, buffer, offset); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_RSSetState(ID3D11DeviceContext *iface, + ID3D11RasterizerState *rasterizer_state) +{ + FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_RSSetViewports(ID3D11DeviceContext *iface, + UINT viewport_count, const D3D11_VIEWPORT *viewports) +{ + FIXME("iface %p, viewport_count %u, viewports %p stub!\n", iface, viewport_count, viewports); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_RSSetScissorRects(ID3D11DeviceContext *iface, + UINT rect_count, const D3D11_RECT *rects) +{ + FIXME("iface %p, rect_count %u, rects %p stub!\n", iface, rect_count, rects); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CopySubresourceRegion(ID3D11DeviceContext *iface, + ID3D11Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z, + ID3D11Resource *src_resource, UINT src_subresource_idx, const D3D11_BOX *src_box) +{ + FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u, " + "src_resource %p, src_subresource_idx %u, src_box %p stub!\n", + iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, + src_resource, src_subresource_idx, src_box); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CopyResource(ID3D11DeviceContext *iface, + ID3D11Resource *dst_resource, ID3D11Resource *src_resource) +{ + FIXME("iface %p, dst_resource %p, src_resource %p stub!\n", iface, dst_resource, src_resource); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_UpdateSubresource(ID3D11DeviceContext *iface, + ID3D11Resource *resource, UINT subresource_idx, const D3D11_BOX *box, + const void *data, UINT row_pitch, UINT depth_pitch) +{ + FIXME("iface %p, resource %p, subresource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u stub!\n", + iface, resource, subresource_idx, box, data, row_pitch, depth_pitch); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CopyStructureCount(ID3D11DeviceContext *iface, + ID3D11Buffer *dst_buffer, UINT dst_offset, ID3D11UnorderedAccessView *src_view) +{ + FIXME("iface %p, dst_buffer %p, dst_offset %u, src_view %p stub!\n", + iface, dst_buffer, dst_offset, src_view); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_ClearRenderTargetView(ID3D11DeviceContext *iface, + ID3D11RenderTargetView *render_target_view, const float color_rgba[4]) +{ + FIXME("iface %p, render_target_view %p, color_rgba %s stub!\n", + iface, render_target_view, debug_float4(color_rgba)); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_ClearUnorderedAccessViewUint(ID3D11DeviceContext *iface, + ID3D11UnorderedAccessView *unordered_access_view, const UINT values[4]) +{ + FIXME("iface %p, unordered_access_view %p, values {%u %u %u %u} stub!\n", + iface, unordered_access_view, values[0], values[1], values[2], values[3]); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_ClearUnorderedAccessViewFloat(ID3D11DeviceContext *iface, + ID3D11UnorderedAccessView *unordered_access_view, const float values[4]) +{ + FIXME("iface %p, unordered_access_view %p, values %s stub!\n", + iface, unordered_access_view, debug_float4(values)); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_ClearDepthStencilView(ID3D11DeviceContext *iface, + ID3D11DepthStencilView *depth_stencil_view, UINT flags, FLOAT depth, UINT8 stencil) +{ + FIXME("iface %p, depth_stencil_view %p, flags %#x, depth %.8e, stencil %u stub!\n", + iface, depth_stencil_view, flags, depth, stencil); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GenerateMips(ID3D11DeviceContext *iface, + ID3D11ShaderResourceView *view) +{ + FIXME("iface %p, view %p stub!\n", iface, view); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_SetResourceMinLOD(ID3D11DeviceContext *iface, + ID3D11Resource *resource, FLOAT min_lod) +{ + FIXME("iface %p, resource %p, min_lod %f stub!\n", iface, resource, min_lod); +} + +static FLOAT STDMETHODCALLTYPE d3d11_deferred_context_GetResourceMinLOD(ID3D11DeviceContext *iface, + ID3D11Resource *resource) +{ + FIXME("iface %p, resource %p stub!\n", iface, resource); + + return 0.0f; +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_ResolveSubresource(ID3D11DeviceContext *iface, + ID3D11Resource *dst_resource, UINT dst_subresource_idx, + ID3D11Resource *src_resource, UINT src_subresource_idx, + DXGI_FORMAT format) +{ + FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, src_resource %p, src_subresource_idx %u, " + "format %s stub!\n", + iface, dst_resource, dst_subresource_idx, src_resource, src_subresource_idx, + debug_dxgi_format(format)); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_ExecuteCommandList(ID3D11DeviceContext *iface, + ID3D11CommandList *command_list, BOOL restore_state) +{ + FIXME("iface %p, command_list %p, restore_state %#x stub!\n", iface, command_list, restore_state); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetShader(ID3D11DeviceContext *iface, + ID3D11HullShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DSSetShader(ID3D11DeviceContext *iface, + ID3D11DomainShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetUnorderedAccessViews(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11UnorderedAccessView *const *views, const UINT *initial_counts) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p, initial_counts %p stub!\n", + iface, start_slot, view_count, views, initial_counts); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetShader(ID3D11DeviceContext *iface, + ID3D11ComputeShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_VSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_PSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_PSGetShader(ID3D11DeviceContext *iface, + ID3D11PixelShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_PSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_VSGetShader(ID3D11DeviceContext *iface, + ID3D11VertexShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_PSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_IAGetInputLayout(ID3D11DeviceContext *iface, + ID3D11InputLayout **input_layout) +{ + FIXME("iface %p, input_layout %p stub!\n", iface, input_layout); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_IAGetVertexBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers, UINT *strides, UINT *offsets) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n", + iface, start_slot, buffer_count, buffers, strides, offsets); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_IAGetIndexBuffer(ID3D11DeviceContext *iface, + ID3D11Buffer **buffer, DXGI_FORMAT *format, UINT *offset) +{ + FIXME("iface %p, buffer %p, format %p, offset %p stub!\n", iface, buffer, format, offset); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GSGetShader(ID3D11DeviceContext *iface, + ID3D11GeometryShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_IAGetPrimitiveTopology(ID3D11DeviceContext *iface, + D3D11_PRIMITIVE_TOPOLOGY *topology) +{ + FIXME("iface %p, topology %p stub!\n", iface, topology); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_VSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_VSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GetPredication(ID3D11DeviceContext *iface, + ID3D11Predicate **predicate, BOOL *value) +{ + FIXME("iface %p, predicate %p, value %p stub!\n", iface, predicate, value); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_GSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_OMGetRenderTargets(ID3D11DeviceContext *iface, + UINT render_target_view_count, ID3D11RenderTargetView **render_target_views, + ID3D11DepthStencilView **depth_stencil_view) +{ + FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p stub!\n", + iface, render_target_view_count, render_target_views, depth_stencil_view); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_OMGetRenderTargetsAndUnorderedAccessViews( + ID3D11DeviceContext *iface, + UINT render_target_view_count, ID3D11RenderTargetView **render_target_views, + ID3D11DepthStencilView **depth_stencil_view, + UINT unordered_access_view_start_slot, UINT unordered_access_view_count, + ID3D11UnorderedAccessView **unordered_access_views) +{ + FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p, " + "unordered_access_view_start_slot %u, unordered_access_view_count %u, " + "unordered_access_views %p stub!\n", + iface, render_target_view_count, render_target_views, depth_stencil_view, + unordered_access_view_start_slot, unordered_access_view_count, unordered_access_views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_OMGetBlendState(ID3D11DeviceContext *iface, + ID3D11BlendState **blend_state, FLOAT blend_factor[4], UINT *sample_mask) +{ + FIXME("iface %p, blend_state %p, blend_factor %p, sample_mask %p stub!\n", + iface, blend_state, blend_factor, sample_mask); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_OMGetDepthStencilState(ID3D11DeviceContext *iface, + ID3D11DepthStencilState **depth_stencil_state, UINT *stencil_ref) +{ + FIXME("iface %p, depth_stencil_state %p, stencil_ref %p stub!\n", + iface, depth_stencil_state, stencil_ref); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_SOGetTargets(ID3D11DeviceContext *iface, + UINT buffer_count, ID3D11Buffer **buffers) +{ + FIXME("iface %p, buffer_count %u, buffers %p stub!\n", iface, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_RSGetState(ID3D11DeviceContext *iface, + ID3D11RasterizerState **rasterizer_state) +{ + FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_RSGetViewports(ID3D11DeviceContext *iface, + UINT *viewport_count, D3D11_VIEWPORT *viewports) +{ + FIXME("iface %p, viewport_count %p, viewports %p stub!\n", iface, viewport_count, viewports); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_RSGetScissorRects(ID3D11DeviceContext *iface, + UINT *rect_count, D3D11_RECT *rects) +{ + FIXME("iface %p, rect_count %p, rects %p stub!\n", iface, rect_count, rects); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_HSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_HSGetShader(ID3D11DeviceContext *iface, + ID3D11HullShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_HSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_HSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DSGetShader(ID3D11DeviceContext *iface, + ID3D11DomainShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_DSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CSGetUnorderedAccessViews(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11UnorderedAccessView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CSGetShader(ID3D11DeviceContext *iface, + ID3D11ComputeShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_CSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffer %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_ClearState(ID3D11DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); +} + +static void STDMETHODCALLTYPE d3d11_deferred_context_Flush(ID3D11DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); +} + +static D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE d3d11_deferred_context_GetType(ID3D11DeviceContext *iface) +{ + TRACE("iface %p.\n", iface); + + return D3D11_DEVICE_CONTEXT_DEFERRED; +} + +static UINT STDMETHODCALLTYPE d3d11_deferred_context_GetContextFlags(ID3D11DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_FinishCommandList(ID3D11DeviceContext *iface, + BOOL restore, ID3D11CommandList **command_list) +{ + FIXME("iface %p, restore %#x, command_list %p stub!\n", iface, restore, command_list); + + return E_NOTIMPL; +} + +static const struct ID3D11DeviceContextVtbl d3d11_deferred_context_vtbl = +{ + /* IUnknown methods */ + d3d11_deferred_context_QueryInterface, + d3d11_deferred_context_AddRef, + d3d11_deferred_context_Release, + /* ID3D11DeviceChild methods */ + d3d11_deferred_context_GetDevice, + d3d11_deferred_context_GetPrivateData, + d3d11_deferred_context_SetPrivateData, + d3d11_deferred_context_SetPrivateDataInterface, + /* ID3D11DeviceContext methods */ + d3d11_deferred_context_VSSetConstantBuffers, + d3d11_deferred_context_PSSetShaderResources, + d3d11_deferred_context_PSSetShader, + d3d11_deferred_context_PSSetSamplers, + d3d11_deferred_context_VSSetShader, + d3d11_deferred_context_DrawIndexed, + d3d11_deferred_context_Draw, + d3d11_deferred_context_Map, + d3d11_deferred_context_Unmap, + d3d11_deferred_context_PSSetConstantBuffers, + d3d11_deferred_context_IASetInputLayout, + d3d11_deferred_context_IASetVertexBuffers, + d3d11_deferred_context_IASetIndexBuffer, + d3d11_deferred_context_DrawIndexedInstanced, + d3d11_deferred_context_DrawInstanced, + d3d11_deferred_context_GSSetConstantBuffers, + d3d11_deferred_context_GSSetShader, + d3d11_deferred_context_IASetPrimitiveTopology, + d3d11_deferred_context_VSSetShaderResources, + d3d11_deferred_context_VSSetSamplers, + d3d11_deferred_context_Begin, + d3d11_deferred_context_End, + d3d11_deferred_context_GetData, + d3d11_deferred_context_SetPredication, + d3d11_deferred_context_GSSetShaderResources, + d3d11_deferred_context_GSSetSamplers, + d3d11_deferred_context_OMSetRenderTargets, + d3d11_deferred_context_OMSetRenderTargetsAndUnorderedAccessViews, + d3d11_deferred_context_OMSetBlendState, + d3d11_deferred_context_OMSetDepthStencilState, + d3d11_deferred_context_SOSetTargets, + d3d11_deferred_context_DrawAuto, + d3d11_deferred_context_DrawIndexedInstancedIndirect, + d3d11_deferred_context_DrawInstancedIndirect, + d3d11_deferred_context_Dispatch, + d3d11_deferred_context_DispatchIndirect, + d3d11_deferred_context_RSSetState, + d3d11_deferred_context_RSSetViewports, + d3d11_deferred_context_RSSetScissorRects, + d3d11_deferred_context_CopySubresourceRegion, + d3d11_deferred_context_CopyResource, + d3d11_deferred_context_UpdateSubresource, + d3d11_deferred_context_CopyStructureCount, + d3d11_deferred_context_ClearRenderTargetView, + d3d11_deferred_context_ClearUnorderedAccessViewUint, + d3d11_deferred_context_ClearUnorderedAccessViewFloat, + d3d11_deferred_context_ClearDepthStencilView, + d3d11_deferred_context_GenerateMips, + d3d11_deferred_context_SetResourceMinLOD, + d3d11_deferred_context_GetResourceMinLOD, + d3d11_deferred_context_ResolveSubresource, + d3d11_deferred_context_ExecuteCommandList, + d3d11_deferred_context_HSSetShaderResources, + d3d11_deferred_context_HSSetShader, + d3d11_deferred_context_HSSetSamplers, + d3d11_deferred_context_HSSetConstantBuffers, + d3d11_deferred_context_DSSetShaderResources, + d3d11_deferred_context_DSSetShader, + d3d11_deferred_context_DSSetSamplers, + d3d11_deferred_context_DSSetConstantBuffers, + d3d11_deferred_context_CSSetShaderResources, + d3d11_deferred_context_CSSetUnorderedAccessViews, + d3d11_deferred_context_CSSetShader, + d3d11_deferred_context_CSSetSamplers, + d3d11_deferred_context_CSSetConstantBuffers, + d3d11_deferred_context_VSGetConstantBuffers, + d3d11_deferred_context_PSGetShaderResources, + d3d11_deferred_context_PSGetShader, + d3d11_deferred_context_PSGetSamplers, + d3d11_deferred_context_VSGetShader, + d3d11_deferred_context_PSGetConstantBuffers, + d3d11_deferred_context_IAGetInputLayout, + d3d11_deferred_context_IAGetVertexBuffers, + d3d11_deferred_context_IAGetIndexBuffer, + d3d11_deferred_context_GSGetConstantBuffers, + d3d11_deferred_context_GSGetShader, + d3d11_deferred_context_IAGetPrimitiveTopology, + d3d11_deferred_context_VSGetShaderResources, + d3d11_deferred_context_VSGetSamplers, + d3d11_deferred_context_GetPredication, + d3d11_deferred_context_GSGetShaderResources, + d3d11_deferred_context_GSGetSamplers, + d3d11_deferred_context_OMGetRenderTargets, + d3d11_deferred_context_OMGetRenderTargetsAndUnorderedAccessViews, + d3d11_deferred_context_OMGetBlendState, + d3d11_deferred_context_OMGetDepthStencilState, + d3d11_deferred_context_SOGetTargets, + d3d11_deferred_context_RSGetState, + d3d11_deferred_context_RSGetViewports, + d3d11_deferred_context_RSGetScissorRects, + d3d11_deferred_context_HSGetShaderResources, + d3d11_deferred_context_HSGetShader, + d3d11_deferred_context_HSGetSamplers, + d3d11_deferred_context_HSGetConstantBuffers, + d3d11_deferred_context_DSGetShaderResources, + d3d11_deferred_context_DSGetShader, + d3d11_deferred_context_DSGetSamplers, + d3d11_deferred_context_DSGetConstantBuffers, + d3d11_deferred_context_CSGetShaderResources, + d3d11_deferred_context_CSGetUnorderedAccessViews, + d3d11_deferred_context_CSGetShader, + d3d11_deferred_context_CSGetSamplers, + d3d11_deferred_context_CSGetConstantBuffers, + d3d11_deferred_context_ClearState, + d3d11_deferred_context_Flush, + d3d11_deferred_context_GetType, + d3d11_deferred_context_GetContextFlags, + d3d11_deferred_context_FinishCommandList, +}; + +static HRESULT d3d11_deferred_context_init(struct d3d_device *device, struct d3d11_deferred_context *context) +{ + context->ID3D11DeviceContext_iface.lpVtbl = &d3d11_deferred_context_vtbl; + context->refcount = 1; + + wined3d_private_store_init(&context->private_store); + + context->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(context->device); + + return S_OK; +} + +HRESULT d3d11_deferred_context_create(struct d3d_device *device, UINT flags, struct d3d11_deferred_context **context) +{ + struct d3d11_deferred_context *object; + HRESULT hr; + + if (flags) + FIXME("Ignoring context flags %#x.\n", flags); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d11_deferred_context_init(device, object))) + { + WARN("Failed to initialize deferred context, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created deferred context %p.\n", object); + *context = object; + + return S_OK; +} diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 72e6a71..60ff9c6 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2685,9 +2685,23 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device *iface, static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device *iface, UINT flags, ID3D11DeviceContext **context) { - FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context); + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d11_deferred_context *object; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, flags %#x, context %p.\n", iface, flags, context); + + if (FAILED(hr = d3d11_deferred_context_create(device, flags, &object))) + return hr; + + if (context) + { + *context = (ID3D11DeviceContext *)&object->ID3D11DeviceContext_iface; + return S_OK; + } + + ID3D11DeviceContext_Release(&object->ID3D11DeviceContext_iface); + return S_FALSE; } static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device *iface, HANDLE resource, REFIID riid, diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index ed4987e..14d58cb 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -10754,6 +10754,31 @@ static void run_for_each_9_x_feature_level(void (*test_func)(const D3D_FEATURE_L test_func(feature_levels[i]); } +static void test_deferred_context(void) +{ + ULONG refcount; + ID3D11DeviceContext *context; + ID3D11Device *device; + HRESULT hr; + D3D11_DEVICE_CONTEXT_TYPE type; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + hr = ID3D11Device_CreateDeferredContext(device, 0, &context); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + + type = ID3D11DeviceContext_GetType(context); + ok(type == D3D11_DEVICE_CONTEXT_DEFERRED, "Got unexpected type %#x.\n", type); + + ID3D11DeviceContext_Release(context); + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + START_TEST(d3d11) { test_create_device(); @@ -10814,4 +10839,5 @@ START_TEST(d3d11) test_line_antialiasing_blending(); run_for_each_feature_level(test_required_format_support); run_for_each_9_x_feature_level(test_fl9_draw); + test_deferred_context(); } -- 2.5.0