[Mesa-dev] [PATCH 0/2] Fix array overrun on too many uniforms

Petri Latvala petri.latvala at intel.com
Fri Nov 8 03:14:47 PST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=71254

vec4_visitor has two arrays, uniform_size and
uniform_vector_size. Their size is set to MAX_UNIFORMS, which is the
number of uniform vec4s. The size should be the number of uniform
components instead.

When testing this fix (testcase shader attached in the bug), you'll
need to set the stack limit to bigger than the default 8MB. 16MB was
enough for the testcase shader. I verified that with this fix correct
error message is given with 17000 uniforms, and compiling a shader
with 15000 uniforms works, although it took 5 minutes to compile.

Petri Latvala (2):
  Increase array sizes to what they should be.
  Check access to vec4_visitor's arrays

 src/mesa/drivers/dri/i965/brw_vec4.cpp         | 3 +++
 src/mesa/drivers/dri/i965/brw_vec4.h           | 4 ++--
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 6 ++++++
 src/mesa/drivers/dri/i965/brw_vec4_vp.cpp      | 1 +
 4 files changed, 12 insertions(+), 2 deletions(-)

-- 
1.8.4.rc3



More information about the mesa-dev mailing list