i965/vec4: Add a new dst_reg constructor accepting a brw_reg_type

This is useful for the upcoming texture support in NIR->vec4 pass,
as we found several cases where the brw_type is available, but not
the glsl_type.

Without this new constructor, the alternative would be:
dst_reg reg(MRF, <reg>)
reg.type = <brw_type>
reg.writemask = <mask>

Adding a new constructor makes code easier to read.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
Alejandro Piñeiro 2015-05-23 23:42:58 +02:00 committed by Jason Ekstrand
parent c15eea2afa
commit 0d43d27df7
2 changed files with 13 additions and 0 deletions

View File

@ -113,6 +113,8 @@ public:
dst_reg(register_file file, int reg);
dst_reg(register_file file, int reg, const glsl_type *type,
unsigned writemask);
dst_reg(register_file file, int reg, brw_reg_type type,
unsigned writemask);
dst_reg(struct brw_reg reg);
dst_reg(class vec4_visitor *v, const struct glsl_type *type);

View File

@ -171,6 +171,17 @@ dst_reg::dst_reg(register_file file, int reg, const glsl_type *type,
this->writemask = writemask;
}
dst_reg::dst_reg(register_file file, int reg, brw_reg_type type,
unsigned writemask)
{
init();
this->file = file;
this->reg = reg;
this->type = type;
this->writemask = writemask;
}
dst_reg::dst_reg(struct brw_reg reg)
{
init();