Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- tests/shader_runner.c | 7 ++++++- tests/shader_runner.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 0ad2d56c7..bcf863f66 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -595,11 +595,15 @@ void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const { case STATE_INPUT_LAYOUT: case STATE_NONE: - case STATE_REQUIRE: case STATE_SAMPLER: case STATE_TEST: break;
+ case STATE_REQUIRE: + if (runner->ops->check_requirements && !runner->ops->check_requirements(runner)) + goto out; + break; + case STATE_TEXTURE: case STATE_VERTEX_BUFFER: set_resource(runner, runner->ops->create_resource(runner, ¤t_resource)); @@ -832,6 +836,7 @@ void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const } }
+out: for (i = 0; i < runner->input_element_count; ++i) free(runner->input_elements[i].name); free(runner->input_elements); diff --git a/tests/shader_runner.h b/tests/shader_runner.h index a98917c5f..a304ba919 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -110,6 +110,9 @@ struct shader_runner
struct shader_runner_ops { + /* Returns false if unable to run the given tests. If NULL, all tests are + * run. */ + bool (*check_requirements)(struct shader_runner *runner); 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, D3D_PRIMITIVE_TOPOLOGY primitive_topology, unsigned int vertex_count);