[PATCH vkd3d 7/8] tests: Specify the primitive type from the shader runner frontend.
Zebediah Figura
zfigura at codeweavers.com
Mon Mar 21 20:42:20 CDT 2022
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
tests/shader_runner.c | 2 +-
tests/shader_runner.h | 2 +-
tests/shader_runner_d3d11.c | 5 +++--
tests/shader_runner_d3d12.c | 5 +++--
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c
index 04819c7d3..c3f967a2e 100644
--- a/tests/shader_runner.c
+++ b/tests/shader_runner.c
@@ -334,7 +334,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
if (!runner->vs_source)
runner->vs_source = strdup(vs_source);
- runner->ops->draw(runner, 3);
+ runner->ops->draw(runner, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, 3);
}
else if (match_string(line, "probe all rgba", &line))
{
diff --git a/tests/shader_runner.h b/tests/shader_runner.h
index 7e29873c4..a98917c5f 100644
--- a/tests/shader_runner.h
+++ b/tests/shader_runner.h
@@ -112,7 +112,7 @@ struct shader_runner_ops
{
struct resource *(*create_resource)(struct shader_runner *runner, const struct resource_params *params);
void (*destroy_resource)(struct shader_runner *runner, struct resource *resource);
- void (*draw)(struct shader_runner *runner, unsigned int vertex_count);
+ void (*draw)(struct shader_runner *runner, D3D_PRIMITIVE_TOPOLOGY primitive_topology, unsigned int vertex_count);
void (*probe_vec4)(struct shader_runner *runner, const RECT *rect, const struct vec4 *v, unsigned int ulps);
};
diff --git a/tests/shader_runner_d3d11.c b/tests/shader_runner_d3d11.c
index f2181ffc0..93904a648 100644
--- a/tests/shader_runner_d3d11.c
+++ b/tests/shader_runner_d3d11.c
@@ -423,7 +423,8 @@ static void d3d11_runner_destroy_resource(struct shader_runner *r, struct resour
free(resource);
}
-static void d3d11_runner_draw(struct shader_runner *r, unsigned int vertex_count)
+static void d3d11_runner_draw(struct shader_runner *r,
+ D3D_PRIMITIVE_TOPOLOGY primitive_topology, unsigned int vertex_count)
{
struct d3d11_shader_runner *runner = d3d11_shader_runner(r);
ID3D11DeviceContext *context = runner->immediate_context;
@@ -525,7 +526,7 @@ static void d3d11_runner_draw(struct shader_runner *r, unsigned int vertex_count
ID3D11InputLayout_Release(input_layout);
}
- ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
+ ID3D11DeviceContext_IASetPrimitiveTopology(context, primitive_topology);
ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0);
ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0);
diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c
index 2dda6a75b..06221691e 100644
--- a/tests/shader_runner_d3d12.c
+++ b/tests/shader_runner_d3d12.c
@@ -132,7 +132,8 @@ static void d3d12_runner_destroy_resource(struct shader_runner *r, struct resour
free(resource);
}
-static void d3d12_runner_draw(struct shader_runner *r, unsigned int vertex_count)
+static void d3d12_runner_draw(struct shader_runner *r,
+ D3D_PRIMITIVE_TOPOLOGY primitive_topology, unsigned int vertex_count)
{
struct d3d12_shader_runner *runner = d3d12_shader_runner(r);
struct test_context *test_context = &runner->test_context;
@@ -291,7 +292,7 @@ static void d3d12_runner_draw(struct shader_runner *r, unsigned int vertex_count
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &test_context->rtv, false, NULL);
ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &test_context->scissor_rect);
ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &test_context->viewport);
- ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
+ ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, primitive_topology);
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, test_context->rtv, clear_color, 0, NULL);
ID3D12GraphicsCommandList_SetPipelineState(command_list, pso);
ID3D12GraphicsCommandList_DrawInstanced(command_list, vertex_count, 1, 0, 0);
--
2.35.1
More information about the wine-devel
mailing list