From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/d3d11/tests/d3d11.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 3e9ccc42e33..76884a7e787 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -19687,6 +19687,7 @@ static void test_null_sampler(void)
static void test_check_feature_support(void) { + D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT d3d9si; D3D11_FEATURE_DATA_THREADING threading[2]; D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS hwopts; D3D11_FEATURE_DATA_ARCHITECTURE_INFO archinfo; @@ -19755,6 +19756,10 @@ static void test_check_feature_support(void) ok(hr == E_INVALIDARG /* Not available on all Windows versions but they will return E_INVALIDARG anyways. */, "Got unexpected hr %#lx.\n", hr);
+ hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT, &d3d9si, sizeof(d3d9si)); + todo_wine + ok(hr == S_OK || broken(hr == E_INVALIDARG) /* Win 7 */, "Got unexpected hr %#lx.\n", hr); + refcount = ID3D11Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); }
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/d3d11/device.c | 22 ++++++++++++++++++++++ dlls/d3d11/tests/d3d11.c | 1 - dlls/wined3d/adapter_gl.c | 1 + dlls/wined3d/adapter_vk.c | 1 + dlls/wined3d/directx.c | 1 + dlls/wined3d/wined3d_private.h | 1 + include/wine/wined3d.h | 7 ++++--- 7 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 2c6e4f4654c..5c819f4e983 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -4783,6 +4783,28 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device2 return d3d11_device_CheckFormatSupport(iface, data->InFormat, &data->OutFormatSupport); }
+ case D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT: + { + D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT *data = feature_support_data; + if (feature_support_data_size != sizeof(*data)) + { + WARN("Invalid size %u for D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT.\n", feature_support_data_size); + return E_INVALIDARG; + } + + wined3d_mutex_lock(); + hr = wined3d_device_get_device_caps(device->wined3d_device, &wined3d_caps); + wined3d_mutex_unlock(); + if (FAILED(hr)) + { + WARN("Failed to get device caps, hr %#lx.\n", hr); + return hr; + } + + data->SimpleInstancingSupported = wined3d_caps.simple_instancing; + return S_OK; + } + default: FIXME("Unhandled feature %#x.\n", feature); return E_NOTIMPL; diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 76884a7e787..8436e2a1ef5 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -19757,7 +19757,6 @@ static void test_check_feature_support(void) "Got unexpected hr %#lx.\n", hr);
hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT, &d3d9si, sizeof(d3d9si)); - todo_wine ok(hr == S_OK || broken(hr == E_INVALIDARG) /* Win 7 */, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D11Device_Release(device); diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 6c31acac7b8..0c90f67dcda 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4922,6 +4922,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_ d3d_info->shader_output_interpolation = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION); d3d_info->viewport_array_index_any_shader = !!gl_info->supported[ARB_SHADER_VIEWPORT_LAYER_ARRAY]; d3d_info->stencil_export = !!gl_info->supported[ARB_SHADER_STENCIL_EXPORT]; + d3d_info->simple_instancing = !!gl_info->supported[ARB_INSTANCED_ARRAYS]; d3d_info->unconditional_npot = !!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]; d3d_info->draw_base_vertex_offset = !!gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]; d3d_info->vertex_bgra = !!gl_info->supported[ARB_VERTEX_ARRAY_BGRA]; diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 60546d86597..851f5415b7a 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -2294,6 +2294,7 @@ static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter_vk *adapter_ d3d_info->shader_output_interpolation = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION); d3d_info->viewport_array_index_any_shader = false; /* VK_EXT_shader_viewport_index_layer */ d3d_info->stencil_export = vk_info->supported[WINED3D_VK_EXT_SHADER_STENCIL_EXPORT]; + d3d_info->simple_instancing = true; d3d_info->unconditional_npot = true; d3d_info->draw_base_vertex_offset = true; d3d_info->vertex_bgra = true; diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index dfda5751e98..dfe6b35ed0a 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2766,6 +2766,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d_adapter *adapter, caps->shader_double_precision = d3d_info->shader_double_precision; caps->viewport_array_index_any_shader = d3d_info->viewport_array_index_any_shader; caps->stencil_export = d3d_info->stencil_export; + caps->simple_instancing = d3d_info->simple_instancing;
caps->max_feature_level = d3d_info->feature_level;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7f482ebc203..8b27d37c086 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -225,6 +225,7 @@ struct wined3d_d3d_info uint32_t shader_double_precision : 1; uint32_t shader_output_interpolation : 1; uint32_t viewport_array_index_any_shader : 1; + uint32_t simple_instancing : 1; uint32_t stencil_export : 1; /* If zero, only conditional NPOT textures are supported, via * WINED3D_GL_NORMALIZED_TEXRECT. */ diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9a1fc0d8cbc..871d61fcde3 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -1998,9 +1998,10 @@ struct wined3d_caps
struct wined3d_ddraw_caps ddraw_caps;
- BOOL shader_double_precision; - BOOL viewport_array_index_any_shader; - BOOL stencil_export; + bool shader_double_precision; + bool viewport_array_index_any_shader; + bool stencil_export; + bool simple_instancing;
enum wined3d_feature_level max_feature_level; };
This merge request was approved by Elizabeth Figura.
This merge request was approved by Jan Sikorski.