From: Lucian Poston Subject: [PATCH 2/2] d3d11: Return valid values for shader class instances Message-Id: <20171123175850.9665-2-lucian.poston@gmail.com> Date: Thu, 23 Nov 2017 09:58:50 -0800 In-Reply-To: <20171123175850.9665-1-lucian.poston@gmail.com> References: <20171123175850.9665-1-lucian.poston@gmail.com> Instead of returning garbage data for class instances, return 0 class instances. https://bugs.winehq.org/show_bug.cgi?id=44052 Signed-off-by: Lucian Poston --- dlls/d3d11/device.c | 12 ++++++++++++ dlls/d3d11/tests/d3d11.c | 6 ------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 7a8f3df5a2..aa9c6d9854 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1488,6 +1488,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetShader(ID3D11DeviceCo if (class_instances || class_instance_count) FIXME("Dynamic linking not implemented yet.\n"); + if (class_instance_count) + *class_instance_count = 0; wined3d_mutex_lock(); if (!(wined3d_shader = wined3d_device_get_pixel_shader(device->wined3d_device))) @@ -1543,6 +1545,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetShader(ID3D11DeviceCo if (class_instances || class_instance_count) FIXME("Dynamic linking not implemented yet.\n"); + if (class_instance_count) + *class_instance_count = 0; wined3d_mutex_lock(); if (!(wined3d_shader = wined3d_device_get_vertex_shader(device->wined3d_device))) @@ -1711,6 +1715,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShader(ID3D11DeviceCo if (class_instances || class_instance_count) FIXME("Dynamic linking not implemented yet.\n"); + if (class_instance_count) + *class_instance_count = 0; wined3d_mutex_lock(); if (!(wined3d_shader = wined3d_device_get_geometry_shader(device->wined3d_device))) @@ -2137,6 +2143,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetShader(ID3D11DeviceCo if (class_instances || class_instance_count) FIXME("Dynamic linking not implemented yet.\n"); + if (class_instance_count) + *class_instance_count = 0; wined3d_mutex_lock(); if (!(wined3d_shader = wined3d_device_get_hull_shader(device->wined3d_device))) @@ -2244,6 +2252,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetShader(ID3D11DeviceCo if (class_instances || class_instance_count) FIXME("Dynamic linking not implemented yet.\n"); + if (class_instance_count) + *class_instance_count = 0; wined3d_mutex_lock(); if (!(wined3d_shader = wined3d_device_get_domain_shader(device->wined3d_device))) @@ -2376,6 +2386,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetShader(ID3D11DeviceCo if (class_instances || class_instance_count) FIXME("Dynamic linking not implemented yet.\n"); + if (class_instance_count) + *class_instance_count = 0; wined3d_mutex_lock(); if (!(wined3d_shader = wined3d_device_get_compute_shader(device->wined3d_device))) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 615d7c1096..5567b4b88d 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -8656,7 +8656,6 @@ static void test_clear_state(void) instance_count = 100; ID3D11DeviceContext_VSGetShader(context, &tmp_vs, NULL, &instance_count); ok(!tmp_vs, "Got unexpected vertex shader %p.\n", tmp_vs); - todo_wine ok(instance_count == 0, "Expected 0 instances, got %u.\n", instance_count); ID3D11DeviceContext_HSGetConstantBuffers(context, 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, @@ -8678,7 +8677,6 @@ static void test_clear_state(void) instance_count = 100; ID3D11DeviceContext_HSGetShader(context, &tmp_hs, NULL, &instance_count); ok(!tmp_hs, "Got unexpected hull shader %p.\n", tmp_hs); - todo_wine ok(instance_count == 0, "Expected 0 instances, got %u.\n", instance_count); ID3D11DeviceContext_DSGetConstantBuffers(context, 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, @@ -8700,7 +8698,6 @@ static void test_clear_state(void) instance_count = 100; ID3D11DeviceContext_DSGetShader(context, &tmp_ds, NULL, &instance_count); ok(!tmp_ds, "Got unexpected domain shader %p.\n", tmp_ds); - todo_wine ok(instance_count == 0, "Expected 0 instances, got %u.\n", instance_count); ID3D11DeviceContext_GSGetConstantBuffers(context, 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, @@ -8722,7 +8719,6 @@ static void test_clear_state(void) instance_count = 100; ID3D11DeviceContext_GSGetShader(context, &tmp_gs, NULL, &instance_count); ok(!tmp_gs, "Got unexpected geometry shader %p.\n", tmp_gs); - todo_wine ok(instance_count == 0, "Expected 0 instances, got %u.\n", instance_count); ID3D11DeviceContext_PSGetConstantBuffers(context, 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, @@ -8745,7 +8741,6 @@ static void test_clear_state(void) instance_count = 100; ID3D11DeviceContext_PSGetShader(context, &tmp_ps, NULL, &instance_count); ok(!tmp_ps, "Got unexpected pixel shader %p.\n", tmp_ps); - todo_wine ok(instance_count == 0, "Expected 0 instances, got %u.\n", instance_count); ID3D11DeviceContext_CSGetConstantBuffers(context, 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, @@ -8768,7 +8763,6 @@ static void test_clear_state(void) instance_count = 100; ID3D11DeviceContext_CSGetShader(context, &tmp_cs, NULL, &instance_count); ok(!tmp_cs, "Got unexpected compute shader %p.\n", tmp_cs); - todo_wine ok(instance_count == 0, "Expected 0 instances, got %u.\n", instance_count); ID3D11DeviceContext_CSGetUnorderedAccessViews(context, 0, D3D11_PS_CS_UAV_REGISTER_COUNT, tmp_uav); for (i = 0; i < D3D11_PS_CS_UAV_REGISTER_COUNT; ++i) -- 2.13.6