[Mesa-dev] [PATCH 14/37] i965: Provide means to create registers of a given size.
Iago Toral Quiroga
itoral at igalia.com
Thu Aug 14 04:11:46 PDT 2014
Implemented by Ilia Mirkin <imirkin at alum.mit.edu>.
---
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 5403f5a..d95b58d 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 1b46850..e1fbcbc 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();
--
1.9.1
More information about the mesa-dev
mailing list