[Mesa-dev] [PATCH 0/3] Fix racy full-vector writes for v[i].x

Kristian Høgsberg Kristensen krh at bitplanet.net
Wed Nov 4 15:33:51 PST 2015


This little series fixes a problem where we lower

  v[i] = s

to

  v = vector_insert(v, s, i)

turning a component write into a full vector write. This used to be
ok, since none of this was visible to other threads.  Now with SSBOs
(and compute shader SLM and tesselation outputs) this rewrite is racy
and we have to handle this different in case the vector is in globally
visible storage.

Kristian Høgsberg Kristensen (3):
  glsl: Drop exec_list argument to lower_ubo_reference
  glsl: Lower UBO and SSBO access in glsl linker
  glsl: Use array deref for access to vector components

 src/glsl/Makefile.sources                  |   1 +
 src/glsl/ast_array_index.cpp               |   5 +-
 src/glsl/ast_function.cpp                  |  24 ++-----
 src/glsl/ast_to_hir.cpp                    |  43 ------------
 src/glsl/ir_optimization.h                 |   3 +-
 src/glsl/ir_validate.cpp                   |   7 +-
 src/glsl/linker.cpp                        |  10 +++
 src/glsl/lower_ubo_reference.cpp           |  18 ++++-
 src/glsl/lower_vector_derefs.cpp           | 104 +++++++++++++++++++++++++++++
 src/glsl/opt_dead_code_local.cpp           |   2 +
 src/mesa/drivers/dri/i965/brw_link.cpp     |   2 -
 src/mesa/drivers/dri/i965/brw_shader.cpp   |   2 +
 src/mesa/main/mtypes.h                     |   2 +
 src/mesa/state_tracker/st_extensions.c     |   1 +
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |   1 -
 15 files changed, 151 insertions(+), 74 deletions(-)
 create mode 100644 src/glsl/lower_vector_derefs.cpp

-- 
2.6.2



More information about the mesa-dev mailing list