diff options
author | Tapani Pälli <[email protected]> | 2015-05-11 13:24:20 +0300 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2015-05-18 15:23:09 +0300 |
commit | 9f4eaba36f002f4ea86bc11fd3d0f8dce485b9d8 (patch) | |
tree | 115e4b470932c91ff62f8f0484a9f9c81d789c0b | |
parent | 845ad2667ab2466752f06ea30bdb9c837116c308 (diff) |
glsl: add stage references for UBO uniforms
Patch marks uniforms inside UBO properly referenced by stages.
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Samuel Iglesias Gonsalvez <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90397
-rw-r--r-- | src/glsl/linker.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index ea73c6f9da1..ecdc025710f 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -2700,6 +2700,16 @@ build_program_resource_list(struct gl_context *ctx, uint8_t stageref = build_stageref(shProg, shProg->UniformStorage[i].name); + + /* Add stagereferences for uniforms in a uniform block. */ + int block_index = shProg->UniformStorage[i].block_index; + if (block_index != -1) { + for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) { + if (shProg->UniformBlockStageIndex[j][block_index] != -1) + stageref |= (1 << j); + } + } + if (!add_program_resource(shProg, GL_UNIFORM, &shProg->UniformStorage[i], stageref)) return; |