Signed-off-by: Józef Kucia jkucia@codeweavers.com ---
Version 2: Correctly check for multisample support.
--- dlls/d3d11/tests/d3d11.c | 139 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 9c12a768e20c..de2378f90b0b 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -19826,6 +19826,144 @@ static void test_sm5_bufinfo_instruction(void) release_test_context(&test_context); }
+static void test_sampleinfo_instruction(void) +{ + ID3D11Texture2D *float_rt_texture, *uint_rt_texture; + ID3D11RenderTargetView *float_rtv, *uint_rtv; + struct d3d11_test_context test_context; + ID3D11PixelShader *ps_float, *ps_uint; + unsigned int sample_count, quality; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11RenderTargetView *rtvs[2]; + ID3D11ShaderResourceView *srv; + ID3D11DeviceContext *context; + struct uvec4 expected_uint; + struct vec4 expected_float; + ID3D11Resource *texture; + ID3D11Device *device; + HRESULT hr; + + static const DWORD ps_uint_code[] = + { +#if 0 + Texture2DMS<float> t; + + uint4 main() : SV_Target1 + { + uint width, height, sample_count; + t.GetDimensions(width, height, sample_count); + return sample_count; + } +#endif + 0x43425844, 0x4342ad12, 0x19addd8c, 0x5cb87c48, 0xe604a242, 0x00000001, 0x000000d4, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000001, 0x00000000, 0x00000001, 0x00000001, + 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000005c, 0x00000050, 0x00000017, + 0x0100086a, 0x04002058, 0x00107000, 0x00000000, 0x00005555, 0x03000065, 0x001020f2, 0x00000001, + 0x02000068, 0x00000001, 0x0500086f, 0x00100012, 0x00000000, 0x0010700a, 0x00000000, 0x05000036, + 0x001020f2, 0x00000001, 0x00100006, 0x00000000, 0x0100003e, + }; + static const DWORD ps_float_code[] = + { +#if 0 + Texture2DMS<float> t; + + float4 main() : SV_Target + { + uint width, height, sample_count; + t.GetDimensions(width, height, sample_count); + return sample_count; + } +#endif + 0x43425844, 0x2b8aea46, 0x34ceda6f, 0xf98d222b, 0x235ebc0b, 0x00000001, 0x000000b8, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000040, 0x00000050, 0x00000010, + 0x0100086a, 0x04002058, 0x00107000, 0x00000000, 0x00005555, 0x03000065, 0x001020f2, 0x00000000, + 0x0500006f, 0x001020f2, 0x00000000, 0x0010700a, 0x00000000, 0x0100003e, + }; + static const D3D_FEATURE_LEVEL feature_level = D3D_FEATURE_LEVEL_11_0; + + if (!init_test_context(&test_context, &feature_level)) + return; + + device = test_context.device; + context = test_context.immediate_context; + + texture_desc.Width = 64; + texture_desc.Height = 64; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D11_USAGE_DEFAULT; + texture_desc.BindFlags = D3D11_BIND_RENDER_TARGET; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + texture_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &float_rt_texture); + ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr); + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)float_rt_texture, NULL, &float_rtv); + ok(hr == S_OK, "Failed to create rendertarget view, hr %#x.\n", hr); + texture_desc.Format = DXGI_FORMAT_R32G32B32A32_UINT; + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &uint_rt_texture); + ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr); + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)uint_rt_texture, NULL, &uint_rtv); + ok(hr == S_OK, "Failed to create rendertarget view, hr %#x.\n", hr); + + rtvs[0] = float_rtv; + rtvs[1] = uint_rtv; + ID3D11DeviceContext_OMSetRenderTargets(context, ARRAY_SIZE(rtvs), rtvs, NULL); + + hr = ID3D11Device_CreatePixelShader(device, ps_float_code, sizeof(ps_float_code), NULL, &ps_float); + ok(hr == S_OK, "Failed to create pixel shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_uint_code, sizeof(ps_uint_code), NULL, &ps_uint); + ok(hr == S_OK, "Failed to create pixel shader, hr %#x.\n", hr); + + for (sample_count = 2; sample_count <= 8; sample_count *= 2) + { + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + texture_desc.SampleDesc.Count = sample_count; + texture_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; + + hr = ID3D11Device_CheckMultisampleQualityLevels(device, texture_desc.Format, sample_count, &quality); + ok(hr == S_OK, "Failed to check multisample quality levels, hr %#x.\n", hr); + if (!quality) + { + skip("Sample count %u not supported.\n", sample_count); + continue; + } + + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D11Texture2D **)&texture); + ok(hr == S_OK, "Failed to create texture, hr %#x, sample count %u.\n", hr, sample_count); + hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)texture, NULL, &srv); + ok(hr == S_OK, "Failed to create shader resource view, hr %#x.\n", hr); + ID3D11DeviceContext_PSSetShaderResources(context, 0, 1, &srv); + + ID3D11DeviceContext_PSSetShader(context, ps_float, NULL, 0); + draw_quad(&test_context); + ID3D11DeviceContext_PSSetShader(context, ps_uint, NULL, 0); + draw_quad(&test_context); + + expected_float.x = expected_float.y = expected_float.z = expected_float.w = sample_count; + check_texture_vec4(float_rt_texture, &expected_float, 0); + expected_uint.x = expected_uint.y = expected_uint.z = expected_uint.w = sample_count; + check_texture_uvec4(uint_rt_texture, &expected_uint); + + ID3D11Resource_Release(texture); + ID3D11ShaderResourceView_Release(srv); + } + + ID3D11RenderTargetView_Release(float_rtv); + ID3D11RenderTargetView_Release(uint_rtv); + ID3D11Texture2D_Release(float_rt_texture); + ID3D11Texture2D_Release(uint_rt_texture); + ID3D11PixelShader_Release(ps_float); + ID3D11PixelShader_Release(ps_uint); + release_test_context(&test_context); +} + static void test_render_target_device_mismatch(void) { struct d3d11_test_context test_context; @@ -26688,6 +26826,7 @@ START_TEST(d3d11) test_primitive_restart(); test_resinfo_instruction(); test_sm5_bufinfo_instruction(); + test_sampleinfo_instruction(); test_render_target_device_mismatch(); test_buffer_srv(); run_for_each_feature_level_in_range(D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_11_0,
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d10core/tests/device.c | 86 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 65f610d81cef..be09f44c03cd 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -16339,6 +16339,91 @@ done: release_test_context(&test_context); }
+static void test_unbound_multisample_texture(void) +{ + struct d3d10core_test_context test_context; + ID3D10PixelShader *ps; + struct uvec4 cb_data; + ID3D10Device *device; + ID3D10Buffer *cb; + unsigned int i; + HRESULT hr; + + static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; + static const DWORD ps_code[] = + { +#if 0 + Texture2DMS<float4, 4> t; + + uint sample_index; + + float4 main(float4 position : SV_Position) : SV_Target + { + float3 p; + t.GetDimensions(p.x, p.y, p.z); + p *= float3(position.x / 640.0f, position.y / 480.0f, 0.0f); + /* sample index must be a literal */ + switch (sample_index) + { + case 1: return t.Load(int2(p.xy), 1); + case 2: return t.Load(int2(p.xy), 2); + case 3: return t.Load(int2(p.xy), 3); + default: return t.Load(int2(p.xy), 0); + } + } +#endif + 0x43425844, 0x03d62416, 0x1914ee8b, 0xccd08d68, 0x27f42136, 0x00000001, 0x000002f8, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x0000025c, 0x00000040, + 0x00000097, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04042058, 0x00107000, 0x00000000, + 0x00005555, 0x04002064, 0x00101032, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x02000068, 0x00000002, 0x0700003d, 0x001000f2, 0x00000000, 0x00004001, 0x00000000, 0x00107e46, + 0x00000000, 0x07000038, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00101046, 0x00000000, + 0x0a000038, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x00004002, 0x3acccccd, 0x3b088889, + 0x00000000, 0x00000000, 0x0400004c, 0x0020800a, 0x00000000, 0x00000000, 0x03000006, 0x00004001, + 0x00000001, 0x0500001b, 0x00100032, 0x00000001, 0x00100046, 0x00000000, 0x08000036, 0x001000c2, + 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0900002e, 0x001020f2, + 0x00000000, 0x00100e46, 0x00000001, 0x00107e46, 0x00000000, 0x00004001, 0x00000001, 0x0100003e, + 0x03000006, 0x00004001, 0x00000002, 0x0500001b, 0x00100032, 0x00000001, 0x00100046, 0x00000000, + 0x08000036, 0x001000c2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x0900002e, 0x001020f2, 0x00000000, 0x00100e46, 0x00000001, 0x00107e46, 0x00000000, 0x00004001, + 0x00000002, 0x0100003e, 0x03000006, 0x00004001, 0x00000003, 0x0500001b, 0x00100032, 0x00000001, + 0x00100046, 0x00000000, 0x08000036, 0x001000c2, 0x00000001, 0x00004002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0900002e, 0x001020f2, 0x00000000, 0x00100e46, 0x00000001, 0x00107e46, + 0x00000000, 0x00004001, 0x00000003, 0x0100003e, 0x0100000a, 0x0500001b, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0900002e, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, + 0x00000000, 0x00004001, 0x00000000, 0x0100003e, 0x01000017, 0x0100003e, + }; + + if (!init_test_context(&test_context)) + return; + device = test_context.device; + + hr = ID3D10Device_CreatePixelShader(device, ps_code, sizeof(ps_code), &ps); + ok(hr == S_OK, "Failed to create pixel shader, hr %#x.\n", hr); + ID3D10Device_PSSetShader(device, ps); + + memset(&cb_data, 0, sizeof(cb_data)); + cb = create_buffer(device, D3D10_BIND_CONSTANT_BUFFER, sizeof(cb_data), &cb_data); + ID3D10Device_PSSetConstantBuffers(device, 0, 1, &cb); + + for (i = 0; i < 4; ++i) + { + cb_data.x = i; + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, &cb_data, 0, 0); + ID3D10Device_ClearRenderTargetView(device, test_context.backbuffer_rtv, white); + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, 0x00000000, 1); + } + + ID3D10Buffer_Release(cb); + ID3D10PixelShader_Release(ps); + release_test_context(&test_context); +} + static void test_multiple_viewports(void) { struct @@ -16922,6 +17007,7 @@ START_TEST(device) test_combined_clip_and_cull_distances(); test_generate_mips(); test_alpha_to_coverage(); + test_unbound_multisample_texture(); test_multiple_viewports(); test_multisample_resolve(); test_depth_clip();
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/glsl_shader.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 7a7764b6438a..da7e70071d19 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -6845,6 +6845,14 @@ static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct w shader_addline(buffer, "ps_in[%u]%s = uintBitsToFloat(gl_FrontFacing ? 0xffffffffu : 0u);\n", input->register_idx, reg_mask); } + else if (input->sysval_semantic == WINED3D_SV_SAMPLE_INDEX) + { + if (gl_info->supported[ARB_SAMPLE_SHADING]) + shader_addline(buffer, "ps_in[%u]%s = intBitsToFloat(gl_SampleID);\n", + input->register_idx, reg_mask); + else + FIXME("ARB_sample_shading is not supported.\n"); + } else if (input->sysval_semantic == WINED3D_SV_RENDER_TARGET_ARRAY_INDEX && !semantic_idx) { if (gl_info->supported[ARB_FRAGMENT_LAYER_VIEWPORT])
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d11/async.c | 11 +-- dlls/d3d11/buffer.c | 11 +-- dlls/d3d11/d3d11_private.h | 48 ++++----- dlls/d3d11/device.c | 238 ++++++++++++++++++++++++++------------------- dlls/d3d11/inputlayout.c | 10 +- dlls/d3d11/shader.c | 65 ++++++------- dlls/d3d11/state.c | 46 +++++---- dlls/d3d11/tests/d3d11.c | 4 - dlls/d3d11/texture.c | 32 +++--- dlls/d3d11/view.c | 41 ++++---- 10 files changed, 264 insertions(+), 242 deletions(-)
diff --git a/dlls/d3d11/async.c b/dlls/d3d11/async.c index fd0936c7ec42..1a56df99f565 100644 --- a/dlls/d3d11/async.c +++ b/dlls/d3d11/async.c @@ -74,7 +74,7 @@ static ULONG STDMETHODCALLTYPE d3d11_query_AddRef(ID3D11Query *iface)
if (refcount == 1) { - ID3D11Device1_AddRef(query->device); + ID3D11Device2_AddRef(query->device); wined3d_mutex_lock(); wined3d_query_incref(query->wined3d_query); wined3d_mutex_unlock(); @@ -92,13 +92,13 @@ static ULONG STDMETHODCALLTYPE d3d11_query_Release(ID3D11Query *iface)
if (!refcount) { - ID3D11Device1 *device = query->device; + ID3D11Device2 *device = query->device;
wined3d_mutex_lock(); wined3d_query_decref(query->wined3d_query); wined3d_mutex_unlock();
- ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -254,7 +254,7 @@ static void STDMETHODCALLTYPE d3d10_query_GetDevice(ID3D10Query *iface, ID3D10De
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(query->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(query->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_query_GetPrivateData(ID3D10Query *iface, @@ -470,8 +470,7 @@ static HRESULT d3d_query_init(struct d3d_query *query, struct d3d_device *device wined3d_mutex_unlock();
query->predicate = predicate; - query->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(query->device); + ID3D11Device2_AddRef(query->device = &device->ID3D11Device2_iface);
return S_OK; } diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c index 7511b4536e3e..2221a8fdd5ae 100644 --- a/dlls/d3d11/buffer.c +++ b/dlls/d3d11/buffer.c @@ -71,7 +71,7 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_AddRef(ID3D11Buffer *iface)
if (refcount == 1) { - ID3D11Device1_AddRef(buffer->device); + ID3D11Device2_AddRef(buffer->device); wined3d_mutex_lock(); wined3d_buffer_incref(buffer->wined3d_buffer); wined3d_mutex_unlock(); @@ -89,14 +89,14 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface)
if (!refcount) { - ID3D11Device1 *device = buffer->device; + ID3D11Device2 *device = buffer->device;
wined3d_mutex_lock(); wined3d_buffer_decref(buffer->wined3d_buffer); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -242,7 +242,7 @@ static void STDMETHODCALLTYPE d3d10_buffer_GetDevice(ID3D10Buffer *iface, ID3D10
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(buffer->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(buffer->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface, @@ -470,8 +470,7 @@ static HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *dev } wined3d_mutex_unlock();
- buffer->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(buffer->device); + ID3D11Device2_AddRef(buffer->device = &device->ID3D11Device2_iface);
return S_OK; } diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index b575f96656a9..fdbb5414cdb0 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -125,7 +125,7 @@ struct d3d_texture1d IUnknown *dxgi_surface; struct wined3d_texture *wined3d_texture; D3D11_TEXTURE1D_DESC desc; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DESC *desc, @@ -144,7 +144,7 @@ struct d3d_texture2d IUnknown *dxgi_surface; struct wined3d_texture *wined3d_texture; D3D11_TEXTURE2D_DESC desc; - ID3D11Device1 *device; + ID3D11Device2 *device; };
static inline struct d3d_texture2d *impl_from_ID3D11Texture2D(ID3D11Texture2D *iface) @@ -167,7 +167,7 @@ struct d3d_texture3d struct wined3d_private_store private_store; struct wined3d_texture *wined3d_texture; D3D11_TEXTURE3D_DESC desc; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_texture3d_create(struct d3d_device *device, const D3D11_TEXTURE3D_DESC *desc, @@ -185,7 +185,7 @@ struct d3d_buffer struct wined3d_private_store private_store; struct wined3d_buffer *wined3d_buffer; D3D11_BUFFER_DESC desc; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_buffer_create(struct d3d_device *device, const D3D11_BUFFER_DESC *desc, @@ -204,7 +204,7 @@ struct d3d_depthstencil_view struct wined3d_rendertarget_view *wined3d_view; D3D11_DEPTH_STENCIL_VIEW_DESC desc; ID3D11Resource *resource; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_depthstencil_view_create(struct d3d_device *device, ID3D11Resource *resource, @@ -223,7 +223,7 @@ struct d3d_rendertarget_view struct wined3d_rendertarget_view *wined3d_view; D3D11_RENDER_TARGET_VIEW_DESC desc; ID3D11Resource *resource; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_rendertarget_view_create(struct d3d_device *device, ID3D11Resource *resource, @@ -242,7 +242,7 @@ struct d3d_shader_resource_view struct wined3d_shader_resource_view *wined3d_view; D3D11_SHADER_RESOURCE_VIEW_DESC desc; ID3D11Resource *resource; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_shader_resource_view_create(struct d3d_device *device, ID3D11Resource *resource, @@ -262,7 +262,7 @@ struct d3d11_unordered_access_view struct wined3d_unordered_access_view *wined3d_view; D3D11_UNORDERED_ACCESS_VIEW_DESC desc; ID3D11Resource *resource; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d11_unordered_access_view_create(struct d3d_device *device, ID3D11Resource *resource, @@ -279,7 +279,7 @@ struct d3d_input_layout
struct wined3d_private_store private_store; struct wined3d_vertex_declaration *wined3d_decl; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_input_layout_create(struct d3d_device *device, @@ -298,7 +298,7 @@ struct d3d_vertex_shader
struct wined3d_private_store private_store; struct wined3d_shader *wined3d_shader; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_vertex_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, @@ -314,7 +314,7 @@ struct d3d11_hull_shader
struct wined3d_private_store private_store; struct wined3d_shader *wined3d_shader; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d11_hull_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, @@ -329,7 +329,7 @@ struct d3d11_domain_shader
struct wined3d_private_store private_store; struct wined3d_shader *wined3d_shader; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d11_domain_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, @@ -345,7 +345,7 @@ struct d3d_geometry_shader
struct wined3d_private_store private_store; struct wined3d_shader *wined3d_shader; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_geometry_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, @@ -364,7 +364,7 @@ struct d3d_pixel_shader
struct wined3d_private_store private_store; struct wined3d_shader *wined3d_shader; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_pixel_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, @@ -380,7 +380,7 @@ struct d3d11_compute_shader
struct wined3d_private_store private_store; struct wined3d_shader *wined3d_shader; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d11_compute_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, @@ -400,7 +400,7 @@ struct d3d11_class_linkage LONG refcount;
struct wined3d_private_store private_store; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d11_class_linkage_create(struct d3d_device *device, @@ -417,7 +417,7 @@ struct d3d_blend_state struct wined3d_blend_state *wined3d_state; D3D11_BLEND_DESC desc; struct wine_rb_entry entry; - ID3D11Device1 *device; + ID3D11Device2 *device; };
static inline struct d3d_blend_state *impl_from_ID3D11BlendState(ID3D11BlendState *iface) @@ -440,7 +440,7 @@ struct d3d_depthstencil_state struct wined3d_private_store private_store; D3D11_DEPTH_STENCIL_DESC desc; struct wine_rb_entry entry; - ID3D11Device1 *device; + ID3D11Device2 *device; };
static inline struct d3d_depthstencil_state *impl_from_ID3D11DepthStencilState(ID3D11DepthStencilState *iface) @@ -466,7 +466,7 @@ struct d3d_rasterizer_state struct wined3d_rasterizer_state *wined3d_state; D3D11_RASTERIZER_DESC desc; struct wine_rb_entry entry; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_rasterizer_state_create(struct d3d_device *device, const D3D11_RASTERIZER_DESC *desc, @@ -485,7 +485,7 @@ struct d3d_sampler_state struct wined3d_sampler *wined3d_sampler; D3D11_SAMPLER_DESC desc; struct wine_rb_entry entry; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_sampler_state_create(struct d3d_device *device, const D3D11_SAMPLER_DESC *desc, @@ -504,7 +504,7 @@ struct d3d_query struct wined3d_query *wined3d_query; BOOL predicate; D3D11_QUERY_DESC desc; - ID3D11Device1 *device; + ID3D11Device2 *device; };
HRESULT d3d_query_create(struct d3d_device *device, const D3D11_QUERY_DESC *desc, BOOL predicate, @@ -526,7 +526,7 @@ struct d3d11_immediate_context struct d3d_device { IUnknown IUnknown_inner; - ID3D11Device1 ID3D11Device1_iface; + ID3D11Device2 ID3D11Device2_iface; ID3D10Device1 ID3D10Device1_iface; ID3D10Multithread ID3D10Multithread_iface; IWineDXGIDeviceParent IWineDXGIDeviceParent_iface; @@ -550,9 +550,9 @@ struct d3d_device UINT stencil_ref; };
-static inline struct d3d_device *impl_from_ID3D11Device1(ID3D11Device1 *iface) +static inline struct d3d_device *impl_from_ID3D11Device2(ID3D11Device2 *iface) { - return CONTAINING_RECORD(iface, struct d3d_device, ID3D11Device1_iface); + return CONTAINING_RECORD(iface, struct d3d_device, ID3D11Device2_iface); }
static inline struct d3d_device *impl_from_ID3D10Device(ID3D10Device1 *iface) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 5bc5018d6346..81f0dea77d15 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -75,7 +75,7 @@ static ULONG STDMETHODCALLTYPE d3d11_immediate_context_AddRef(ID3D11DeviceContex
if (refcount == 1) { - ID3D11Device1_AddRef(&device->ID3D11Device1_iface); + ID3D11Device2_AddRef(&device->ID3D11Device2_iface); }
return refcount; @@ -91,7 +91,7 @@ static ULONG STDMETHODCALLTYPE d3d11_immediate_context_Release(ID3D11DeviceConte
if (!refcount) { - ID3D11Device1_Release(&device->ID3D11Device1_iface); + ID3D11Device2_Release(&device->ID3D11Device2_iface); }
return refcount; @@ -103,7 +103,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GetDevice(ID3D11DeviceCont
TRACE("iface %p, device %p.\n", iface, device);
- *device = (ID3D11Device *)&device_object->ID3D11Device1_iface; + *device = (ID3D11Device *)&device_object->ID3D11Device2_iface; ID3D11Device_AddRef(*device); }
@@ -2893,7 +2893,7 @@ static void d3d11_immediate_context_init(struct d3d11_immediate_context *context context->ID3D11DeviceContext1_iface.lpVtbl = &d3d11_immediate_context_vtbl; context->refcount = 1;
- ID3D11Device1_AddRef(&device->ID3D11Device1_iface); + ID3D11Device2_AddRef(&device->ID3D11Device2_iface);
wined3d_private_store_init(&context->private_store); } @@ -2905,28 +2905,28 @@ static void d3d11_immediate_context_destroy(struct d3d11_immediate_context *cont
/* 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;
@@ -2940,10 +2940,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBuffer(ID3D11Device1 *iface, 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;
@@ -2957,10 +2957,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture1D(ID3D11Device1 *ifa 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;
@@ -2974,10 +2974,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture2D(ID3D11Device1 *ifa 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;
@@ -2991,10 +2991,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture3D(ID3D11Device1 *ifa 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;
@@ -3011,10 +3011,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateShaderResourceView(ID3D11Dev 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;
@@ -3028,10 +3028,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateUnorderedAccessView(ID3D11De 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;
@@ -3048,10 +3048,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Devic 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;
@@ -3065,11 +3065,11 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Devic 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;
@@ -3086,10 +3086,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateInputLayout(ID3D11Device1 *i 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;
@@ -3107,10 +3107,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateVertexShader(ID3D11Device1 * 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;
@@ -3129,12 +3129,12 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShader(ID3D11Device1 return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShaderWithStreamOutput(ID3D11Device1 *iface, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShaderWithStreamOutput(ID3D11Device2 *iface, const void *byte_code, SIZE_T byte_code_length, const D3D11_SO_DECLARATION_ENTRY *so_entries, UINT entry_count, const UINT *buffer_strides, UINT strides_count, UINT rasterizer_stream, 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;
@@ -3158,10 +3158,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShaderWithStreamOutp return hr; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePixelShader(ID3D11Device1 *iface, const void *byte_code, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePixelShader(ID3D11Device2 *iface, const void *byte_code, SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11PixelShader **shader) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d_pixel_shader *object; HRESULT hr;
@@ -3179,10 +3179,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePixelShader(ID3D11Device1 *i return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateHullShader(ID3D11Device1 *iface, const void *byte_code, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateHullShader(ID3D11Device2 *iface, const void *byte_code, SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11HullShader **shader) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d11_hull_shader *object; HRESULT hr;
@@ -3200,10 +3200,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateHullShader(ID3D11Device1 *if return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDomainShader(ID3D11Device1 *iface, const void *byte_code, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDomainShader(ID3D11Device2 *iface, const void *byte_code, SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11DomainShader **shader) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d11_domain_shader *object; HRESULT hr;
@@ -3221,10 +3221,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDomainShader(ID3D11Device1 * return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateComputeShader(ID3D11Device1 *iface, const void *byte_code, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateComputeShader(ID3D11Device2 *iface, const void *byte_code, SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11ComputeShader **shader) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d11_compute_shader *object; HRESULT hr;
@@ -3242,10 +3242,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateComputeShader(ID3D11Device1 return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateClassLinkage(ID3D11Device1 *iface, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateClassLinkage(ID3D11Device2 *iface, ID3D11ClassLinkage **class_linkage) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d11_class_linkage *object; HRESULT hr;
@@ -3259,10 +3259,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateClassLinkage(ID3D11Device1 * return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState(ID3D11Device1 *iface, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState(ID3D11Device2 *iface, const D3D11_BLEND_DESC *desc, ID3D11BlendState **blend_state) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d_blend_state *object; HRESULT hr;
@@ -3276,10 +3276,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState(ID3D11Device1 *if return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilState(ID3D11Device1 *iface, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilState(ID3D11Device2 *iface, const D3D11_DEPTH_STENCIL_DESC *desc, ID3D11DepthStencilState **depth_stencil_state) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d_depthstencil_state *object; HRESULT hr;
@@ -3293,10 +3293,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilState(ID3D11Devi return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRasterizerState(ID3D11Device1 *iface, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRasterizerState(ID3D11Device2 *iface, const D3D11_RASTERIZER_DESC *desc, ID3D11RasterizerState **rasterizer_state) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d_rasterizer_state *object; HRESULT hr;
@@ -3310,10 +3310,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRasterizerState(ID3D11Device return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateSamplerState(ID3D11Device1 *iface, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateSamplerState(ID3D11Device2 *iface, const D3D11_SAMPLER_DESC *desc, ID3D11SamplerState **sampler_state) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d_sampler_state *object; HRESULT hr;
@@ -3327,10 +3327,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateSamplerState(ID3D11Device1 * return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateQuery(ID3D11Device1 *iface, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateQuery(ID3D11Device2 *iface, const D3D11_QUERY_DESC *desc, ID3D11Query **query) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d_query *object; HRESULT hr;
@@ -3349,10 +3349,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateQuery(ID3D11Device1 *iface, return S_FALSE; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePredicate(ID3D11Device1 *iface, const D3D11_QUERY_DESC *desc, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePredicate(ID3D11Device2 *iface, const D3D11_QUERY_DESC *desc, ID3D11Predicate **predicate) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct d3d_query *object; HRESULT hr;
@@ -3371,7 +3371,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePredicate(ID3D11Device1 *ifa return S_FALSE; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device1 *iface, const D3D11_COUNTER_DESC *desc, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device2 *iface, const D3D11_COUNTER_DESC *desc, ID3D11Counter **counter) { FIXME("iface %p, desc %p, counter %p stub!\n", iface, desc, counter); @@ -3379,7 +3379,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device1 *iface return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device1 *iface, UINT flags, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device2 *iface, UINT flags, ID3D11DeviceContext **context) { FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context); @@ -3387,7 +3387,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device1 *iface, HANDLE resource, REFIID riid, +static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device2 *iface, HANDLE resource, REFIID riid, void **out) { FIXME("iface %p, resource %p, riid %s, out %p stub!\n", iface, resource, debugstr_guid(riid), out); @@ -3395,10 +3395,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device1 * return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device1 *iface, DXGI_FORMAT format, +static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 *iface, DXGI_FORMAT format, UINT *format_support) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct wined3d_device_creation_parameters params; enum wined3d_format_id wined3d_format; struct wined3d *wined3d; @@ -3454,10 +3454,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device1 * return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CheckMultisampleQualityLevels(ID3D11Device1 *iface, +static HRESULT STDMETHODCALLTYPE d3d11_device_CheckMultisampleQualityLevels(ID3D11Device2 *iface, DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); struct wined3d_device_creation_parameters params; struct wined3d *wined3d; HRESULT hr; @@ -3494,12 +3494,12 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckMultisampleQualityLevels(ID3D return hr; }
-static void STDMETHODCALLTYPE d3d11_device_CheckCounterInfo(ID3D11Device1 *iface, D3D11_COUNTER_INFO *info) +static void STDMETHODCALLTYPE d3d11_device_CheckCounterInfo(ID3D11Device2 *iface, D3D11_COUNTER_INFO *info) { FIXME("iface %p, info %p stub!\n", iface, info); }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CheckCounter(ID3D11Device1 *iface, const D3D11_COUNTER_DESC *desc, +static HRESULT STDMETHODCALLTYPE d3d11_device_CheckCounter(ID3D11Device2 *iface, const D3D11_COUNTER_DESC *desc, D3D11_COUNTER_TYPE *type, UINT *active_counter_count, char *name, UINT *name_length, char *units, UINT *units_length, char *description, UINT *description_length) { @@ -3511,10 +3511,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckCounter(ID3D11Device1 *iface, return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device1 *iface, D3D11_FEATURE feature, +static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device2 *iface, D3D11_FEATURE feature, void *feature_support_data, UINT feature_support_data_size) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface); WINED3DCAPS wined3d_caps; HRESULT hr;
@@ -3639,7 +3639,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device1 } }
-static HRESULT STDMETHODCALLTYPE d3d11_device_GetPrivateData(ID3D11Device1 *iface, REFGUID guid, +static HRESULT STDMETHODCALLTYPE d3d11_device_GetPrivateData(ID3D11Device2 *iface, REFGUID guid, UINT *data_size, void *data) { IDXGIDevice *dxgi_device; @@ -3647,7 +3647,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_GetPrivateData(ID3D11Device1 *ifac
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
- if (FAILED(hr = ID3D11Device1_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) + if (FAILED(hr = ID3D11Device2_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) return hr; hr = IDXGIDevice_GetPrivateData(dxgi_device, guid, data_size, data); IDXGIDevice_Release(dxgi_device); @@ -3655,7 +3655,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_GetPrivateData(ID3D11Device1 *ifac return hr; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateData(ID3D11Device1 *iface, REFGUID guid, +static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateData(ID3D11Device2 *iface, REFGUID guid, UINT data_size, const void *data) { IDXGIDevice *dxgi_device; @@ -3663,7 +3663,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateData(ID3D11Device1 *ifac
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
- if (FAILED(hr = ID3D11Device1_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) + if (FAILED(hr = ID3D11Device2_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) return hr; hr = IDXGIDevice_SetPrivateData(dxgi_device, guid, data_size, data); IDXGIDevice_Release(dxgi_device); @@ -3671,7 +3671,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateData(ID3D11Device1 *ifac return hr; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateDataInterface(ID3D11Device1 *iface, REFGUID guid, +static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateDataInterface(ID3D11Device2 *iface, REFGUID guid, const IUnknown *data) { IDXGIDevice *dxgi_device; @@ -3679,7 +3679,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateDataInterface(ID3D11Devi
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
- if (FAILED(hr = ID3D11Device1_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) + if (FAILED(hr = ID3D11Device2_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) return hr; hr = IDXGIDevice_SetPrivateDataInterface(dxgi_device, guid, data); IDXGIDevice_Release(dxgi_device); @@ -3687,33 +3687,33 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateDataInterface(ID3D11Devi return hr; }
-static D3D_FEATURE_LEVEL STDMETHODCALLTYPE d3d11_device_GetFeatureLevel(ID3D11Device1 *iface) +static D3D_FEATURE_LEVEL STDMETHODCALLTYPE d3d11_device_GetFeatureLevel(ID3D11Device2 *iface) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface);
TRACE("iface %p.\n", iface);
return device->feature_level; }
-static UINT STDMETHODCALLTYPE d3d11_device_GetCreationFlags(ID3D11Device1 *iface) +static UINT STDMETHODCALLTYPE d3d11_device_GetCreationFlags(ID3D11Device2 *iface) { FIXME("iface %p stub!\n", iface);
return 0; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_GetDeviceRemovedReason(ID3D11Device1 *iface) +static HRESULT STDMETHODCALLTYPE d3d11_device_GetDeviceRemovedReason(ID3D11Device2 *iface) { WARN("iface %p stub!\n", iface);
return S_OK; }
-static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext(ID3D11Device1 *iface, +static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext(ID3D11Device2 *iface, ID3D11DeviceContext **immediate_context) { - struct d3d_device *device = impl_from_ID3D11Device1(iface); + struct d3d_device *device = impl_from_ID3D11Device2(iface);
TRACE("iface %p, immediate_context %p.\n", iface, immediate_context);
@@ -3721,26 +3721,26 @@ static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext(ID3D11Device1 *if ID3D11DeviceContext_AddRef(*immediate_context); }
-static HRESULT STDMETHODCALLTYPE d3d11_device_SetExceptionMode(ID3D11Device1 *iface, UINT flags) +static HRESULT STDMETHODCALLTYPE d3d11_device_SetExceptionMode(ID3D11Device2 *iface, UINT flags) { FIXME("iface %p, flags %#x stub!\n", iface, flags);
return E_NOTIMPL; }
-static UINT STDMETHODCALLTYPE d3d11_device_GetExceptionMode(ID3D11Device1 *iface) +static UINT STDMETHODCALLTYPE d3d11_device_GetExceptionMode(ID3D11Device2 *iface) { FIXME("iface %p stub!\n", iface);
return 0; }
-static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext1(ID3D11Device1 *iface, ID3D11DeviceContext1 **context) +static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext1(ID3D11Device2 *iface, ID3D11DeviceContext1 **context) { FIXME("iface %p, context %p stub!\n", iface, context); }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext1(ID3D11Device1 *iface, UINT flags, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext1(ID3D11Device2 *iface, UINT flags, ID3D11DeviceContext1 **context) { FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context); @@ -3748,7 +3748,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext1(ID3D11Devic return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState1(ID3D11Device1 *iface, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState1(ID3D11Device2 *iface, const D3D11_BLEND_DESC1 *desc, ID3D11BlendState1 **state) { FIXME("iface %p, desc %p, state %p stub!\n", iface, desc, state); @@ -3756,7 +3756,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState1(ID3D11Device1 *i return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRasterizerState1(ID3D11Device1 *iface, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRasterizerState1(ID3D11Device2 *iface, const D3D11_RASTERIZER_DESC1 *desc, ID3D11RasterizerState1 **state) { FIXME("iface %p, desc %p, state %p stub!\n", iface, desc, state); @@ -3764,7 +3764,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRasterizerState1(ID3D11Devic return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeviceContextState(ID3D11Device1 *iface, UINT flags, +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeviceContextState(ID3D11Device2 *iface, UINT flags, const D3D_FEATURE_LEVEL *feature_levels, UINT feature_levels_count, UINT sdk_version, REFIID emulated_interface, D3D_FEATURE_LEVEL *chosen_feature_level, ID3DDeviceContextState **state) { @@ -3775,7 +3775,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeviceContextState(ID3D11Dev return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource1(ID3D11Device1 *iface, HANDLE handle, +static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource1(ID3D11Device2 *iface, HANDLE handle, REFIID riid, void **resource) { FIXME("iface %p, handle %p, riid %s, resource %p stub!\n", iface, handle, debugstr_guid(riid), resource); @@ -3783,7 +3783,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource1(ID3D11Device1 return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResourceByName(ID3D11Device1 *iface, const WCHAR *name, +static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResourceByName(ID3D11Device2 *iface, const WCHAR *name, DWORD access, REFIID riid, void **resource) { FIXME("iface %p, name %s, access %#x, riid %s, resource %p stub!\n", iface, debugstr_w(name), access, @@ -3792,7 +3792,41 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResourceByName(ID3D11Dev return E_NOTIMPL; }
-static const struct ID3D11Device1Vtbl d3d11_device_vtbl = +static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext2(ID3D11Device2 *iface, + ID3D11DeviceContext2 **context) +{ + FIXME("iface %p, context %p stub!\n", iface, context); +} + +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext2(ID3D11Device2 *iface, + UINT flags, ID3D11DeviceContext2 **context) +{ + FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context); + + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_device_GetResourceTiling(ID3D11Device2 *iface, + ID3D11Resource *resource, UINT *tile_count, D3D11_PACKED_MIP_DESC *mip_desc, + D3D11_TILE_SHAPE *tile_shape, UINT *subresource_tiling_count, UINT first_subresource_tiling, + D3D11_SUBRESOURCE_TILING *subresource_tiling) +{ + FIXME("iface %p, resource %p, tile_count %p, mip_desc %p, tile_shape %p, " + "subresource_tiling_count %p, first_subresource_tiling %u, subresource_tiling %p stub!\n", + iface, resource, tile_count, mip_desc, tile_shape, + subresource_tiling_count, first_subresource_tiling, subresource_tiling); +} + +static HRESULT STDMETHODCALLTYPE d3d11_device_CheckMultisampleQualityLevels1(ID3D11Device2 *iface, + DXGI_FORMAT format, UINT sample_count, UINT flags, UINT *quality_level_count) +{ + FIXME("iface %p, format %#x, sample_count %u, flags %#x, quality_level_count %p stub!\n", + iface, format, sample_count, flags, quality_level_count); + + return E_NOTIMPL; +} + +static const struct ID3D11Device2Vtbl d3d11_device_vtbl = { /* IUnknown methods */ d3d11_device_QueryInterface, @@ -3847,6 +3881,11 @@ static const struct ID3D11Device1Vtbl d3d11_device_vtbl = d3d11_device_CreateDeviceContextState, d3d11_device_OpenSharedResource1, d3d11_device_OpenSharedResourceByName, + /* ID3D11Device2 methods */ + d3d11_device_GetImmediateContext2, + d3d11_device_CreateDeferredContext2, + d3d11_device_GetResourceTiling, + d3d11_device_CheckMultisampleQualityLevels1, };
/* Inner IUnknown methods */ @@ -3862,11 +3901,12 @@ static HRESULT STDMETHODCALLTYPE d3d_device_inner_QueryInterface(IUnknown *iface
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
- if (IsEqualGUID(riid, &IID_ID3D11Device1) + if (IsEqualGUID(riid, &IID_ID3D11Device2) + || IsEqualGUID(riid, &IID_ID3D11Device1) || IsEqualGUID(riid, &IID_ID3D11Device) || IsEqualGUID(riid, &IID_IUnknown)) { - *out = &device->ID3D11Device1_iface; + *out = &device->ID3D11Device2_iface; } else if (IsEqualGUID(riid, &IID_ID3D10Device1) || IsEqualGUID(riid, &IID_ID3D10Device)) @@ -5238,7 +5278,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_GetPrivateData(ID3D10Device1 *ifac
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
- return d3d11_device_GetPrivateData(&device->ID3D11Device1_iface, guid, data_size, data); + return d3d11_device_GetPrivateData(&device->ID3D11Device2_iface, guid, data_size, data); }
static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateData(ID3D10Device1 *iface, @@ -5248,7 +5288,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateData(ID3D10Device1 *ifac
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
- return d3d11_device_SetPrivateData(&device->ID3D11Device1_iface, guid, data_size, data); + return d3d11_device_SetPrivateData(&device->ID3D11Device2_iface, guid, data_size, data); }
static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateDataInterface(ID3D10Device1 *iface, @@ -5258,7 +5298,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateDataInterface(ID3D10Devi
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
- return d3d11_device_SetPrivateDataInterface(&device->ID3D11Device1_iface, guid, data); + return d3d11_device_SetPrivateDataInterface(&device->ID3D11Device2_iface, guid, data); }
static void STDMETHODCALLTYPE d3d10_device_ClearState(ID3D10Device1 *iface) @@ -5796,7 +5836,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device1 * TRACE("iface %p, format %s, format_support %p.\n", iface, debug_dxgi_format(format), format_support);
- return d3d11_device_CheckFormatSupport(&device->ID3D11Device1_iface, format, format_support); + return d3d11_device_CheckFormatSupport(&device->ID3D11Device2_iface, format, format_support); }
static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device1 *iface, @@ -5807,7 +5847,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D TRACE("iface %p, format %s, sample_count %u, quality_level_count %p.\n", iface, debug_dxgi_format(format), sample_count, quality_level_count);
- return d3d11_device_CheckMultisampleQualityLevels(&device->ID3D11Device1_iface, format, + return d3d11_device_CheckMultisampleQualityLevels(&device->ID3D11Device2_iface, format, sample_count, quality_level_count); }
@@ -6169,7 +6209,7 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic if (texture_flags) FIXME("Unhandled flags %#x.\n", texture_flags);
- if (FAILED(hr = d3d11_device_CreateTexture2D(&device->ID3D11Device1_iface, + if (FAILED(hr = d3d11_device_CreateTexture2D(&device->ID3D11Device2_iface, &desc, NULL, &texture_iface))) { WARN("Failed to create 2D texture, hr %#x.\n", hr); @@ -6194,7 +6234,7 @@ static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent
TRACE("device_parent %p, desc %p, swapchain %p.\n", device_parent, desc, swapchain);
- if (FAILED(hr = d3d11_device_QueryInterface(&device->ID3D11Device1_iface, + if (FAILED(hr = d3d11_device_QueryInterface(&device->ID3D11Device2_iface, &IID_IWineDXGIDevice, (void **)&wine_device))) { ERR("Device should implement IWineDXGIDevice.\n"); @@ -6258,7 +6298,7 @@ static int d3d_rasterizer_state_compare(const void *key, const struct wine_rb_en void d3d_device_init(struct d3d_device *device, void *outer_unknown) { device->IUnknown_inner.lpVtbl = &d3d_device_inner_unknown_vtbl; - device->ID3D11Device1_iface.lpVtbl = &d3d11_device_vtbl; + device->ID3D11Device2_iface.lpVtbl = &d3d11_device_vtbl; device->ID3D10Device1_iface.lpVtbl = &d3d10_device1_vtbl; device->ID3D10Multithread_iface.lpVtbl = &d3d10_multithread_vtbl; device->IWineDXGIDeviceParent_iface.lpVtbl = &d3d_dxgi_device_parent_vtbl; diff --git a/dlls/d3d11/inputlayout.c b/dlls/d3d11/inputlayout.c index 7b2d9b457d88..a650ca77f5eb 100644 --- a/dlls/d3d11/inputlayout.c +++ b/dlls/d3d11/inputlayout.c @@ -134,7 +134,7 @@ static ULONG STDMETHODCALLTYPE d3d11_input_layout_AddRef(ID3D11InputLayout *ifac
if (refcount == 1) { - ID3D11Device1_AddRef(layout->device); + ID3D11Device2_AddRef(layout->device); wined3d_mutex_lock(); wined3d_vertex_declaration_incref(layout->wined3d_decl); wined3d_mutex_unlock(); @@ -152,13 +152,13 @@ static ULONG STDMETHODCALLTYPE d3d11_input_layout_Release(ID3D11InputLayout *ifa
if (!refcount) { - ID3D11Device1 *device = layout->device; + ID3D11Device2 *device = layout->device;
wined3d_mutex_lock(); wined3d_vertex_declaration_decref(layout->wined3d_decl); wined3d_mutex_unlock();
- ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -262,7 +262,7 @@ static void STDMETHODCALLTYPE d3d10_input_layout_GetDevice(ID3D10InputLayout *if
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(layout->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(layout->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_input_layout_GetPrivateData(ID3D10InputLayout *iface, @@ -357,7 +357,7 @@ static HRESULT d3d_input_layout_init(struct d3d_input_layout *layout, struct d3d } wined3d_mutex_unlock();
- ID3D11Device1_AddRef(layout->device = &device->ID3D11Device1_iface); + ID3D11Device2_AddRef(layout->device = &device->ID3D11Device2_iface);
return S_OK; } diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c index de0607d2d455..c8d512f4d18f 100644 --- a/dlls/d3d11/shader.c +++ b/dlls/d3d11/shader.c @@ -330,7 +330,7 @@ static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_AddRef(ID3D11VertexShader *if
if (refcount == 1) { - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device); wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); wined3d_mutex_unlock(); @@ -348,14 +348,14 @@ static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_Release(ID3D11VertexShader *i
if (!refcount) { - ID3D11Device1 *device = shader->device; + ID3D11Device2 *device = shader->device;
wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -460,7 +460,7 @@ static void STDMETHODCALLTYPE d3d10_vertex_shader_GetDevice(ID3D10VertexShader *
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_GetPrivateData(ID3D10VertexShader *iface, @@ -575,8 +575,7 @@ static HRESULT d3d_vertex_shader_init(struct d3d_vertex_shader *shader, struct d } wined3d_mutex_unlock();
- shader->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -657,7 +656,7 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_AddRef(ID3D11HullShader *iface)
if (refcount == 1) { - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device); wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); wined3d_mutex_unlock(); @@ -675,7 +674,7 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_Release(ID3D11HullShader *iface
if (!refcount) { - ID3D11Device1 *device = shader->device; + ID3D11Device2 *device = shader->device;
wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); @@ -683,7 +682,7 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_Release(ID3D11HullShader *iface
/* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -788,8 +787,7 @@ static HRESULT d3d11_hull_shader_init(struct d3d11_hull_shader *shader, struct d } wined3d_mutex_unlock();
- shader->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -860,7 +858,7 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_AddRef(ID3D11DomainShader *if
if (refcount == 1) { - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device); wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); wined3d_mutex_unlock(); @@ -878,7 +876,7 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_Release(ID3D11DomainShader *i
if (!refcount) { - ID3D11Device1 *device = shader->device; + ID3D11Device2 *device = shader->device;
wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); @@ -886,7 +884,7 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_Release(ID3D11DomainShader *i
/* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -991,8 +989,7 @@ static HRESULT d3d11_domain_shader_init(struct d3d11_domain_shader *shader, stru } wined3d_mutex_unlock();
- shader->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -1073,7 +1070,7 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_AddRef(ID3D11GeometryShader
if (refcount == 1) { - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device); wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); wined3d_mutex_unlock(); @@ -1091,7 +1088,7 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release(ID3D11GeometryShade
if (!refcount) { - ID3D11Device1 *device = shader->device; + ID3D11Device2 *device = shader->device;
wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); @@ -1099,7 +1096,7 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release(ID3D11GeometryShade
/* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -1204,7 +1201,7 @@ static void STDMETHODCALLTYPE d3d10_geometry_shader_GetDevice(ID3D10GeometryShad
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_GetPrivateData(ID3D10GeometryShader *iface, @@ -1530,8 +1527,7 @@ static HRESULT d3d_geometry_shader_init(struct d3d_geometry_shader *shader, } wined3d_mutex_unlock();
- shader->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -1625,7 +1621,7 @@ static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_AddRef(ID3D11PixelShader *ifac
if (refcount == 1) { - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device); wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); wined3d_mutex_unlock(); @@ -1643,14 +1639,14 @@ static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_Release(ID3D11PixelShader *ifa
if (!refcount) { - ID3D11Device1 *device = shader->device; + ID3D11Device2 *device = shader->device;
wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -1755,7 +1751,7 @@ static void STDMETHODCALLTYPE d3d10_pixel_shader_GetDevice(ID3D10PixelShader *if
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_GetPrivateData(ID3D10PixelShader *iface, @@ -1849,8 +1845,7 @@ static HRESULT d3d_pixel_shader_init(struct d3d_pixel_shader *shader, struct d3d } wined3d_mutex_unlock();
- shader->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -1930,7 +1925,7 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_AddRef(ID3D11ComputeShader *
if (refcount == 1) { - ID3D11Device1_AddRef(shader->device); + ID3D11Device2_AddRef(shader->device); wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); wined3d_mutex_unlock(); @@ -1948,7 +1943,7 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_Release(ID3D11ComputeShader
if (!refcount) { - ID3D11Device1 *device = shader->device; + ID3D11Device2 *device = shader->device;
wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); @@ -1956,7 +1951,7 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_Release(ID3D11ComputeShader
/* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -2060,7 +2055,7 @@ static HRESULT d3d11_compute_shader_init(struct d3d11_compute_shader *shader, st } wined3d_mutex_unlock();
- ID3D11Device1_AddRef(shader->device = &device->ID3D11Device1_iface); + ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -2140,12 +2135,12 @@ static ULONG STDMETHODCALLTYPE d3d11_class_linkage_Release(ID3D11ClassLinkage *i
if (!refcount) { - ID3D11Device1 *device = class_linkage->device; + ID3D11Device2 *device = class_linkage->device;
wined3d_private_store_cleanup(&class_linkage->private_store); heap_free(class_linkage);
- ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -2239,7 +2234,7 @@ HRESULT d3d11_class_linkage_create(struct d3d_device *device, struct d3d11_class object->refcount = 1; wined3d_private_store_init(&object->private_store);
- ID3D11Device1_AddRef(object->device = &device->ID3D11Device1_iface); + ID3D11Device2_AddRef(object->device = &device->ID3D11Device2_iface);
TRACE("Created class linkage %p.\n", object); *class_linkage = object; diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index 29c6fa1beb05..f880a2374d70 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -66,7 +66,7 @@ static ULONG STDMETHODCALLTYPE d3d11_blend_state_AddRef(ID3D11BlendState *iface)
if (refcount == 1) { - ID3D11Device1_AddRef(state->device); + ID3D11Device2_AddRef(state->device); wined3d_mutex_lock(); wined3d_blend_state_incref(state->wined3d_state); wined3d_mutex_unlock(); @@ -84,13 +84,13 @@ static ULONG STDMETHODCALLTYPE d3d11_blend_state_Release(ID3D11BlendState *iface
if (!refcount) { - ID3D11Device1 *device = state->device; + ID3D11Device2 *device = state->device;
wined3d_mutex_lock(); wined3d_blend_state_decref(state->wined3d_state); wined3d_mutex_unlock();
- ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -206,7 +206,7 @@ static void STDMETHODCALLTYPE d3d10_blend_state_GetDevice(ID3D10BlendState1 *ifa
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_blend_state_GetPrivateData(ID3D10BlendState1 *iface, @@ -294,7 +294,7 @@ static const struct ID3D10BlendState1Vtbl d3d10_blend_state_vtbl = static void STDMETHODCALLTYPE d3d_blend_state_wined3d_object_destroyed(void *parent) { struct d3d_blend_state *state = parent; - struct d3d_device *device = impl_from_ID3D11Device1(state->device); + struct d3d_device *device = impl_from_ID3D11Device2(state->device);
wine_rb_remove(&device->blend_states, &state->entry); wined3d_private_store_cleanup(&state->private_store); @@ -395,7 +395,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC } wined3d_mutex_unlock();
- ID3D11Device1_AddRef(object->device = &device->ID3D11Device1_iface); + ID3D11Device2_AddRef(object->device = &device->ID3D11Device2_iface);
TRACE("Created blend state %p.\n", object); *state = object; @@ -466,7 +466,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_AddRef(ID3D11DepthStenci static void d3d_depthstencil_state_cleanup(struct d3d_depthstencil_state *state) { wined3d_private_store_cleanup(&state->private_store); - ID3D11Device1_Release(state->device); + ID3D11Device2_Release(state->device); }
static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_Release(ID3D11DepthStencilState *iface) @@ -478,7 +478,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_Release(ID3D11DepthStenc
if (!refcount) { - struct d3d_device *device = impl_from_ID3D11Device1(state->device); + struct d3d_device *device = impl_from_ID3D11Device2(state->device); wined3d_mutex_lock(); wine_rb_remove(&device->depthstencil_states, &state->entry); d3d_depthstencil_state_cleanup(state); @@ -600,7 +600,7 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDevice(ID3D10DepthSten
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_GetPrivateData(ID3D10DepthStencilState *iface, @@ -671,8 +671,7 @@ static HRESULT d3d_depthstencil_state_init(struct d3d_depthstencil_state *state, wined3d_private_store_init(&state->private_store); state->desc = *desc;
- state->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(state->device); + ID3D11Device2_AddRef(state->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -831,7 +830,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_AddRef(ID3D11RasterizerSta
if (refcount == 1) { - ID3D11Device1_AddRef(state->device); + ID3D11Device2_AddRef(state->device); wined3d_mutex_lock(); wined3d_rasterizer_state_incref(state->wined3d_state); wined3d_mutex_unlock(); @@ -849,13 +848,13 @@ static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_Release(ID3D11RasterizerSt
if (!refcount) { - ID3D11Device1 *device = state->device; + ID3D11Device2 *device = state->device;
wined3d_mutex_lock(); wined3d_rasterizer_state_decref(state->wined3d_state); wined3d_mutex_unlock();
- ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -972,7 +971,7 @@ static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDevice(ID3D10RasterizerS
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_GetPrivateData(ID3D10RasterizerState *iface, @@ -1037,7 +1036,7 @@ static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl = static void STDMETHODCALLTYPE d3d_rasterizer_state_wined3d_object_destroyed(void *parent) { struct d3d_rasterizer_state *state = parent; - struct d3d_device *device = impl_from_ID3D11Device1(state->device); + struct d3d_device *device = impl_from_ID3D11Device2(state->device);
wine_rb_remove(&device->rasterizer_states, &state->entry); wined3d_private_store_cleanup(&state->private_store); @@ -1081,7 +1080,7 @@ static HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, str return hr; }
- ID3D11Device1_AddRef(state->device = &device->ID3D11Device1_iface); + ID3D11Device2_AddRef(state->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -1194,7 +1193,7 @@ static ULONG STDMETHODCALLTYPE d3d11_sampler_state_AddRef(ID3D11SamplerState *if
if (refcount == 1) { - ID3D11Device1_AddRef(state->device); + ID3D11Device2_AddRef(state->device); wined3d_mutex_lock(); wined3d_sampler_incref(state->wined3d_sampler); wined3d_mutex_unlock(); @@ -1212,13 +1211,13 @@ static ULONG STDMETHODCALLTYPE d3d11_sampler_state_Release(ID3D11SamplerState *i
if (!refcount) { - ID3D11Device1 *device = state->device; + ID3D11Device2 *device = state->device;
wined3d_mutex_lock(); wined3d_sampler_decref(state->wined3d_sampler); wined3d_mutex_unlock();
- ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -1335,7 +1334,7 @@ static void STDMETHODCALLTYPE d3d10_sampler_state_GetDevice(ID3D10SamplerState *
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10SamplerState *iface, @@ -1400,7 +1399,7 @@ static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl = static void STDMETHODCALLTYPE d3d_sampler_wined3d_object_destroyed(void *parent) { struct d3d_sampler_state *state = parent; - struct d3d_device *device = impl_from_ID3D11Device1(state->device); + struct d3d_device *device = impl_from_ID3D11Device2(state->device);
wine_rb_remove(&device->sampler_states, &state->entry); wined3d_private_store_cleanup(&state->private_store); @@ -1494,8 +1493,7 @@ static HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3 return hr; }
- state->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(state->device); + ID3D11Device2_AddRef(state->device = &device->ID3D11Device2_iface);
return S_OK; } diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index de2378f90b0b..84cb5bdf2202 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -1236,10 +1236,6 @@ static BOOL is_d3d11_2_runtime(ID3D11Device *device) ID3D11Device2 *device2; HRESULT hr;
- /* FIXME: Wine doesn't implement required interfaces yet, but we want to test new behavior. */ - if (!strcmp(winetest_platform, "wine")) - return TRUE; - hr = ID3D11Device_QueryInterface(device, &IID_ID3D11Device2, (void **)&device2); if (SUCCEEDED(hr)) ID3D11Device2_Release(device2); diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c index 2c460b408d32..36d97415a251 100644 --- a/dlls/d3d11/texture.c +++ b/dlls/d3d11/texture.c @@ -78,7 +78,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture1d_AddRef(ID3D11Texture1D *iface)
if (refcount == 1) { - ID3D11Device1_AddRef(texture->device); + ID3D11Device2_AddRef(texture->device); wined3d_mutex_lock(); wined3d_texture_incref(texture->wined3d_texture); wined3d_mutex_unlock(); @@ -96,14 +96,14 @@ static ULONG STDMETHODCALLTYPE d3d11_texture1d_Release(ID3D11Texture1D *iface)
if (!refcount) { - ID3D11Device1 *device = texture->device; + ID3D11Device2 *device = texture->device;
wined3d_mutex_lock(); wined3d_texture_decref(texture->wined3d_texture); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -287,7 +287,7 @@ static void STDMETHODCALLTYPE d3d10_texture1d_GetDevice(ID3D10Texture1D *iface,
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_texture1d_GetPrivateData(ID3D10Texture1D *iface, @@ -510,8 +510,7 @@ HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DE } wined3d_mutex_unlock();
- texture->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(texture->device); + ID3D11Device2_AddRef(texture->device = &device->ID3D11Device2_iface);
TRACE("Created texture %p.\n", texture); *out = texture; @@ -566,7 +565,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture2d_AddRef(ID3D11Texture2D *iface)
if (refcount == 1) { - ID3D11Device1_AddRef(texture->device); + ID3D11Device2_AddRef(texture->device); wined3d_mutex_lock(); wined3d_texture_incref(texture->wined3d_texture); wined3d_mutex_unlock(); @@ -584,14 +583,14 @@ static ULONG STDMETHODCALLTYPE d3d11_texture2d_Release(ID3D11Texture2D *iface)
if (!refcount) { - ID3D11Device1 *device = texture->device; + ID3D11Device2 *device = texture->device;
wined3d_mutex_lock(); wined3d_texture_decref(texture->wined3d_texture); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -789,7 +788,7 @@ static void STDMETHODCALLTYPE d3d10_texture2d_GetDevice(ID3D10Texture2D *iface,
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_texture2d_GetPrivateData(ID3D10Texture2D *iface, @@ -1066,7 +1065,7 @@ HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DE } wined3d_mutex_unlock();
- ID3D11Device1_AddRef(texture->device = &device->ID3D11Device1_iface); + ID3D11Device2_AddRef(texture->device = &device->ID3D11Device2_iface);
TRACE("Created texture %p.\n", texture); *out = texture; @@ -1120,7 +1119,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture3d_AddRef(ID3D11Texture3D *iface)
if (refcount == 1) { - ID3D11Device1_AddRef(texture->device); + ID3D11Device2_AddRef(texture->device); wined3d_mutex_lock(); wined3d_texture_incref(texture->wined3d_texture); wined3d_mutex_unlock(); @@ -1146,14 +1145,14 @@ static ULONG STDMETHODCALLTYPE d3d11_texture3d_Release(ID3D11Texture3D *iface)
if (!refcount) { - ID3D11Device1 *device = texture->device; + ID3D11Device2 *device = texture->device;
wined3d_mutex_lock(); wined3d_texture_decref(texture->wined3d_texture); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -1287,7 +1286,7 @@ static void STDMETHODCALLTYPE d3d10_texture3d_GetDevice(ID3D10Texture3D *iface,
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_texture3d_GetPrivateData(ID3D10Texture3D *iface, @@ -1495,8 +1494,7 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi wined3d_mutex_unlock(); texture->desc.MipLevels = levels;
- texture->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(texture->device); + ID3D11Device2_AddRef(texture->device = &device->ID3D11Device2_iface);
return S_OK; } diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c index 5b3f1d02d0f5..80c4888d7821 100644 --- a/dlls/d3d11/view.c +++ b/dlls/d3d11/view.c @@ -1006,7 +1006,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_AddRef(ID3D11DepthStencil
if (refcount == 1) { - ID3D11Device1_AddRef(view->device); + ID3D11Device2_AddRef(view->device); wined3d_mutex_lock(); wined3d_rendertarget_view_incref(view->wined3d_view); wined3d_mutex_unlock(); @@ -1024,13 +1024,13 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_Release(ID3D11DepthStenci
if (!refcount) { - ID3D11Device1 *device = view->device; + ID3D11Device2 *device = view->device;
wined3d_mutex_lock(); wined3d_rendertarget_view_decref(view->wined3d_view); wined3d_mutex_unlock();
- ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -1160,7 +1160,7 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_view_GetDevice(ID3D10DepthStenc
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(view->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(view->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_view_GetPrivateData(ID3D10DepthStencilView *iface, @@ -1355,8 +1355,7 @@ static HRESULT d3d_depthstencil_view_init(struct d3d_depthstencil_view *view, st wined3d_private_store_init(&view->private_store); wined3d_mutex_unlock(); view->resource = resource; - view->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(view->device); + ID3D11Device2_AddRef(view->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -1449,7 +1448,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_AddRef(ID3D11RenderTarget
if (refcount == 1) { - ID3D11Device1_AddRef(view->device); + ID3D11Device2_AddRef(view->device); wined3d_mutex_lock(); wined3d_rendertarget_view_incref(view->wined3d_view); wined3d_mutex_unlock(); @@ -1467,13 +1466,13 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_Release(ID3D11RenderTarge
if (!refcount) { - ID3D11Device1 *device = view->device; + ID3D11Device2 *device = view->device;
wined3d_mutex_lock(); wined3d_rendertarget_view_decref(view->wined3d_view); wined3d_mutex_unlock();
- ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -1603,7 +1602,7 @@ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetDevice(ID3D10RenderTarg
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(view->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(view->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_rendertarget_view_GetPrivateData(ID3D10RenderTargetView *iface, @@ -1803,8 +1802,7 @@ static HRESULT d3d_rendertarget_view_init(struct d3d_rendertarget_view *view, st wined3d_private_store_init(&view->private_store); wined3d_mutex_unlock(); view->resource = resource; - view->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(view->device); + ID3D11Device2_AddRef(view->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -1898,7 +1896,7 @@ static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_AddRef(ID3D11ShaderRes
if (refcount == 1) { - ID3D11Device1_AddRef(view->device); + ID3D11Device2_AddRef(view->device); wined3d_mutex_lock(); wined3d_shader_resource_view_incref(view->wined3d_view); wined3d_mutex_unlock(); @@ -1916,13 +1914,13 @@ static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_Release(ID3D11ShaderRe
if (!refcount) { - ID3D11Device1 *device = view->device; + ID3D11Device2 *device = view->device;
wined3d_mutex_lock(); wined3d_shader_resource_view_decref(view->wined3d_view); wined3d_mutex_unlock();
- ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -2053,7 +2051,7 @@ static void STDMETHODCALLTYPE d3d10_shader_resource_view_GetDevice(ID3D10ShaderR
TRACE("iface %p, device %p.\n", iface, device);
- ID3D11Device1_QueryInterface(view->device, &IID_ID3D10Device, (void **)device); + ID3D11Device2_QueryInterface(view->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_shader_resource_view_GetPrivateData(ID3D10ShaderResourceView1 *iface, @@ -2304,8 +2302,7 @@ static HRESULT d3d_shader_resource_view_init(struct d3d_shader_resource_view *vi wined3d_private_store_init(&view->private_store); wined3d_mutex_unlock(); view->resource = resource; - view->device = &device->ID3D11Device1_iface; - ID3D11Device1_AddRef(view->device); + ID3D11Device2_AddRef(view->device = &device->ID3D11Device2_iface);
return S_OK; } @@ -2384,7 +2381,7 @@ static ULONG STDMETHODCALLTYPE d3d11_unordered_access_view_AddRef(ID3D11Unordere
if (refcount == 1) { - ID3D11Device1_AddRef(view->device); + ID3D11Device2_AddRef(view->device); wined3d_mutex_lock(); wined3d_unordered_access_view_incref(view->wined3d_view); wined3d_mutex_unlock(); @@ -2402,13 +2399,13 @@ static ULONG STDMETHODCALLTYPE d3d11_unordered_access_view_Release(ID3D11Unorder
if (!refcount) { - ID3D11Device1 *device = view->device; + ID3D11Device2 *device = view->device;
wined3d_mutex_lock(); wined3d_unordered_access_view_decref(view->wined3d_view); wined3d_mutex_unlock();
- ID3D11Device1_Release(device); + ID3D11Device2_Release(device); }
return refcount; @@ -2614,7 +2611,7 @@ static HRESULT d3d11_unordered_access_view_init(struct d3d11_unordered_access_vi wined3d_private_store_init(&view->private_store); wined3d_mutex_unlock(); view->resource = resource; - ID3D11Device1_AddRef(view->device = &device->ID3D11Device1_iface); + ID3D11Device2_AddRef(view->device = &device->ID3D11Device2_iface);
return S_OK; }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 71 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 84cb5bdf2202..1808d70cd0b9 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -19825,9 +19825,10 @@ static void test_sm5_bufinfo_instruction(void) static void test_sampleinfo_instruction(void) { ID3D11Texture2D *float_rt_texture, *uint_rt_texture; - ID3D11RenderTargetView *float_rtv, *uint_rtv; + ID3D11RenderTargetView *float_rtv, *uint_rtv, *rtv; + ID3D11PixelShader *ps_float, *ps_uint, *ps_rt; + ID3D11Texture2D *texture, *readback_texture; struct d3d11_test_context test_context; - ID3D11PixelShader *ps_float, *ps_uint; unsigned int sample_count, quality; D3D11_TEXTURE2D_DESC texture_desc; ID3D11RenderTargetView *rtvs[2]; @@ -19835,7 +19836,6 @@ static void test_sampleinfo_instruction(void) ID3D11DeviceContext *context; struct uvec4 expected_uint; struct vec4 expected_float; - ID3D11Resource *texture; ID3D11Device *device; HRESULT hr;
@@ -19878,6 +19878,21 @@ static void test_sampleinfo_instruction(void) 0x0100086a, 0x04002058, 0x00107000, 0x00000000, 0x00005555, 0x03000065, 0x001020f2, 0x00000000, 0x0500006f, 0x001020f2, 0x00000000, 0x0010700a, 0x00000000, 0x0100003e, }; + static const DWORD ps_rt_code[] = + { +#if 0 + float4 main() : SV_Target + { + return GetRenderTargetSampleCount(); + } +#endif + 0x43425844, 0x74404d37, 0xad6f88e4, 0xb006ea57, 0xf07d9e2a, 0x00000001, 0x000000a4, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000002c, 0x00000050, 0x0000000b, + 0x0100086a, 0x03000065, 0x001020f2, 0x00000000, 0x0400006f, 0x001020f2, 0x00000000, 0x0000e00a, + 0x0100003e, + }; static const D3D_FEATURE_LEVEL feature_level = D3D_FEATURE_LEVEL_11_0;
if (!init_test_context(&test_context, &feature_level)) @@ -19947,16 +19962,64 @@ static void test_sampleinfo_instruction(void) expected_uint.x = expected_uint.y = expected_uint.z = expected_uint.w = sample_count; check_texture_uvec4(uint_rt_texture, &expected_uint);
- ID3D11Resource_Release(texture); + ID3D11Texture2D_Release(texture); ID3D11ShaderResourceView_Release(srv); }
+ hr = ID3D11Device_CreatePixelShader(device, ps_rt_code, sizeof(ps_rt_code), NULL, &ps_rt); + ok(hr == S_OK, "Failed to create pixel shader, hr %#x.\n", hr); + ID3D11DeviceContext_PSSetShader(context, ps_rt, NULL, 0); + for (sample_count = 1; sample_count <= 8; sample_count *= 2) + { + texture_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + texture_desc.SampleDesc.Count = sample_count; + texture_desc.BindFlags = D3D11_BIND_RENDER_TARGET; + + hr = ID3D11Device_CheckMultisampleQualityLevels(device, texture_desc.Format, sample_count, &quality); + ok(hr == S_OK, "Failed to check multisample quality levels, hr %#x.\n", hr); + if (!quality) + { + skip("Sample count %u not supported.\n", sample_count); + continue; + } + + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D11Texture2D **)&texture); + ok(hr == S_OK, "Failed to create texture, hr %#x, sample count %u.\n", hr, sample_count); + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)texture, NULL, &rtv); + ok(hr == S_OK, "Failed to create render target view, hr %#x.\n", hr); + ID3D11DeviceContext_OMSetRenderTargets(context, 1, &rtv, NULL); + + draw_quad(&test_context); + + if (sample_count != 1) + { + texture_desc.SampleDesc.Count = 1; + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &readback_texture); + ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr); + ID3D11DeviceContext_ResolveSubresource(context, (ID3D11Resource *)readback_texture, 0, + (ID3D11Resource *)texture, 0, texture_desc.Format); + } + else + { + readback_texture = texture; + ID3D11Texture2D_AddRef(readback_texture); + } + + expected_float.x = expected_float.y = expected_float.z = expected_float.w = sample_count; + check_texture_vec4(readback_texture, &expected_float, 0); + + ID3D11Texture2D_Release(readback_texture); + ID3D11Texture2D_Release(texture); + ID3D11RenderTargetView_Release(rtv); + } + ID3D11RenderTargetView_Release(float_rtv); ID3D11RenderTargetView_Release(uint_rtv); ID3D11Texture2D_Release(float_rt_texture); ID3D11Texture2D_Release(uint_rt_texture); ID3D11PixelShader_Release(ps_float); ID3D11PixelShader_Release(ps_uint); + ID3D11PixelShader_Release(ps_rt); release_test_context(&test_context); }
On 16 May 2018 at 14:25, Józef Kucia jkucia@codeweavers.com wrote:
Signed-off-by: Józef Kucia jkucia@codeweavers.com
dlls/d3d11/tests/d3d11.c | 71 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 4 deletions(-)
Unfortunately this fails here on Windows:
d3d11.c:1194: Adapter: L"AMD Radeon HD 6310 Graphics", 1002:9802. d3d11.c:1613: Feature level 0xb000. d3d11.c:8194: Tests skipped: Some AMD drivers have a bug affecting the test. d3d11.c:15598: Compute shader support via SM4 0x1. d3d11.c:17004: Optional format 0x59 - display supported, feature level 0xa100. d3d11.c:17004: Optional format 0x59 - display supported, feature level 0xa000. d3d11.c:19982: Tests skipped: Sample count 8 not supported. d3d11.c:20046: Test failed: Got {1.00000000e+000, 1.00000000e+000, 1.00000000e+000, 1.00000000e+000}, expected {2.00000000e+000, 2.00000000e+000, 2.00000000e+000, 2.00000000e+000} at (0, 0), sub-resource 0. d3d11.c:20046: Test failed: Got {2.00000000e+000, 2.00000000e+000, 2.00000000e+000, 2.00000000e+000}, expected {4.00000000e+000, 4.00000000e+000, 4.00000000e+000, 4.00000000e+000} at (0, 0), sub-resource 0. d3d11.c:20019: Tests skipped: Sample count 8 not supported. d3d11.c:20605: Tests skipped: Feature level 11_0 required for unaligned UAV test. d3d11.c:20605: Tests skipped: Feature level 11_0 required for unaligned UAV test. 04e4:d3d11: 9358928 tests executed (0 marked as todo, 2 failures), 5 skipped.
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 1808d70cd0b9..b1abae3844ea 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -26217,7 +26217,8 @@ static void test_alpha_to_coverage(void) ID3D11Texture2D_GetDesc(test_context.backbuffer, &texture_desc); hr = ID3D11Device_CheckMultisampleQualityLevels(device, texture_desc.Format, 4, &quality_level_count); - if (FAILED(hr)) + ok(hr == S_OK, "Failed to check multisample quality levels, hr %#x.\n", hr); + if (!quality_level_count) { skip("4xMSAA not supported.\n"); goto done; @@ -26736,8 +26737,9 @@ static void test_multisample_resolve(void) device = test_context.device; context = test_context.immediate_context;
- if (FAILED(hr = ID3D11Device_CheckMultisampleQualityLevels(device, - DXGI_FORMAT_R8G8B8A8_TYPELESS, 4, &i))) + hr = ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_TYPELESS, 4, &i); + ok(hr == S_OK, "Failed to check multisample quality levels, hr %#x.\n", hr); + if (!i) { skip("4xMSAA not supported.\n"); release_test_context(&test_context);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d10core/tests/device.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index be09f44c03cd..4b39c1be2561 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -16281,7 +16281,8 @@ static void test_alpha_to_coverage(void) ID3D10Texture2D_GetDesc(test_context.backbuffer, &texture_desc); hr = ID3D10Device_CheckMultisampleQualityLevels(device, texture_desc.Format, 4, &quality_level_count); - if (FAILED(hr)) + ok(hr == S_OK, "Failed to check multisample quality levels, hr %#x.\n", hr); + if (!quality_level_count) { skip("4xMSAA not supported.\n"); goto done; @@ -16794,8 +16795,9 @@ static void test_multisample_resolve(void) return; device = test_context.device;
- if (FAILED(hr = ID3D10Device_CheckMultisampleQualityLevels(device, - DXGI_FORMAT_R8G8B8A8_TYPELESS, 4, &i))) + hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_TYPELESS, 4, &i); + ok(hr == S_OK, "Failed to check multisample quality levels, hr %#x.\n", hr); + if (!i) { skip("4xMSAA not supported.\n"); release_test_context(&test_context);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=38442
Your paranoid android.
=== wvistau64_fr (32 bit device) === device.c:4454: Test failed: Got unexpected IAVertices count: 0. device.c:4455: Test failed: Got unexpected IAPrimitives count: 0. device.c:4456: Test failed: Got unexpected VSInvocations count: 0. device.c:4459: Test failed: Got unexpected CInvocations count: 0. device.c:4460: Test failed: Got unexpected CPrimitives count: 0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com