tests: Disable culling in shader runners.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2023-04-10 20:45:15 +02:00 committed by Alexandre Julliard
parent ca59a3c35b
commit a496e3a8ba
Notes: Alexandre Julliard 2023-04-13 23:20:09 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/140
4 changed files with 22 additions and 2 deletions

View File

@ -63,6 +63,7 @@ struct d3d11_shader_runner
HWND window; HWND window;
IDXGISwapChain *swapchain; IDXGISwapChain *swapchain;
ID3D11DeviceContext *immediate_context; ID3D11DeviceContext *immediate_context;
ID3D11RasterizerState *rasterizer_state;
}; };
static struct d3d11_shader_runner *d3d11_shader_runner(struct shader_runner *r) static struct d3d11_shader_runner *d3d11_shader_runner(struct shader_runner *r)
@ -250,7 +251,9 @@ static IDXGISwapChain *create_swapchain(ID3D11Device *device, HWND window)
static BOOL init_test_context(struct d3d11_shader_runner *runner) static BOOL init_test_context(struct d3d11_shader_runner *runner)
{ {
unsigned int rt_width, rt_height; unsigned int rt_width, rt_height;
D3D11_RASTERIZER_DESC rs_desc;
D3D11_VIEWPORT vp; D3D11_VIEWPORT vp;
HRESULT hr;
RECT rect; RECT rect;
memset(runner, 0, sizeof(*runner)); memset(runner, 0, sizeof(*runner));
@ -279,6 +282,19 @@ static BOOL init_test_context(struct d3d11_shader_runner *runner)
vp.MaxDepth = 1.0f; vp.MaxDepth = 1.0f;
ID3D11DeviceContext_RSSetViewports(runner->immediate_context, 1, &vp); ID3D11DeviceContext_RSSetViewports(runner->immediate_context, 1, &vp);
rs_desc.FillMode = D3D11_FILL_SOLID;
rs_desc.CullMode = D3D11_CULL_NONE;
rs_desc.FrontCounterClockwise = FALSE;
rs_desc.DepthBias = 0;
rs_desc.DepthBiasClamp = 0.0f;
rs_desc.SlopeScaledDepthBias = 0.0f;
rs_desc.DepthClipEnable = TRUE;
rs_desc.ScissorEnable = FALSE;
rs_desc.MultisampleEnable = FALSE;
rs_desc.AntialiasedLineEnable = FALSE;
hr = ID3D11Device_CreateRasterizerState(runner->device, &rs_desc, &runner->rasterizer_state);
ok(hr == S_OK, "Failed to create rasterizer state.\n");
return TRUE; return TRUE;
} }
@ -286,6 +302,7 @@ static void destroy_test_context(struct d3d11_shader_runner *runner)
{ {
ULONG ref; ULONG ref;
ID3D11RasterizerState_Release(runner->rasterizer_state);
ID3D11DeviceContext_Release(runner->immediate_context); ID3D11DeviceContext_Release(runner->immediate_context);
IDXGISwapChain_Release(runner->swapchain); IDXGISwapChain_Release(runner->swapchain);
DestroyWindow(runner->window); DestroyWindow(runner->window);
@ -594,6 +611,7 @@ static bool d3d11_runner_draw(struct shader_runner *r,
ID3D11DeviceContext_IASetPrimitiveTopology(context, primitive_topology); ID3D11DeviceContext_IASetPrimitiveTopology(context, primitive_topology);
ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0); ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0);
ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0);
ID3D11DeviceContext_RSSetState(context, runner->rasterizer_state);
ID3D11DeviceContext_Draw(context, vertex_count, 0); ID3D11DeviceContext_Draw(context, vertex_count, 0);

View File

@ -380,7 +380,7 @@ static bool d3d12_runner_draw(struct shader_runner *r,
pso_desc.PS.pShaderBytecode = ID3D10Blob_GetBufferPointer(ps_code); pso_desc.PS.pShaderBytecode = ID3D10Blob_GetBufferPointer(ps_code);
pso_desc.PS.BytecodeLength = ID3D10Blob_GetBufferSize(ps_code); pso_desc.PS.BytecodeLength = ID3D10Blob_GetBufferSize(ps_code);
pso_desc.RasterizerState.FillMode = D3D12_FILL_MODE_SOLID; pso_desc.RasterizerState.FillMode = D3D12_FILL_MODE_SOLID;
pso_desc.RasterizerState.CullMode = D3D12_CULL_MODE_BACK; pso_desc.RasterizerState.CullMode = D3D12_CULL_MODE_NONE;
pso_desc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; pso_desc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
pso_desc.SampleDesc.Count = 1; pso_desc.SampleDesc.Count = 1;
pso_desc.SampleMask = ~(UINT)0; pso_desc.SampleMask = ~(UINT)0;

View File

@ -418,6 +418,8 @@ static bool d3d9_runner_draw(struct shader_runner *r,
ok(hr == D3D_OK, "Failed to set vertex shader, hr %#lx.\n", hr); ok(hr == D3D_OK, "Failed to set vertex shader, hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetPixelShader(device, ps); hr = IDirect3DDevice9_SetPixelShader(device, ps);
ok(hr == D3D_OK, "Failed to set pixel shader, hr %#lx.\n", hr); ok(hr == D3D_OK, "Failed to set pixel shader, hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE);
ok(hr == D3D_OK, "Failed to set cull mode, hr %#lx.\n", hr);
hr = IDirect3DDevice9_BeginScene(device); hr = IDirect3DDevice9_BeginScene(device);
ok(hr == D3D_OK, "Failed to draw, hr %#lx.\n", hr); ok(hr == D3D_OK, "Failed to draw, hr %#lx.\n", hr);

View File

@ -619,7 +619,7 @@ static VkPipeline create_graphics_pipeline(const struct vulkan_shader_runner *ru
vp_desc.scissorCount = 1; vp_desc.scissorCount = 1;
vp_desc.pScissors = &rt_rect; vp_desc.pScissors = &rt_rect;
rs_desc.frontFace = VK_FRONT_FACE_CLOCKWISE; rs_desc.cullMode = VK_CULL_MODE_NONE;
rs_desc.lineWidth = 1.0f; rs_desc.lineWidth = 1.0f;
ms_desc.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT; ms_desc.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;