mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
glsl/ir_factory: Add helper method for making an ir_constant
Add method ir_factory::constant. This little method constructs an ir_constant using the factory's mem_ctx. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
This commit is contained in:
parent
5790174e37
commit
a6479ef968
1 changed files with 24 additions and 0 deletions
|
|
@ -83,6 +83,30 @@ public:
|
|||
void emit(ir_instruction *ir);
|
||||
ir_variable *make_temp(const glsl_type *type, const char *name);
|
||||
|
||||
ir_constant*
|
||||
constant(float f)
|
||||
{
|
||||
return new(mem_ctx) ir_constant(f);
|
||||
}
|
||||
|
||||
ir_constant*
|
||||
constant(int i)
|
||||
{
|
||||
return new(mem_ctx) ir_constant(i);
|
||||
}
|
||||
|
||||
ir_constant*
|
||||
constant(unsigned u)
|
||||
{
|
||||
return new(mem_ctx) ir_constant(u);
|
||||
}
|
||||
|
||||
ir_constant*
|
||||
constant(bool b)
|
||||
{
|
||||
return new(mem_ctx) ir_constant(b);
|
||||
}
|
||||
|
||||
exec_list *instructions;
|
||||
void *mem_ctx;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue