[Mesa-dev] [PATCH 0/2] v2: Fix array overrun with too many uniforms

Petri Latvala petri.latvala at intel.com
Fri Nov 22 00:09:10 PST 2013


Second attempt at fixing
https://bugs.freedesktop.org/show_bug.cgi?id=71254

vec4_visitor::uniform_size and vec4_visitor::uniform_vector_size are
now allocated dynamically based on param_count from do_vs_prog.

I also made vec4_visitor noncopyable. It is not copied currently, and
to my understanding copying it would be nonsense anyway.

The passed param_count is saved in vec4_visitor for the asserts in
patch 2. That could be wrapped in #ifndef NDEBUG but I wasn't sure
whether that is desired. It would change the ABI for that class
depending on compile flags, but the only use for it is internal.


Petri Latvala (2):
  i965: Allocate vec4_visitor's uniform_size and uniform_vector_size
    arrays     dynamically.
  i965: Assert array index on access to vec4_visitor's arrays.

 src/mesa/drivers/dri/i965/brw_vec4.cpp            |  5 +++--
 src/mesa/drivers/dri/i965/brw_vec4.h              | 14 +++++++++++---
 src/mesa/drivers/dri/i965/brw_vec4_gs.c           |  2 +-
 src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp | 12 +++++++-----
 src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h   |  6 ++++--
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp    | 13 ++++++++++++-
 src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp |  6 ++++--
 src/mesa/drivers/dri/i965/brw_vs.c                |  2 +-
 src/mesa/drivers/dri/i965/brw_vs.h                |  6 ++++--
 9 files changed, 47 insertions(+), 19 deletions(-)

-- 
1.8.4.rc3



More information about the mesa-dev mailing list