Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- v2: Don't worry about restricting based on feature level; just add todo_wine to the relevant tests instead. (Also remove my test hacks...)
dlls/d3d11/device.c | 1 + dlls/d3d11/tests/d3d11.c | 10 ++++++---- dlls/wined3d/directx.c | 6 +++++- 3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 4733f6cf249..00fcff834f6 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3747,6 +3747,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 f59e9e99f1f..a54715e349e 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -20699,8 +20699,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; }
@@ -20712,8 +20713,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 --- v2: Set the format flag on the wined3d side.
dlls/d3d11/device.c | 1 + dlls/d3d11/tests/d3d11.c | 4 ++-- dlls/wined3d/directx.c | 5 ++++- dlls/wined3d/utils.c | 4 ++-- dlls/wined3d/wined3d_private.h | 1 + 5 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 00fcff834f6..8bf42c1a88a 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3748,6 +3748,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 a54715e349e..66dca5ee9d9 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -20699,7 +20699,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; @@ -20713,7 +20713,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 ef2e28b545a..15605853da7 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -1673,7 +1673,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_UINT, GL_R32UI, GL_R32UI, 0, GL_RED_INTEGER, GL_UNSIGNED_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_INDEX_BUFFER, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_SINT, GL_R32I, GL_R32I, 0, GL_RED_INTEGER, GL_INT, 0, @@ -1686,7 +1686,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UINT, GL_R16UI, GL_R16UI, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_INDEX_BUFFER, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_SINT, GL_R16I, GL_R16I, 0, GL_RED_INTEGER, GL_SHORT, 0, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 5fa51a844ac..91a27d3d4ce 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5950,6 +5950,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=103880
Your paranoid android.
=== w1064 (32 bit report) ===
d3d11: d3d11.c:5920: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5921: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5922: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5925: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5926: Test failed: Got unexpected CPrimitives count: 0.
=== w10pro64 (32 bit report) ===
d3d11: d3d11.c:5920: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5921: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5922: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5925: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5926: Test failed: Got unexpected CPrimitives count: 0.
On Fri, 10 Dec 2021 at 20:32, Zebediah Figura zfigura@codeweavers.com wrote:
This fixes a black screen in The Unfinished Swan.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
v2: Set the format flag on the wined3d side.
dlls/d3d11/device.c | 1 + dlls/d3d11/tests/d3d11.c | 4 ++-- dlls/wined3d/directx.c | 5 ++++- dlls/wined3d/utils.c | 4 ++-- dlls/wined3d/wined3d_private.h | 1 + 5 files changed, 10 insertions(+), 5 deletions(-)
Like the previous patch in the series, this causes issues in the corresponding d3d10core tests.
@@ -1673,7 +1673,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_UINT, GL_R32UI, GL_R32UI, 0, GL_RED_INTEGER, GL_UNSIGNED_INT, 0,
WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET,
{WINED3DFMT_R32_SINT, GL_R32I, GL_R32I, 0, GL_RED_INTEGER, GL_INT, 0,WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_INDEX_BUFFER, ARB_TEXTURE_RG, NULL},
@@ -1686,7 +1686,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UINT, GL_R16UI, GL_R16UI, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, 0,
WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET,
{WINED3DFMT_R16_SINT, GL_R16I, GL_R16I, 0, GL_RED_INTEGER, GL_SHORT, 0,WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_INDEX_BUFFER, ARB_TEXTURE_RG, NULL},
I think it's a little ugly to set this flag using the format_texture_info[] array. Using format_base_flags[] seems more appropriate, and would have the advantage of working with the Vulkan backend as well.
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=103879
Your paranoid android.
=== w1064v1809 (32 bit report) ===
d3d11: d3d11.c:5920: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5921: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5922: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5925: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5926: Test failed: Got unexpected CPrimitives count: 0.
=== w1064 (32 bit report) ===
d3d11: d3d11.c:5920: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5921: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5922: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5925: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5926: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:5765: Test failed: Got unexpected query result 0x0000000000000000.
=== w10pro64 (32 bit report) ===
d3d11: d3d11.c:5920: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5921: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5922: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5925: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5926: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:5765: Test failed: Got unexpected query result 0x0000000000000000.
=== debiant2 (32 bit report) ===
d3d11: d3d11.c:9770: Test failed: Got hr 0, expected 0x80070057 (feature level 0x9200, format 0x18).
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:9770: Test failed: Got hr 0 for WRITE_DISCARD.
On Fri, 10 Dec 2021 at 20:16, Zebediah Figura zfigura@codeweavers.com wrote:
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
v2: Don't worry about restricting based on feature level; just add todo_wine to the relevant tests instead. (Also remove my test hacks...)
dlls/d3d11/device.c | 1 + dlls/d3d11/tests/d3d11.c | 10 ++++++---- dlls/wined3d/directx.c | 6 +++++- 3 files changed, 12 insertions(+), 5 deletions(-)
This is causing the corresponding d3d10core tests to succeed inside a todo block.