glsl: Add an option to clamp block indices when lowering UBO/SSBOs
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 19 May 2016 03:28:07 +0000 (20:28 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 24 May 2016 02:12:34 +0000 (19:12 -0700)
commit27b9481d03959a7bee6d906c62b4a519b6b1dc38
tree4578aca510eef5c8e2e27a00f83d7791377e3dd4
parentac242aac3d2c38fd6843d85363a455271b1348c2
glsl: Add an option to clamp block indices when lowering UBO/SSBOs

This prevents array overflow when the block is actually an array of UBOs or
SSBOs.  On some hardware such as i965, such overflows can cause GPU hangs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/ir_optimization.h
src/compiler/glsl/linker.cpp
src/compiler/glsl/lower_ubo_reference.cpp
src/mesa/drivers/dri/i965/brw_compiler.c
src/mesa/main/mtypes.h