This is not a regression, and probably not a visible bug fix either. On the other hand, it is a clear bug fix, and a relatively safe one as well. I don't know whether it makes more sense to defer this until after code freeze.
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/d3d11/tests/d3d11.c | 192 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 1f6b211f693..0a54ff03f0f 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -34725,6 +34725,197 @@ static void test_rtv_depth_slice(void) release_test_context(&test_context); }
+static void test_vertex_formats(void) +{ + struct d3d11_test_context test_context; + ID3D11DeviceContext *context; + ID3D11RenderTargetView *rtv; + ID3D11Device *device; + ID3D11Texture2D *rt; + unsigned int i; + HRESULT hr; + + static const D3D11_TEXTURE2D_DESC rt_desc = + { + .Width = 4, + .Height = 4, + .MipLevels = 1, + .ArraySize = 1, + .Format = DXGI_FORMAT_R32G32B32A32_FLOAT, + .SampleDesc.Count = 1, + .Usage = D3D11_USAGE_DEFAULT, + .BindFlags = D3D11_BIND_RENDER_TARGET, + }; + + static const struct quad + { + struct vec2 position; + unsigned int color[4]; + } + quad[] = + { + {{-1.0f, -1.0f}, {0x87654321, 0x12345678, 0xcccccccc, 0xdeadbeef}}, + {{-1.0f, 1.0f}, {0x87654321, 0x12345678, 0xcccccccc, 0xdeadbeef}}, + {{ 1.0f, -1.0f}, {0x87654321, 0x12345678, 0xcccccccc, 0xdeadbeef}}, + {{ 1.0f, 1.0f}, {0x87654321, 0x12345678, 0xcccccccc, 0xdeadbeef}}, + }; + + static const unsigned int vs_code[] = + { +#if 0 + void main(inout float4 position : sv_position, inout float4 color : COLOR) + { + } +#endif + 0x43425844, 0xc2f6fe60, 0x8a304938, 0x14c1a190, 0xe6f3e35e, 0x00000001, 0x00000144, 0x00000003, + 0x0000002c, 0x00000080, 0x000000d4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x705f7673, 0x7469736f, 0x006e6f69, 0x4f4c4f43, 0xabab0052, + 0x4e47534f, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, + 0x705f7673, 0x7469736f, 0x006e6f69, 0x4f4c4f43, 0xabab0052, 0x52444853, 0x00000068, 0x00010040, + 0x0000001a, 0x0300005f, 0x001010f2, 0x00000000, 0x0300005f, 0x001010f2, 0x00000001, 0x04000067, + 0x001020f2, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, 0x05000036, 0x001020f2, + 0x00000000, 0x00101e46, 0x00000000, 0x05000036, 0x001020f2, 0x00000001, 0x00101e46, 0x00000001, + 0x0100003e, + }; + + static const unsigned int ps_code[] = + { +#if 0 + float4 main(float4 position : sv_position, float4 color : COLOR) : sv_target + { + return color; + } +#endif + 0x43425844, 0xb9b047ca, 0x73193a19, 0xb9a919ed, 0x21c2ff5f, 0x00000001, 0x000000f4, 0x00000003, + 0x0000002c, 0x00000080, 0x000000b4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x705f7673, 0x7469736f, 0x006e6f69, 0x4f4c4f43, 0xabab0052, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x745f7673, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, + 0x0000000e, 0x03001062, 0x001010f2, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x05000036, + 0x001020f2, 0x00000000, 0x00101e46, 0x00000001, 0x0100003e, + }; + + static const struct vec4 white = {1.0f, 1.0f, 1.0f, 1.0f}; + + static const struct + { + DXGI_FORMAT format; + struct vec4 expect; + } + tests[] = + { + {DXGI_FORMAT_R32G32B32A32_FLOAT, {-1.72477726e-34, 5.69045661e-28, -1.07374176e+08, -6.25985340e+18}}, + {DXGI_FORMAT_R32G32B32_FLOAT, {-1.72477726e-34, 5.69045661e-28, -1.07374176e+08, 1.0}}, + {DXGI_FORMAT_R32G32_FLOAT, {-1.72477726e-34, 5.69045661e-28, 0.0, 1.0}}, + {DXGI_FORMAT_R32_FLOAT, {-1.72477726e-34, 0.0, 0.0, 1.0}}, + + {DXGI_FORMAT_R10G10B10A2_UNORM, { 7.82991230e-01, 3.28445762e-01, 1.15347020e-01, 6.66666666e-01}}, + + {DXGI_FORMAT_R11G11B10_FLOAT, { 1.89453125e-01, 1.30000000e+01, 3.81250000e+00, 1.0}}, + + {DXGI_FORMAT_R16G16B16A16_FLOAT, { 3.56445313e+00, -1.12831593e-04, 1.03500000e+02, 7.57217407e-04}}, + {DXGI_FORMAT_R16G16B16A16_UNORM, { 2.62226284e-01, 5.28892934e-01, 3.37773710e-01, 7.11070448e-02}}, + {DXGI_FORMAT_R16G16B16A16_SNORM, { 5.24460614e-01, -9.42258954e-01, 6.75557733e-01, 1.42216250e-01}}, + {DXGI_FORMAT_R16G16_FLOAT, { 3.56445313e+00, -1.12831593e-04, 0.0, 1.0}}, + {DXGI_FORMAT_R16G16_UNORM, { 2.62226284e-01, 5.28892934e-01, 0.0, 1.0}}, + {DXGI_FORMAT_R16G16_SNORM, { 5.24460614e-01, -9.42258954e-01, 0.0, 1.0}}, + {DXGI_FORMAT_R16_FLOAT, { 3.56445313e+00, 0.0, 0.0, 1.0}}, + {DXGI_FORMAT_R16_UNORM, { 2.62226284e-01, 0.0, 0.0, 1.0}}, + {DXGI_FORMAT_R16_SNORM, { 5.24460614e-01, 0.0, 0.0, 1.0}}, + + {DXGI_FORMAT_R8G8B8A8_UNORM, { 1.29411772e-01, 2.62745112e-01, 3.96078438e-01, 5.29411793e-01}}, + {DXGI_FORMAT_R8G8B8A8_SNORM, { 2.59842515e-01, 5.27559042e-01, 7.95275569e-01, -9.52755928e-01}}, + {DXGI_FORMAT_R8G8_UNORM, { 1.29411772e-01, 2.62745112e-01, 0.0, 1.0}}, + {DXGI_FORMAT_R8G8_SNORM, { 2.59842515e-01, 5.27559042e-01, 0.0, 1.0}}, + {DXGI_FORMAT_R8_UNORM, { 1.29411772e-01, 0.0, 0.0, 1.0}}, + {DXGI_FORMAT_R8_SNORM, { 2.59842515e-01, 0.0, 0.0, 1.0}}, + + {DXGI_FORMAT_B8G8R8A8_UNORM, { 3.96078438e-01, 2.62745112e-01, 1.29411772e-01, 5.29411793e-01}}, + {DXGI_FORMAT_B8G8R8X8_UNORM, { 3.96078438e-01, 2.62745112e-01, 1.29411772e-01, 1.0}}, + }; + + if (!init_test_context(&test_context, NULL)) + return; + device = test_context.device; + context = test_context.immediate_context; + + hr = ID3D11Device_CreateTexture2D(device, &rt_desc, NULL, &rt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)rt, NULL, &rtv); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = ID3D11Device_CreateVertexShader(device, vs_code, sizeof(vs_code), NULL, &test_context.vs); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &test_context.ps); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + test_context.vb = create_buffer(device, D3D11_BIND_VERTEX_BUFFER, sizeof(quad), quad); + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + const D3D11_INPUT_ELEMENT_DESC layout_desc[] = + { + { + .SemanticName = "sv_position", + .SemanticIndex = 0, + .Format = DXGI_FORMAT_R32G32_FLOAT, + .InputSlot = 0, + .AlignedByteOffset = offsetof(struct quad, position), + .InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA, + }, + { + .SemanticName = "COLOR", + .SemanticIndex = 0, + .Format = tests[i].format, + .InputSlot = 0, + .AlignedByteOffset = offsetof(struct quad, color), + .InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA, + }, + }; + + static const unsigned int stride = sizeof(*quad); + static const unsigned int offset = 0; + ID3D11InputLayout *input_layout; + unsigned int format_support; + + hr = ID3D11Device_CheckFormatSupport(device, tests[i].format, &format_support); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + if (!(format_support & D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER)) + continue; + + winetest_push_context("Format %#x", tests[i].format); + + hr = ID3D11Device_CreateInputLayout(device, layout_desc, ARRAY_SIZE(layout_desc), + vs_code, sizeof(vs_code), &input_layout); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + clear_rtv(context, rtv, &white); + ID3D11DeviceContext_OMSetRenderTargets(context, 1, &rtv, NULL); + ID3D11DeviceContext_IASetInputLayout(context, input_layout); + ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + ID3D11DeviceContext_IASetVertexBuffers(context, 0, 1, &test_context.vb, &stride, &offset); + ID3D11DeviceContext_VSSetShader(context, test_context.vs, NULL, 0); + ID3D11DeviceContext_PSSetShader(context, test_context.ps, NULL, 0); + ID3D11DeviceContext_Draw(context, 4, 0); + + todo_wine_if (tests[i].format == DXGI_FORMAT_R11G11B10_FLOAT) + check_texture_vec4(rt, &tests[i].expect, 0); + + ID3D11InputLayout_Release(input_layout); + + winetest_pop_context(); + } + + ID3D11RenderTargetView_Release(rtv); + ID3D11Texture2D_Release(rt); + release_test_context(&test_context); +} + START_TEST(d3d11) { unsigned int argc, i; @@ -34907,6 +35098,7 @@ START_TEST(d3d11) queue_test(test_user_defined_annotation); queue_test(test_logic_op); queue_test(test_rtv_depth_slice); + queue_test(test_vertex_formats);
run_queued_tests();
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/d3d10core/tests/d3d10core.c | 197 ++++++++++++++++++++++++++++++- 1 file changed, 196 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index cd14371197f..b7884b47526 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -1406,13 +1406,18 @@ static void release_test_context_(unsigned int line, struct d3d10core_test_conte ok_(__FILE__, line)(!ref, "Device has %lu references left.\n", ref); }
-static void clear_backbuffer_rtv(struct d3d10core_test_context *test_context, const struct vec4 *v) +static void clear_rtv(struct d3d10core_test_context *test_context, ID3D10RenderTargetView *rtv, const struct vec4 *v) { /* Cast to (const float *) instead of passing &v->x, since gcc warns about * overreading a float[4] from a float otherwise. */ ID3D10Device_ClearRenderTargetView(test_context->device, test_context->backbuffer_rtv, (const float *)v); }
+static void clear_backbuffer_rtv(struct d3d10core_test_context *test_context, const struct vec4 *v) +{ + clear_rtv(test_context, test_context->backbuffer_rtv, v); +} + #define draw_quad(context) draw_quad_vs_(__LINE__, context, NULL, 0) #define draw_quad_vs(a, b, c) draw_quad_vs_(__LINE__, a, b, c) static void draw_quad_vs_(unsigned int line, struct d3d10core_test_context *context, @@ -19430,6 +19435,195 @@ static void test_stencil_only_write_after_clear(void) release_test_context(&test_context); }
+static void test_vertex_formats(void) +{ + struct d3d10core_test_context test_context; + ID3D10RenderTargetView *rtv; + ID3D10Device *device; + ID3D10Texture2D *rt; + unsigned int i; + HRESULT hr; + + static const D3D10_TEXTURE2D_DESC rt_desc = + { + .Width = 4, + .Height = 4, + .MipLevels = 1, + .ArraySize = 1, + .Format = DXGI_FORMAT_R32G32B32A32_FLOAT, + .SampleDesc.Count = 1, + .Usage = D3D10_USAGE_DEFAULT, + .BindFlags = D3D10_BIND_RENDER_TARGET, + }; + + static const struct quad + { + struct vec2 position; + unsigned int color[4]; + } + quad[] = + { + {{-1.0f, -1.0f}, {0x87654321, 0x12345678, 0xcccccccc, 0xdeadbeef}}, + {{-1.0f, 1.0f}, {0x87654321, 0x12345678, 0xcccccccc, 0xdeadbeef}}, + {{ 1.0f, -1.0f}, {0x87654321, 0x12345678, 0xcccccccc, 0xdeadbeef}}, + {{ 1.0f, 1.0f}, {0x87654321, 0x12345678, 0xcccccccc, 0xdeadbeef}}, + }; + + static const unsigned int vs_code[] = + { +#if 0 + void main(inout float4 position : sv_position, inout float4 color : COLOR) + { + } +#endif + 0x43425844, 0xc2f6fe60, 0x8a304938, 0x14c1a190, 0xe6f3e35e, 0x00000001, 0x00000144, 0x00000003, + 0x0000002c, 0x00000080, 0x000000d4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x705f7673, 0x7469736f, 0x006e6f69, 0x4f4c4f43, 0xabab0052, + 0x4e47534f, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, + 0x705f7673, 0x7469736f, 0x006e6f69, 0x4f4c4f43, 0xabab0052, 0x52444853, 0x00000068, 0x00010040, + 0x0000001a, 0x0300005f, 0x001010f2, 0x00000000, 0x0300005f, 0x001010f2, 0x00000001, 0x04000067, + 0x001020f2, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, 0x05000036, 0x001020f2, + 0x00000000, 0x00101e46, 0x00000000, 0x05000036, 0x001020f2, 0x00000001, 0x00101e46, 0x00000001, + 0x0100003e, + }; + + static const unsigned int ps_code[] = + { +#if 0 + float4 main(float4 position : sv_position, float4 color : COLOR) : sv_target + { + return color; + } +#endif + 0x43425844, 0xb9b047ca, 0x73193a19, 0xb9a919ed, 0x21c2ff5f, 0x00000001, 0x000000f4, 0x00000003, + 0x0000002c, 0x00000080, 0x000000b4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x705f7673, 0x7469736f, 0x006e6f69, 0x4f4c4f43, 0xabab0052, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x745f7673, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, + 0x0000000e, 0x03001062, 0x001010f2, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x05000036, + 0x001020f2, 0x00000000, 0x00101e46, 0x00000001, 0x0100003e, + }; + + static const struct vec4 white = {1.0f, 1.0f, 1.0f, 1.0f}; + + static const struct + { + DXGI_FORMAT format; + struct vec4 expect; + } + tests[] = + { + {DXGI_FORMAT_R32G32B32A32_FLOAT, {-1.72477726e-34, 5.69045661e-28, -1.07374176e+08, -6.25985340e+18}}, + {DXGI_FORMAT_R32G32B32_FLOAT, {-1.72477726e-34, 5.69045661e-28, -1.07374176e+08, 1.0}}, + {DXGI_FORMAT_R32G32_FLOAT, {-1.72477726e-34, 5.69045661e-28, 0.0, 1.0}}, + {DXGI_FORMAT_R32_FLOAT, {-1.72477726e-34, 0.0, 0.0, 1.0}}, + + {DXGI_FORMAT_R10G10B10A2_UNORM, { 7.82991230e-01, 3.28445762e-01, 1.15347020e-01, 6.66666666e-01}}, + + {DXGI_FORMAT_R11G11B10_FLOAT, { 1.89453125e-01, 1.30000000e+01, 3.81250000e+00, 1.0}}, + + {DXGI_FORMAT_R16G16B16A16_FLOAT, { 3.56445313e+00, -1.12831593e-04, 1.03500000e+02, 7.57217407e-04}}, + {DXGI_FORMAT_R16G16B16A16_UNORM, { 2.62226284e-01, 5.28892934e-01, 3.37773710e-01, 7.11070448e-02}}, + {DXGI_FORMAT_R16G16B16A16_SNORM, { 5.24460614e-01, -9.42258954e-01, 6.75557733e-01, 1.42216250e-01}}, + {DXGI_FORMAT_R16G16_FLOAT, { 3.56445313e+00, -1.12831593e-04, 0.0, 1.0}}, + {DXGI_FORMAT_R16G16_UNORM, { 2.62226284e-01, 5.28892934e-01, 0.0, 1.0}}, + {DXGI_FORMAT_R16G16_SNORM, { 5.24460614e-01, -9.42258954e-01, 0.0, 1.0}}, + {DXGI_FORMAT_R16_FLOAT, { 3.56445313e+00, 0.0, 0.0, 1.0}}, + {DXGI_FORMAT_R16_UNORM, { 2.62226284e-01, 0.0, 0.0, 1.0}}, + {DXGI_FORMAT_R16_SNORM, { 5.24460614e-01, 0.0, 0.0, 1.0}}, + + {DXGI_FORMAT_R8G8B8A8_UNORM, { 1.29411772e-01, 2.62745112e-01, 3.96078438e-01, 5.29411793e-01}}, + {DXGI_FORMAT_R8G8B8A8_SNORM, { 2.59842515e-01, 5.27559042e-01, 7.95275569e-01, -9.52755928e-01}}, + {DXGI_FORMAT_R8G8_UNORM, { 1.29411772e-01, 2.62745112e-01, 0.0, 1.0}}, + {DXGI_FORMAT_R8G8_SNORM, { 2.59842515e-01, 5.27559042e-01, 0.0, 1.0}}, + {DXGI_FORMAT_R8_UNORM, { 1.29411772e-01, 0.0, 0.0, 1.0}}, + {DXGI_FORMAT_R8_SNORM, { 2.59842515e-01, 0.0, 0.0, 1.0}}, + + {DXGI_FORMAT_B8G8R8A8_UNORM, { 3.96078438e-01, 2.62745112e-01, 1.29411772e-01, 5.29411793e-01}}, + {DXGI_FORMAT_B8G8R8X8_UNORM, { 3.96078438e-01, 2.62745112e-01, 1.29411772e-01, 1.0}}, + }; + + if (!init_test_context(&test_context)) + return; + device = test_context.device; + + hr = ID3D10Device_CreateTexture2D(device, &rt_desc, NULL, &rt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)rt, NULL, &rtv); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = ID3D10Device_CreateVertexShader(device, vs_code, sizeof(vs_code), &test_context.vs); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = ID3D10Device_CreatePixelShader(device, ps_code, sizeof(ps_code), &test_context.ps); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + test_context.vb = create_buffer(device, D3D10_BIND_VERTEX_BUFFER, sizeof(quad), quad); + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + const D3D10_INPUT_ELEMENT_DESC layout_desc[] = + { + { + .SemanticName = "sv_position", + .SemanticIndex = 0, + .Format = DXGI_FORMAT_R32G32_FLOAT, + .InputSlot = 0, + .AlignedByteOffset = offsetof(struct quad, position), + .InputSlotClass = D3D10_INPUT_PER_VERTEX_DATA, + }, + { + .SemanticName = "COLOR", + .SemanticIndex = 0, + .Format = tests[i].format, + .InputSlot = 0, + .AlignedByteOffset = offsetof(struct quad, color), + .InputSlotClass = D3D10_INPUT_PER_VERTEX_DATA, + }, + }; + + static const unsigned int stride = sizeof(*quad); + static const unsigned int offset = 0; + ID3D10InputLayout *input_layout; + unsigned int format_support; + + hr = ID3D10Device_CheckFormatSupport(device, tests[i].format, &format_support); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + if (!(format_support & D3D10_FORMAT_SUPPORT_IA_VERTEX_BUFFER)) + continue; + + winetest_push_context("Format %#x", tests[i].format); + + hr = ID3D10Device_CreateInputLayout(device, layout_desc, ARRAY_SIZE(layout_desc), + vs_code, sizeof(vs_code), &input_layout); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + clear_rtv(&test_context, rtv, &white); + ID3D10Device_OMSetRenderTargets(device, 1, &rtv, NULL); + ID3D10Device_IASetInputLayout(device, input_layout); + ID3D10Device_IASetPrimitiveTopology(device, D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + ID3D10Device_IASetVertexBuffers(device, 0, 1, &test_context.vb, &stride, &offset); + ID3D10Device_VSSetShader(device, test_context.vs); + ID3D10Device_PSSetShader(device, test_context.ps); + ID3D10Device_Draw(device, 4, 0); + + todo_wine_if (tests[i].format == DXGI_FORMAT_R11G11B10_FLOAT) + check_texture_vec4(rt, &tests[i].expect, 0); + + ID3D10InputLayout_Release(input_layout); + + winetest_pop_context(); + } + + ID3D10RenderTargetView_Release(rtv); + ID3D10Texture2D_Release(rt); + release_test_context(&test_context); +} + START_TEST(d3d10core) { unsigned int argc, i; @@ -19562,6 +19756,7 @@ START_TEST(d3d10core) queue_test(test_dynamic_map_synchronization); queue_test(test_rtv_depth_slice); queue_test(test_stencil_only_write_after_clear); + queue_test(test_vertex_formats);
run_queued_tests();
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/wined3d/utils.c | 69 ++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 31 deletions(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index fb350acf56f..4af95ab1ffb 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -2048,10 +2048,46 @@ static enum wined3d_channel_type map_channel_type(char t) } }
+static void parse_channel_desc(struct wined3d_format *format, const char *channel_desc) +{ + unsigned int component_count = 0; + unsigned int attrs = 0; + unsigned int j; + + for (j = 0; j < strlen(channel_desc); ++j) + { + enum wined3d_channel_type channel_type = map_channel_type(channel_desc[j]); + + if (channel_type == WINED3D_CHANNEL_TYPE_UNORM || channel_type == WINED3D_CHANNEL_TYPE_SNORM) + attrs |= WINED3D_FORMAT_ATTR_NORMALISED; + if (channel_type == WINED3D_CHANNEL_TYPE_UINT || channel_type == WINED3D_CHANNEL_TYPE_SINT) + attrs |= WINED3D_FORMAT_ATTR_INTEGER; + if (channel_type == WINED3D_CHANNEL_TYPE_FLOAT) + attrs |= WINED3D_FORMAT_ATTR_FLOAT; + if (channel_type != WINED3D_CHANNEL_TYPE_UNUSED) + ++component_count; + + if (channel_type == WINED3D_CHANNEL_TYPE_DEPTH && !format->depth_size) + { + format->depth_size = format->red_size; + format->red_size = format->red_offset = 0; + } + + if (channel_type == WINED3D_CHANNEL_TYPE_STENCIL && !format->stencil_size) + { + format->stencil_size = format->green_size; + format->green_size = format->green_offset = 0; + } + } + + format->attrs |= attrs; + format->component_count = component_count; +} + static BOOL init_format_base_info(struct wined3d_adapter *adapter) { struct wined3d_format *format; - unsigned int i, j; + unsigned int i;
for (i = 0; i < ARRAY_SIZE(formats); ++i) { @@ -2078,8 +2114,6 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) for (i = 0; i < ARRAY_SIZE(typed_formats); ++i) { struct wined3d_format *typeless_format; - unsigned int component_count = 0; - unsigned int attrs = 0;
if (!(format = get_format_internal(adapter, typed_formats[i].id))) return FALSE; @@ -2106,34 +2140,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter)
typeless_format->typeless_id = typeless_format->id;
- for (j = 0; j < strlen(typed_formats[i].channels); ++j) - { - enum wined3d_channel_type channel_type = map_channel_type(typed_formats[i].channels[j]); - - if (channel_type == WINED3D_CHANNEL_TYPE_UNORM || channel_type == WINED3D_CHANNEL_TYPE_SNORM) - attrs |= WINED3D_FORMAT_ATTR_NORMALISED; - if (channel_type == WINED3D_CHANNEL_TYPE_UINT || channel_type == WINED3D_CHANNEL_TYPE_SINT) - attrs |= WINED3D_FORMAT_ATTR_INTEGER; - if (channel_type == WINED3D_CHANNEL_TYPE_FLOAT) - attrs |= WINED3D_FORMAT_ATTR_FLOAT; - if (channel_type != WINED3D_CHANNEL_TYPE_UNUSED) - ++component_count; - - if (channel_type == WINED3D_CHANNEL_TYPE_DEPTH && !format->depth_size) - { - format->depth_size = format->red_size; - format->red_size = format->red_offset = 0; - } - - if (channel_type == WINED3D_CHANNEL_TYPE_STENCIL && !format->stencil_size) - { - format->stencil_size = format->green_size; - format->green_size = format->green_offset = 0; - } - } - - format->component_count = component_count; - format->attrs |= attrs; + parse_channel_desc(format, typed_formats[i].channels); }
for (i = 0; i < ARRAY_SIZE(ddi_formats); ++i)
From: Zebediah Figura zfigura@codeweavers.com
Avoid the need for manually set type attributes, and initialize the component count for all such formats.
This fixes use of R11G11B10_FLOAT as a vertex attribute format with the GL backend. Since it has no corresponding typeless format, prior to this commit the component count was uninitialized and hence use of the format would result in a GL error.
This fixes a GL error with Dark Souls Remastered. I did not immediately observe any corresponding rendering errors, however. --- dlls/d3d10core/tests/d3d10core.c | 3 +- dlls/d3d11/tests/d3d11.c | 3 +- dlls/wined3d/utils.c | 173 +++++++++++++++---------------- 3 files changed, 85 insertions(+), 94 deletions(-)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index b7884b47526..9a94e520591 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -19611,8 +19611,7 @@ static void test_vertex_formats(void) ID3D10Device_PSSetShader(device, test_context.ps); ID3D10Device_Draw(device, 4, 0);
- todo_wine_if (tests[i].format == DXGI_FORMAT_R11G11B10_FLOAT) - check_texture_vec4(rt, &tests[i].expect, 0); + check_texture_vec4(rt, &tests[i].expect, 0);
ID3D10InputLayout_Release(input_layout);
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 0a54ff03f0f..3d1617650c5 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -34903,8 +34903,7 @@ static void test_vertex_formats(void) ID3D11DeviceContext_PSSetShader(context, test_context.ps, NULL, 0); ID3D11DeviceContext_Draw(context, 4, 0);
- todo_wine_if (tests[i].format == DXGI_FORMAT_R11G11B10_FLOAT) - check_texture_vec4(rt, &tests[i].expect, 0); + check_texture_vec4(rt, &tests[i].expect, 0);
ID3D11InputLayout_Release(input_layout);
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 4af95ab1ffb..5abadecd0d1 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -74,101 +74,102 @@ struct wined3d_format_channels DWORD red_offset, green_offset, blue_offset, alpha_offset; UINT bpp; BYTE depth_size, stencil_size; + const char *channels; };
static const struct wined3d_format_channels formats[] = { /* size offset - * format id r g b a r g b a bpp depth stencil */ - {WINED3DFMT_UNKNOWN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + * format id r g b a r g b a bpp z s channels */ + {WINED3DFMT_UNKNOWN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* FourCC formats */ - {WINED3DFMT_UYVY, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, - {WINED3DFMT_YUY2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, - {WINED3DFMT_YV12, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_NV12, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_DXT1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_DXT2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_DXT3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_DXT4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_DXT5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_MULTI2_ARGB8, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_G8R8_G8B8, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_R8G8_B8G8, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_UYVY, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, + {WINED3DFMT_YUY2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, + {WINED3DFMT_YV12, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_NV12, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_DXT1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_DXT2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_DXT3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_DXT4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_DXT5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_MULTI2_ARGB8, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_G8R8_G8B8, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_R8G8_B8G8, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, /* Hmm? */ - {WINED3DFMT_R8G8_SNORM_Cx, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, - {WINED3DFMT_R11G11B10_FLOAT, 11, 11, 10, 0, 0, 11, 22, 0, 4, 0, 0}, + {WINED3DFMT_R8G8_SNORM_Cx, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, + {WINED3DFMT_R11G11B10_FLOAT, 11, 11, 10, 0, 0, 11, 22, 0, 4, 0, 0, "FFF"}, /* Palettized formats */ - {WINED3DFMT_P8_UINT_A8_UNORM, 0, 0, 0, 8, 0, 0, 0, 8, 2, 0, 0}, - {WINED3DFMT_P8_UINT, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_P8_UINT_A8_UNORM, 0, 0, 0, 8, 0, 0, 0, 8, 2, 0, 0}, + {WINED3DFMT_P8_UINT, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, /* Standard ARGB formats. */ - {WINED3DFMT_B8G8R8_UNORM, 8, 8, 8, 0, 16, 8, 0, 0, 3, 0, 0}, - {WINED3DFMT_B5G6R5_UNORM, 5, 6, 5, 0, 11, 5, 0, 0, 2, 0, 0}, - {WINED3DFMT_B5G5R5X1_UNORM, 5, 5, 5, 0, 10, 5, 0, 0, 2, 0, 0}, - {WINED3DFMT_B5G5R5A1_UNORM, 5, 5, 5, 1, 10, 5, 0, 15, 2, 0, 0}, - {WINED3DFMT_B4G4R4A4_UNORM, 4, 4, 4, 4, 8, 4, 0, 12, 2, 0, 0}, - {WINED3DFMT_B2G3R3_UNORM, 3, 3, 2, 0, 5, 2, 0, 0, 1, 0, 0}, - {WINED3DFMT_A8_UNORM, 0, 0, 0, 8, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_B2G3R3A8_UNORM, 3, 3, 2, 8, 5, 2, 0, 8, 2, 0, 0}, - {WINED3DFMT_B4G4R4X4_UNORM, 4, 4, 4, 0, 8, 4, 0, 0, 2, 0, 0}, - {WINED3DFMT_R8G8B8X8_UNORM, 8, 8, 8, 0, 0, 8, 16, 0, 4, 0, 0}, - {WINED3DFMT_B10G10R10A2_UNORM, 10, 10, 10, 2, 20, 10, 0, 30, 4, 0, 0}, + {WINED3DFMT_B8G8R8_UNORM, 8, 8, 8, 0, 16, 8, 0, 0, 3, 0, 0, "uuu"}, + {WINED3DFMT_B5G6R5_UNORM, 5, 6, 5, 0, 11, 5, 0, 0, 2, 0, 0, "uuu"}, + {WINED3DFMT_B5G5R5X1_UNORM, 5, 5, 5, 0, 10, 5, 0, 0, 2, 0, 0, "uuuX"}, + {WINED3DFMT_B5G5R5A1_UNORM, 5, 5, 5, 1, 10, 5, 0, 15, 2, 0, 0, "uuuu"}, + {WINED3DFMT_B4G4R4A4_UNORM, 4, 4, 4, 4, 8, 4, 0, 12, 2, 0, 0, "uuuu"}, + {WINED3DFMT_B2G3R3_UNORM, 3, 3, 2, 0, 5, 2, 0, 0, 1, 0, 0, "uuu"}, + {WINED3DFMT_A8_UNORM, 0, 0, 0, 8, 0, 0, 0, 0, 1, 0, 0, "u"}, + {WINED3DFMT_B2G3R3A8_UNORM, 3, 3, 2, 8, 5, 2, 0, 8, 2, 0, 0, "uuuu"}, + {WINED3DFMT_B4G4R4X4_UNORM, 4, 4, 4, 0, 8, 4, 0, 0, 2, 0, 0, "uuuX"}, + {WINED3DFMT_R8G8B8X8_UNORM, 8, 8, 8, 0, 0, 8, 16, 0, 4, 0, 0, "uuuX"}, + {WINED3DFMT_B10G10R10A2_UNORM, 10, 10, 10, 2, 20, 10, 0, 30, 4, 0, 0, "uuuu"}, /* Luminance */ - {WINED3DFMT_L8_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_L8A8_UNORM, 0, 0, 0, 8, 0, 0, 0, 8, 2, 0, 0}, - {WINED3DFMT_L4A4_UNORM, 0, 0, 0, 4, 0, 0, 0, 4, 1, 0, 0}, - {WINED3DFMT_L16_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, + {WINED3DFMT_L8_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_L8A8_UNORM, 0, 0, 0, 8, 0, 0, 0, 8, 2, 0, 0}, + {WINED3DFMT_L4A4_UNORM, 0, 0, 0, 4, 0, 0, 0, 4, 1, 0, 0}, + {WINED3DFMT_L16_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, /* Bump mapping stuff */ - {WINED3DFMT_R5G5_SNORM_L6_UNORM, 5, 5, 0, 0, 0, 5, 0, 0, 2, 0, 0}, - {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, 8, 8, 0, 0, 0, 8, 0, 0, 4, 0, 0}, - {WINED3DFMT_R10G11B11_SNORM, 10, 11, 11, 0, 0, 10, 21, 0, 4, 0, 0}, - {WINED3DFMT_R10G10B10_SNORM_A2_UNORM, 10, 10, 10, 2, 0, 10, 20, 30, 4, 0, 0}, + {WINED3DFMT_R5G5_SNORM_L6_UNORM, 5, 5, 0, 0, 0, 5, 0, 0, 2, 0, 0}, + {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, 8, 8, 0, 0, 0, 8, 0, 0, 4, 0, 0}, + {WINED3DFMT_R10G11B11_SNORM, 10, 11, 11, 0, 0, 10, 21, 0, 4, 0, 0, "iii"}, + {WINED3DFMT_R10G10B10_SNORM_A2_UNORM, 10, 10, 10, 2, 0, 10, 20, 30, 4, 0, 0, "iiiu"}, /* Depth stencil formats */ - {WINED3DFMT_D16_LOCKABLE, 0, 0, 0, 0, 0, 0, 0, 0, 2, 16, 0}, - {WINED3DFMT_D32_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 4, 32, 0}, - {WINED3DFMT_S1_UINT_D15_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15, 1}, - {WINED3DFMT_X8D24_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 0}, - {WINED3DFMT_S4X4_UINT_D24_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 4}, - {WINED3DFMT_S8_UINT_D24_FLOAT, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 8}, + {WINED3DFMT_D16_LOCKABLE, 0, 0, 0, 0, 0, 0, 0, 0, 2, 16, 0, "D"}, + {WINED3DFMT_D32_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 4, 32, 0, "D"}, + {WINED3DFMT_S1_UINT_D15_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15, 1, "SD"}, + {WINED3DFMT_X8D24_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 0, "XD"}, + {WINED3DFMT_S4X4_UINT_D24_UNORM, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 4, "SXD"}, + {WINED3DFMT_S8_UINT_D24_FLOAT, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 8, "SD"}, /* Vendor-specific formats */ - {WINED3DFMT_ATI1N, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_ATI2N, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_NVDB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {WINED3DFMT_ATOC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {WINED3DFMT_INST, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {WINED3DFMT_INTZ, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 8}, - {WINED3DFMT_RESZ, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {WINED3DFMT_NVHU, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, - {WINED3DFMT_NVHS, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, - {WINED3DFMT_NULL, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0}, + {WINED3DFMT_ATI1N, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_ATI2N, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_NVDB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {WINED3DFMT_ATOC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {WINED3DFMT_INST, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {WINED3DFMT_INTZ, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 8}, + {WINED3DFMT_RESZ, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {WINED3DFMT_NVHU, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, + {WINED3DFMT_NVHS, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, + {WINED3DFMT_NULL, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0}, /* Unsure about them, could not find a Windows driver that supports them */ - {WINED3DFMT_R16, 16, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, - {WINED3DFMT_AL16, 0, 0, 0, 16, 0, 0, 0, 16, 4, 0, 0}, + {WINED3DFMT_R16, 16, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, + {WINED3DFMT_AL16, 0, 0, 0, 16, 0, 0, 0, 16, 4, 0, 0}, /* DirectX 10 HDR formats */ - {WINED3DFMT_R9G9B9E5_SHAREDEXP, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0}, + {WINED3DFMT_R9G9B9E5_SHAREDEXP, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0}, /* Typeless */ - {WINED3DFMT_R32G32B32A32_TYPELESS, 32, 32, 32, 32, 0, 32, 64, 96, 16, 0, 0}, - {WINED3DFMT_R32G32B32_TYPELESS, 32, 32, 32, 0, 0, 32, 64, 0, 12, 0, 0}, - {WINED3DFMT_R16G16B16A16_TYPELESS, 16, 16, 16, 16, 0, 16, 32, 48, 8, 0, 0}, - {WINED3DFMT_R32G32_TYPELESS, 32, 32, 0, 0, 0, 32, 0, 0, 8, 0, 0}, - {WINED3DFMT_R32G8X24_TYPELESS, 32, 8, 0, 0, 0, 0, 0, 0, 8, 0, 0}, - {WINED3DFMT_R10G10B10A2_TYPELESS, 10, 10, 10, 2, 0, 10, 20, 30, 4, 0, 0}, - {WINED3DFMT_R10G10B10X2_TYPELESS, 10, 10, 10, 0, 0, 10, 20, 0, 4, 0, 0}, - {WINED3DFMT_R8G8B8A8_TYPELESS, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0}, - {WINED3DFMT_R16G16_TYPELESS, 16, 16, 0, 0, 0, 16, 0, 0, 4, 0, 0}, - {WINED3DFMT_R32_TYPELESS, 32, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0}, - {WINED3DFMT_R24G8_TYPELESS, 24, 8, 0, 0, 0, 0, 0, 0, 4, 0, 0}, - {WINED3DFMT_R8G8_TYPELESS, 8, 8, 0, 0, 0, 8, 0, 0, 2, 0, 0}, - {WINED3DFMT_R16_TYPELESS, 16, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, - {WINED3DFMT_R8_TYPELESS, 8, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_BC1_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_BC2_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_BC3_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_BC4_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_BC5_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_BC6H_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_BC7_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, - {WINED3DFMT_B8G8R8A8_TYPELESS, 8, 8, 8, 8, 16, 8, 0, 24, 4, 0, 0}, - {WINED3DFMT_B8G8R8X8_TYPELESS, 8, 8, 8, 0, 16, 8, 0, 0, 4, 0, 0}, + {WINED3DFMT_R32G32B32A32_TYPELESS, 32, 32, 32, 32, 0, 32, 64, 96, 16, 0, 0}, + {WINED3DFMT_R32G32B32_TYPELESS, 32, 32, 32, 0, 0, 32, 64, 0, 12, 0, 0}, + {WINED3DFMT_R16G16B16A16_TYPELESS, 16, 16, 16, 16, 0, 16, 32, 48, 8, 0, 0}, + {WINED3DFMT_R32G32_TYPELESS, 32, 32, 0, 0, 0, 32, 0, 0, 8, 0, 0}, + {WINED3DFMT_R32G8X24_TYPELESS, 32, 8, 0, 0, 0, 0, 0, 0, 8, 0, 0}, + {WINED3DFMT_R10G10B10A2_TYPELESS, 10, 10, 10, 2, 0, 10, 20, 30, 4, 0, 0}, + {WINED3DFMT_R10G10B10X2_TYPELESS, 10, 10, 10, 0, 0, 10, 20, 0, 4, 0, 0}, + {WINED3DFMT_R8G8B8A8_TYPELESS, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0}, + {WINED3DFMT_R16G16_TYPELESS, 16, 16, 0, 0, 0, 16, 0, 0, 4, 0, 0}, + {WINED3DFMT_R32_TYPELESS, 32, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0}, + {WINED3DFMT_R24G8_TYPELESS, 24, 8, 0, 0, 0, 0, 0, 0, 4, 0, 0}, + {WINED3DFMT_R8G8_TYPELESS, 8, 8, 0, 0, 0, 8, 0, 0, 2, 0, 0}, + {WINED3DFMT_R16_TYPELESS, 16, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, + {WINED3DFMT_R8_TYPELESS, 8, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_BC1_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_BC2_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_BC3_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_BC4_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_BC5_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_BC6H_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_BC7_TYPELESS, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_B8G8R8A8_TYPELESS, 8, 8, 8, 8, 16, 8, 0, 24, 4, 0, 0}, + {WINED3DFMT_B8G8R8X8_TYPELESS, 8, 8, 8, 0, 16, 8, 0, 0, 4, 0, 0}, };
struct wined3d_typed_format_info @@ -319,7 +320,6 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_ATI2N, WINED3D_FORMAT_ATTR_MAPPABLE | WINED3D_FORMAT_ATTR_BROKEN_PITCH}, {WINED3DFMT_D16_LOCKABLE, WINED3D_FORMAT_ATTR_MAPPABLE}, {WINED3DFMT_INTZ, WINED3D_FORMAT_ATTR_MAPPABLE}, - {WINED3DFMT_R11G11B10_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, {WINED3DFMT_D32_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, {WINED3DFMT_S8_UINT_D24_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, {WINED3DFMT_D32_FLOAT_S8X24_UINT, WINED3D_FORMAT_ATTR_FLOAT}, @@ -349,16 +349,6 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_R32_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, {WINED3DFMT_R16_UINT, 0, WINED3D_FORMAT_CAP_INDEX_BUFFER}, - {WINED3DFMT_A8_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, - {WINED3DFMT_B10G10R10A2_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, - {WINED3DFMT_B2G3R3_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, - {WINED3DFMT_B4G4R4A4_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, - {WINED3DFMT_B4G4R4X4_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, - {WINED3DFMT_B5G5R5A1_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, - {WINED3DFMT_B5G5R5X1_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, - {WINED3DFMT_B5G6R5_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, - {WINED3DFMT_B8G8R8_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, - {WINED3DFMT_R10G10B10A2_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, {WINED3DFMT_R8G8_SNORM, WINED3D_FORMAT_ATTR_BUMPMAP}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, WINED3D_FORMAT_ATTR_BUMPMAP}, {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, WINED3D_FORMAT_ATTR_BUMPMAP}, @@ -2109,6 +2099,9 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) format->block_width = 1; format->block_height = 1; format->block_byte_count = formats[i].bpp; + + if (formats[i].channels) + parse_channel_desc(format, formats[i].channels); }
for (i = 0; i < ARRAY_SIZE(typed_formats); ++i)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=128339
Your paranoid android.
=== w8 (32 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w8adm (32 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w864 (32 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w1064v1507 (32 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w1064v1809 (32 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w1064_tsign (32 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w10pro64 (32 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w864 (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w1064v1507 (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w1064v1809 (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w1064_2qxl (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w1064_adm (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w1064_tsign (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w10pro64 (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w10pro64_en_AE_u8 (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w10pro64_ar (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w10pro64_ja (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== w10pro64_zh_CN (64 bit report) ===
d3d10core: d3d10core.c:19594: Test failed: Got hr 0x80004005. d3d10core.c:19594: Test failed: Got hr 0x80004005.
=== debian11 (32 bit report) ===
d3d10core: d3d10core.c:19614: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.
=== debian11 (32 bit ar:MA report) ===
d3d10core: d3d10core.c:19614: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.
=== debian11 (32 bit de report) ===
d3d10core: d3d10core.c:19614: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.
=== debian11 (32 bit fr report) ===
d3d10core: d3d10core.c:19614: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.
=== debian11 (32 bit he:IL report) ===
d3d10core: d3d10core.c:19614: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.
=== debian11 (32 bit hi:IN report) ===
d3d10core: d3d10core.c:19614: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.
=== debian11 (32 bit ja:JP report) ===
d3d10core: d3d10core.c:19614: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.
=== debian11 (32 bit zh:CN report) ===
d3d10core: d3d10core.c:19614: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.
=== debian11b (32 bit WoW report) ===
d3d10core: d3d10core.c:19614: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.
=== debian11b (64 bit WoW report) ===
d3d10core: d3d10core.c:19614: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d10core.c:19614: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.
d3d11: d3d11.c:34906: Test failed: Format 0x18: Got {7.82991230e-001, 3.28445733e-001, 1.15347020e-001, 6.66666687e-001}, expected {7.82991230e-001, 3.28445762e-001, 1.15347020e-001, 6.66666687e-001} at (0, 0), sub-resource 0. d3d11.c:34906: Test failed: Format 0x1c: Got {1.29411772e-001, 2.62745112e-001, 3.96078467e-001, 5.29411793e-001}, expected {1.29411772e-001, 2.62745112e-001, 3.96078438e-001, 5.29411793e-001} at (0, 0), sub-resource 0. d3d11.c:34906: Test failed: Format 0x57: Got {3.96078467e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001}, expected {3.96078438e-001, 2.62745112e-001, 1.29411772e-001, 5.29411793e-001} at (0, 0), sub-resource 0.