i965: Provide means to create registers of a given size.

Implemented by Ilia Mirkin <imirkin@alum.mit.edu>.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
Iago Toral Quiroga 2014-07-16 10:00:34 +02:00
parent f373b7ed82
commit 9b32fd0f70
2 changed files with 15 additions and 0 deletions

View file

@ -107,6 +107,7 @@ public:
bool equals(const src_reg &r) const;
src_reg(class vec4_visitor *v, const struct glsl_type *type);
src_reg(class vec4_visitor *v, const struct glsl_type *type, int size);
explicit src_reg(dst_reg reg);

View file

@ -639,6 +639,20 @@ src_reg::src_reg(class vec4_visitor *v, const struct glsl_type *type)
this->type = brw_type_for_base_type(type);
}
src_reg::src_reg(class vec4_visitor *v, const struct glsl_type *type, int size)
{
assert(size > 0);
init();
this->file = GRF;
this->reg = v->virtual_grf_alloc(type_size(type) * size);
this->swizzle = BRW_SWIZZLE_NOOP;
this->type = brw_type_for_base_type(type);
}
dst_reg::dst_reg(class vec4_visitor *v, const struct glsl_type *type)
{
init();