From 75f3043e7405c0652c77a8bd89158a41c7173a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 11 May 2015 10:58:28 +0300 Subject: [PATCH] glsl: add stage references for UBO uniforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch marks uniforms inside UBO properly referenced by stages. Signed-off-by: Tapani Pälli Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90397 --- src/glsl/linker.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index ea73c6f..8fe2858 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 a stagereferences for uniforms inside 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; -- 2.1.0