diff options
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index b0527c7b31..0afff6f72c 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -1197,6 +1197,11 @@ vec4_visitor::lower_attributes_to_hw_regs(const int *attribute_map) if (inst->dst.file == ATTR) { int grf = attribute_map[inst->dst.reg + inst->dst.reg_offset]; + /* All attributes used in the shader need to have been assigned a + * hardware register by the caller + */ + assert(grf != 0); + struct brw_reg reg = brw_vec8_grf(grf, 0); reg.type = inst->dst.type; reg.dw1.bits.writemask = inst->dst.writemask; @@ -1211,6 +1216,11 @@ vec4_visitor::lower_attributes_to_hw_regs(const int *attribute_map) int grf = attribute_map[inst->src[i].reg + inst->src[i].reg_offset]; + /* All attributes used in the shader need to have been assigned a + * hardware register by the caller + */ + assert(grf != 0); + struct brw_reg reg = brw_vec8_grf(grf, 0); reg.dw1.bits.swizzle = inst->src[i].swizzle; reg.type = inst->src[i].type; @@ -1230,6 +1240,7 @@ vec4_vs_visitor::setup_attributes(int payload_reg) { int nr_attributes; int attribute_map[VERT_ATTRIB_MAX + 1]; + memset(attribute_map, 0, sizeof(attribute_map)); nr_attributes = 0; for (int i = 0; i < VERT_ATTRIB_MAX; i++) { |