Module: Mesa
Branch: master
Commit: 27c03cb86aa9149d001eefb3cf1e67a97f5bc886
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=27c03cb86aa9149d001eefb3cf1e67a97f5bc886

Author: Eric Anholt <e...@anholt.net>
Date:   Tue Sep  6 17:46:25 2011 -0700

i965/vs: Fix variable indexed array access with more than one array.

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.

Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
Acked-by: Kenneth Graunke <kenn...@whitecape.org>

---

 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 afbd8d9..c50a722 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2211,7 +2211,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];

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to