From 6d1d15183f1fb0729e4858cda6945441e73bd8c4 Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Tue, 26 Nov 2024 20:33:41 +0100 Subject: [PATCH] nir/tests: Improve shader creation Sets some fields so they are not printed and allows specifying a stage. This decreases the size of reference shaders. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/tests/nir_test.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/tests/nir_test.h b/src/compiler/nir/tests/nir_test.h index 151071424e6..8639281eb77 100644 --- a/src/compiler/nir/tests/nir_test.h +++ b/src/compiler/nir/tests/nir_test.h @@ -14,11 +14,19 @@ class nir_test : public ::testing::Test { protected: nir_test(const char *name) + : nir_test(name, MESA_SHADER_COMPUTE) + { + } + + nir_test(const char *name, gl_shader_stage stage) { glsl_type_singleton_init_or_ref(); - _b = nir_builder_init_simple_shader(MESA_SHADER_COMPUTE, &options, "%s", name); + _b = nir_builder_init_simple_shader(stage, &options, "%s", name); b = &_b; + + b->shader->info.next_stage = MESA_SHADER_NONE; + b->shader->info.internal = false; } virtual ~nir_test()