[Mesa-dev] [PATCH 2/6] i965/vs: Fix variable indexed array access with more than one array.

Eric Anholt eric at anholt.net
Wed Sep 7 13:03:33 PDT 2011


The offset to the arrays after the first was mis-scaled, so we'd go
access off the end of the surface and read 0s.  Fixes
glsl-vs-uniform-array-3.
---
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index dede903..833349a 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2217,7 +2217,7 @@ vec4_visitor::move_uniform_array_access_to_pull_constants()
 	 if (pull_constant_loc[uniform] == -1) {
 	    const float **values = &prog_data->param[uniform * 4];
 
-	    pull_constant_loc[uniform] = prog_data->nr_pull_params;
+	    pull_constant_loc[uniform] = prog_data->nr_pull_params / 4;
 
 	    for (int j = 0; j < uniform_size[uniform] * 4; j++) {
 	       prog_data->pull_param[prog_data->nr_pull_params++] = values[j];
-- 
1.7.5.4



More information about the mesa-dev mailing list