[Mesa-dev] [PATCH 3/6] glsl: fix UBO and SSBO stage ref query

Timothy Arceri timothy.arceri at collabora.com
Sun Apr 3 11:16:30 UTC 2016


Index is the block index so we need to lookup the reference in the
separate arrays not the combined buffer block array.
---
 src/mesa/main/shader_query.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 4ef6a81..1f36dae 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -925,8 +925,11 @@ is_resource_referenced(struct gl_shader_program *shProg,
    if (res->Type == GL_ATOMIC_COUNTER_BUFFER)
       return RESOURCE_ATC(res)->StageReferences[stage];
 
-   if (res->Type == GL_UNIFORM_BLOCK || res->Type == GL_SHADER_STORAGE_BLOCK)
-      return shProg->BufferInterfaceBlocks[index].stageref & (1 << stage);
+   if (res->Type == GL_UNIFORM_BLOCK)
+      return shProg->UniformBlocks[index]->stageref & (1 << stage);
+
+   if (res->Type == GL_SHADER_STORAGE_BLOCK)
+      return shProg->ShaderStorageBlocks[index]->stageref & (1 << stage);
 
    return res->StageReferences & (1 << stage);
 }
-- 
2.5.5



More information about the mesa-dev mailing list