Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/d3d10core/tests/d3d10core.c | 2 +- dlls/d3d11/device.c | 1 + dlls/d3d11/tests/d3d11.c | 10 ++++++---- dlls/wined3d/directx.c | 6 +++++- 4 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index 5caaaa73255..937627fde38 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -13688,7 +13688,7 @@ static void check_format_support(const unsigned int *format_support, continue; }
- todo_wine + todo_wine_if (feature_flag != D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER) ok(supported, "Format %#x - %s supported, format support %#x.\n", format, feature_name, format_support[format]); } diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 5a46f26e459..7cd1d018513 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3757,6 +3757,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * flag_mapping[] = { {WINED3D_RTYPE_BUFFER, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_BUFFER}, + {WINED3D_RTYPE_BUFFER, WINED3D_BIND_VERTEX_BUFFER, 0, D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER}, {WINED3D_RTYPE_TEXTURE_1D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE1D}, {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE2D}, {WINED3D_RTYPE_TEXTURE_3D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE3D}, diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 1aa5b92288d..4d531f815b5 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -20756,8 +20756,9 @@ static void check_format_support(const unsigned int *format_support, D3D_FEATURE
if (formats[i].fl_required <= feature_level) { - todo_wine ok(supported, "Format %#x - %s not supported, feature_level %#x, format support %#x.\n", - format, feature_name, feature_level, format_support[format]); + todo_wine_if (feature_flag != D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER) + ok(supported, "Format %#x - %s not supported, feature_level %#x, format support %#x.\n", + format, feature_name, feature_level, format_support[format]); continue; }
@@ -20769,8 +20770,9 @@ static void check_format_support(const unsigned int *format_support, D3D_FEATURE continue; }
- ok(!supported, "Format %#x - %s supported, feature level %#x, format support %#x.\n", - format, feature_name, feature_level, format_support[format]); + todo_wine_if (feature_flag == D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER) + ok(!supported, "Format %#x - %s supported, feature level %#x, format support %#x.\n", + format, feature_name, feature_level, format_support[format]); } }
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index b2925eb97e9..334a520072d 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1821,7 +1821,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d,
allowed_usage = WINED3DUSAGE_DYNAMIC; allowed_bind_flags = WINED3D_BIND_SHADER_RESOURCE - | WINED3D_BIND_UNORDERED_ACCESS; + | WINED3D_BIND_UNORDERED_ACCESS + | WINED3D_BIND_VERTEX_BUFFER; gl_type = gl_type_end = WINED3D_GL_RES_TYPE_BUFFER; break;
@@ -1853,6 +1854,9 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, format_flags |= WINED3DFMT_FLAG_DEPTH_STENCIL; if (bind_flags & WINED3D_BIND_UNORDERED_ACCESS) format_flags |= WINED3DFMT_FLAG_UNORDERED_ACCESS; + if (bind_flags & WINED3D_BIND_VERTEX_BUFFER) + format_flags |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; + if (usage & WINED3DUSAGE_QUERY_FILTER) format_flags |= WINED3DFMT_FLAG_FILTERING; if (usage & WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING)
This fixes a black screen in The Unfinished Swan.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/d3d10core/tests/d3d10core.c | 2 +- dlls/d3d11/device.c | 1 + dlls/d3d11/tests/d3d11.c | 4 ++-- dlls/wined3d/directx.c | 5 ++++- dlls/wined3d/utils.c | 3 ++- dlls/wined3d/wined3d_private.h | 1 + 6 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index 937627fde38..62d94834287 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -13688,7 +13688,7 @@ static void check_format_support(const unsigned int *format_support, continue; }
- todo_wine_if (feature_flag != D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER) + todo_wine_if (feature_flag == D3D11_FORMAT_SUPPORT_DISPLAY) ok(supported, "Format %#x - %s supported, format support %#x.\n", format, feature_name, format_support[format]); } diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 7cd1d018513..b7e17e1efd9 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3758,6 +3758,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * { {WINED3D_RTYPE_BUFFER, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_BUFFER}, {WINED3D_RTYPE_BUFFER, WINED3D_BIND_VERTEX_BUFFER, 0, D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER}, + {WINED3D_RTYPE_BUFFER, WINED3D_BIND_INDEX_BUFFER, 0, D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER}, {WINED3D_RTYPE_TEXTURE_1D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE1D}, {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE2D}, {WINED3D_RTYPE_TEXTURE_3D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE3D}, diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 4d531f815b5..d1ffbe64f0b 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -20756,7 +20756,7 @@ static void check_format_support(const unsigned int *format_support, D3D_FEATURE
if (formats[i].fl_required <= feature_level) { - todo_wine_if (feature_flag != D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER) + todo_wine_if (feature_flag == D3D11_FORMAT_SUPPORT_DISPLAY) ok(supported, "Format %#x - %s not supported, feature_level %#x, format support %#x.\n", format, feature_name, feature_level, format_support[format]); continue; @@ -20770,7 +20770,7 @@ static void check_format_support(const unsigned int *format_support, D3D_FEATURE continue; }
- todo_wine_if (feature_flag == D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER) + todo_wine_if (feature_flag != D3D11_FORMAT_SUPPORT_DISPLAY) ok(!supported, "Format %#x - %s supported, feature level %#x, format support %#x.\n", format, feature_name, feature_level, format_support[format]); } diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 334a520072d..1b34d2eceaa 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1822,7 +1822,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, allowed_usage = WINED3DUSAGE_DYNAMIC; allowed_bind_flags = WINED3D_BIND_SHADER_RESOURCE | WINED3D_BIND_UNORDERED_ACCESS - | WINED3D_BIND_VERTEX_BUFFER; + | WINED3D_BIND_VERTEX_BUFFER + | WINED3D_BIND_INDEX_BUFFER; gl_type = gl_type_end = WINED3D_GL_RES_TYPE_BUFFER; break;
@@ -1856,6 +1857,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, format_flags |= WINED3DFMT_FLAG_UNORDERED_ACCESS; if (bind_flags & WINED3D_BIND_VERTEX_BUFFER) format_flags |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; + if (bind_flags & WINED3D_BIND_INDEX_BUFFER) + format_flags |= WINED3DFMT_FLAG_INDEX_BUFFER;
if (usage & WINED3DUSAGE_QUERY_FILTER) format_flags |= WINED3DFMT_FLAG_FILTERING; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 69c73487240..e50d42ead92 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -345,8 +345,9 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_R32G32_SINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, {WINED3DFMT_R32_TYPELESS, WINED3DFMT_FLAG_CAST_TO_BLOCK}, {WINED3DFMT_R32_FLOAT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_UINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32_UINT, WINED3DFMT_FLAG_CAST_TO_BLOCK | WINED3DFMT_FLAG_INDEX_BUFFER}, {WINED3DFMT_R32_SINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16_UINT, WINED3DFMT_FLAG_INDEX_BUFFER}, };
static void rgb888_from_rgb565(WORD rgb565, BYTE *r, BYTE *g, BYTE *b) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c9d83b3fbc7..6cdade61a3a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5955,6 +5955,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_BLIT 0x02000000 #define WINED3DFMT_FLAG_MAPPABLE 0x04000000 #define WINED3DFMT_FLAG_CAST_TO_BLOCK 0x08000000 +#define WINED3DFMT_FLAG_INDEX_BUFFER 0x10000000
struct wined3d_rational {
Hi,
While running your changed tests, 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=105599
Your paranoid android.
=== w10pro64 (32 bit report) ===
d3d10core: d3d10core.c:4657: Test failed: Got unexpected query result 0x0000000000000000.
=== debian11 (32 bit German report) ===
d3d11: d3d11.c:28261: Test failed: d3d11.c:16485: Test marked todo: Got 0xdeadbeef, expected 0 or 0 at 0, uvec4 0, 0, 0, 0. d3d11.c:20171: Test failed: d3d11.c:16492: Test marked todo: Got 0xdeadbeef, expected 0xeff0f1f2 or 0x80808080 at 128, uvec4 0x800000f2, 0x800000f1, 0x800000f0, 0x800000ef.
=== debian11 (32 bit French report) ===
d3d11: d3d11.c:9827: Test failed: d3d11.c:15234: Test marked todo: Got hr 0 for WRITE_DISCARD. d3d11.c:20171: Test failed: d3d11.c:16492: Test marked todo: Got 0xdeadbeef, expected 0x7b7a7773 or 0x80808080 at 128, uvec4 0x80000073, 0x80000077, 0x8000007a, 0x8000007b.
=== debian11 (32 bit Hebrew:Israel report) ===
d3d11: d3d11.c:28261: Test failed: d3d11.c:16485: Test marked todo: Got 0xdeadbeef, expected 0xfff0e0d0 or 0x7f7f7f7f at 127, uvec4 0xd0, 0xe0, 0xf0, 0xff.
=== debian11 (32 bit Japanese:Japan report) ===
d3d11: d3d11.c:9827: Test failed: d3d11.c:15212: Test marked todo: Got hr 0 for WRITE_DISCARD. d3d11.c:9827: Test failed: d3d11.c:15303: Test marked todo: Got hr 0 for WRITE.
=== debian11 (64 bit WoW report) ===
d3d11: d3d11.c:20171: Test failed: Got {0x80000000, 0x00000000, 0x00000000, 0x00000000}, expected {0x00000000, 0xffffffff, 0x00000000, 0x00000000} at (0, 0), sub-resource 0. d3d11.c:20171: Test failed: Got {0x00000000, 0x80000000, 0x00000000, 0x00000000}, expected {0xffffffff, 0x00000000, 0x00000000, 0x00000000} at (0, 0), sub-resource 0. d3d11.c:20171: Test failed: Got {0xffffffff, 0x00000001, 0x00000000, 0x00000000}, expected {0x00000000, 0x00000001, 0x00000000, 0x00000000} at (0, 0), sub-resource 0. d3d11.c:20171: Test failed: Got {0x00000001, 0xffffffff, 0x00000000, 0x00000000}, expected {0x00000001, 0x00000000, 0x00000000, 0x00000000} at (0, 0), sub-resource 0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, 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=105598
Your paranoid android.
=== debian11 (32 bit report) ===
d3d11: d3d11.c:28261: Test failed: Got texcoord {7.51953065e-001, 2.48046935e-001}, expected {7.51953125e-001, 2.48046875e-001} at (3, 3), offset 4.92187500e-001.
=== debian11 (32 bit Hebrew:Israel report) ===
d3d11: d3d11.c:9827: Test failed: d3d11.c:15502: Test marked todo: Test 60: Got unexpected color 0xff000000 at (2, 1).
=== debian11 (32 bit Hindi:India report) ===
d3d11: d3d11.c:9827: Test failed: d3d11.c:15212: Test marked todo: d3d11.c:15212: Test marked todo: Got hr 0 for WRITE.
=== debian11 (32 bit Japanese:Japan report) ===
d3d10core: d3d10core: Timeout
=== debian11 (64 bit WoW report) ===
d3d11: d3d11.c:9827: Test failed: d3d11.c:15212: Test marked todo: Got hr 0 for WRITE_DISCARD.