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 <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32644>
This commit is contained in:
Konstantin Seurer 2024-11-26 20:33:41 +01:00 committed by Marge Bot
parent 305be9cf5e
commit 6d1d15183f

View file

@ -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()