mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 04:00:10 +01:00
brw: Add explicit way to get an empty brw_builder
And use brw_builder(brw_shader *) and brw_builder() constructors where possible. The way tests are written, it is necessary to initialize an "empty" builder -- which is later replaced by a proper one. Default parameter NULL make that initialization implicit. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
This commit is contained in:
parent
32e562ae01
commit
6f37e6f104
7 changed files with 9 additions and 7 deletions
|
|
@ -50,7 +50,14 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
explicit brw_builder(brw_shader *s) : brw_builder(s, s->dispatch_width) {}
|
||||
/**
|
||||
* Construct an brw_builder that inserts instructions into \p shader,
|
||||
* using its dispatch width.
|
||||
*/
|
||||
explicit brw_builder(brw_shader *s = NULL) :
|
||||
brw_builder(s, s ? s->dispatch_width : 0)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct an brw_builder that inserts instructions before
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ protected:
|
|||
};
|
||||
|
||||
scoreboard_test::scoreboard_test()
|
||||
: bld(NULL, 0)
|
||||
{
|
||||
ctx = ralloc_context(NULL);
|
||||
compiler = rzalloc(ctx, struct brw_compiler);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ protected:
|
|||
};
|
||||
|
||||
cmod_propagation_test::cmod_propagation_test()
|
||||
: bld(NULL, 0)
|
||||
{
|
||||
ctx = ralloc_context(NULL);
|
||||
compiler = rzalloc(ctx, struct brw_compiler);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ struct FSCombineConstantsTest : public ::testing::Test {
|
|||
static brw_builder
|
||||
make_builder(brw_shader *s)
|
||||
{
|
||||
return brw_builder(s, s->dispatch_width).at_end();
|
||||
return brw_builder(s).at_end();
|
||||
}
|
||||
|
||||
TEST_F(FSCombineConstantsTest, Simple)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ protected:
|
|||
};
|
||||
|
||||
copy_propagation_test::copy_propagation_test()
|
||||
: bld(NULL, 0)
|
||||
{
|
||||
ctx = ralloc_context(NULL);
|
||||
compiler = rzalloc(ctx, struct brw_compiler);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ protected:
|
|||
};
|
||||
|
||||
cse_test::cse_test()
|
||||
: bld(NULL, 0)
|
||||
{
|
||||
ctx = ralloc_context(NULL);
|
||||
compiler = rzalloc(ctx, struct brw_compiler);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ protected:
|
|||
};
|
||||
|
||||
saturate_propagation_test::saturate_propagation_test()
|
||||
: bld(NULL, 0)
|
||||
{
|
||||
ctx = ralloc_context(NULL);
|
||||
compiler = rzalloc(ctx, struct brw_compiler);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue