[2/2] d3d11/tests: Add tests for SM5 instructions gather4_c/gather4_po_c
Józef Kucia
joseph.kucia at gmail.com
Fri May 19 04:47:26 CDT 2017
On Fri, May 19, 2017 at 2:50 AM, Sven Hesse <drmccoy at drmccoy.de> wrote:
> + if (!init_test_context(&test_context, NULL))
> + return;
> +
> + device = test_context.device;
> + context = test_context.immediate_context;
> +
> + if (ID3D11Device_GetFeatureLevel(device) < D3D_FEATURE_LEVEL_11_0)
> + {
> + skip("Shader model 5 required for gather4_c/gather4_po_c.\n");
> + release_test_context(&test_context);
> + return;
> + }
You should just pass the feature level to init_test_context(), and it
will skip the test for you.
> +
> + texture_desc.Format = DXGI_FORMAT_D32_FLOAT;
> + texture_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
> + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, &resource_data, &texture);
> + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr);
> + hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)texture, NULL, &srv);
The D32_FLOAT format cannot be used as SRV. You have to create the
texture with format DXGI_FORMAT_R32_TYPELESS, and then use
DXGI_FORMAT_R32_FLOAT for SRV. I think it may be interesting to test
with D3D11_BIND_DEPTH_STENCIL and without D3D11_BIND_DEPTH_STENCIL
because wined3d behaves a bit differently when depth stencil is
enabled.
> + ok(SUCCEEDED(hr), "Fialed to create shader resource view, hr %#x.\n", hr);
Typo.
> + ID3D11DeviceContext_PSSetSamplers(context, 0, 1, &sampler);
You don't need to set samplers multiple times. It can be done once,
after the sampler state is created.
More information about the wine-devel
mailing list