diff options
author | Eric Anholt <[email protected]> | 2012-05-01 14:43:31 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-07-20 10:43:59 -0700 |
commit | 9feb403b0eb5365889cb01ca456a19247aaad502 (patch) | |
tree | 832ed7869c4f4a89692943fd16ad5bd09528d0af /src/glsl/linker.cpp | |
parent | 0cea8a56b627cea297e4213266b57b7a1085dcca (diff) |
glsl: Don't resize arrays in uniform blocks.
This is a requirement for std140 uniform blocks, and optional for
packed/shared blocks.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r-- | src/glsl/linker.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 7fbd834ab66..dd2278545d8 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -1165,6 +1165,13 @@ update_array_sizes(struct gl_shader_program *prog) !var->type->is_array()) continue; + /* GL_ARB_uniform_buffer_object says that std140 uniforms + * will not be eliminated. Since we always do std140, just + * don't resize arrays in UBOs. + */ + if (var->uniform_block != -1) + continue; + unsigned int size = var->max_array_access; for (unsigned j = 0; j < MESA_SHADER_TYPES; j++) { if (prog->_LinkedShaders[j] == NULL) |