From 9b32fd0f704cf34172d3fd85934bfff7a6f77753 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Wed, 16 Jul 2014 10:00:34 +0200 Subject: [PATCH] i965: Provide means to create registers of a given size. Implemented by Ilia Mirkin . Acked-by: Kenneth Graunke Reviewed-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_vec4.h | 1 + src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index 82e91a9a503..9fb9d8a6a98 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_vec4.h @@ -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); diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index 473b3c53336..3c3e06026b3 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -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(); -- 2.30.2