diff options
author | Jason Ekstrand <[email protected]> | 2016-05-18 20:28:07 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-05-23 19:12:34 -0700 |
commit | 27b9481d03959a7bee6d906c62b4a519b6b1dc38 (patch) | |
tree | 4578aca510eef5c8e2e27a00f83d7791377e3dd4 /src/compiler/glsl/linker.cpp | |
parent | ac242aac3d2c38fd6843d85363a455271b1348c2 (diff) |
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 <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/linker.cpp')
-rw-r--r-- | src/compiler/glsl/linker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 89cd9f795cc..3d95540256c 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -4906,7 +4906,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) &ctx->Const.ShaderCompilerOptions[i]; if (options->LowerBufferInterfaceBlocks) - lower_ubo_reference(prog->_LinkedShaders[i]); + lower_ubo_reference(prog->_LinkedShaders[i], + options->ClampBlockIndicesToArrayBounds); if (options->LowerShaderSharedVariables) lower_shared_reference(prog->_LinkedShaders[i], |