[PATCH] d3dcompiler/tests: Avoid initializing nameless unions in designated initializers.

Zebediah Figura z.figura12 at gmail.com
Fri Dec 25 10:06:36 CST 2020


Old versions of gcc can't handle this.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50397
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/d3dcompiler_43/tests/hlsl_d3d11.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d11.c b/dlls/d3dcompiler_43/tests/hlsl_d3d11.c
index 7a1243b9ccf..53dbd3e2df7 100644
--- a/dlls/d3dcompiler_43/tests/hlsl_d3d11.c
+++ b/dlls/d3dcompiler_43/tests/hlsl_d3d11.c
@@ -526,6 +526,7 @@ static void test_trig(void)
 
 static void test_sampling(void)
 {
+    D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc = {0};
     struct test_context test_context;
     ID3D11ShaderResourceView *srv;
     ID3D11SamplerState *sampler;
@@ -592,13 +593,6 @@ static void test_sampling(void)
 
     static const D3D11_SUBRESOURCE_DATA resource_data = {&texture_data, sizeof(texture_data) / 2};
 
-    static const D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc =
-    {
-        .Format = DXGI_FORMAT_R32G32B32A32_FLOAT,
-        .ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D,
-        .Texture2D.MipLevels = 1,
-    };
-
     static const D3D11_SAMPLER_DESC sampler_desc =
     {
         .Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR,
@@ -614,6 +608,9 @@ static void test_sampling(void)
 
     hr = ID3D11Device_CreateTexture2D(test_context.device, &texture_desc, &resource_data, &texture);
     ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr);
+    srv_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
+    srv_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
+    srv_desc.Texture2D.MipLevels = 1;
     hr = ID3D11Device_CreateShaderResourceView(test_context.device, (ID3D11Resource *)texture, &srv_desc, &srv);
     ok(hr == S_OK, "Failed to create SRV, hr %#x.\n", hr);
     ID3D11DeviceContext_PSSetShaderResources(test_context.immediate_context, 0, 1, &srv);
-- 
2.29.2




More information about the wine-devel mailing list