summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/linker.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-04-02 13:54:06 +1100
committerTimothy Arceri <[email protected]>2016-04-02 17:10:56 +1100
commit0fbd073dc284f952ea7df691941a65ddc89b7554 (patch)
tree81861dfddfa834221dc8e3f57bb7c08839dc5de2 /src/compiler/glsl/linker.cpp
parent1265e1c4e17dec5c9931fda8b6d44a4006ed1a4c (diff)
glsl: store ubo or ssbo index in block index
Previously we store the buffer block index i.e the index of a combined ubo/ssbo list. Fixes several dEQP-GLES31.functional tests: - program_interface_query.uniform.block_index.block_array - program_interface_query.uniform.block_index.named_block - program_interface_query.uniform.block_index.unnamed_block - program_interface_query.uniform.random.10 - program_interface_query.uniform.random.15 - program_interface_query.uniform.random.22 - program_interface_query.uniform.random.24 - program_interface_query.uniform.random.26 - program_interface_query.uniform.random.28 - program_interface_query.uniform.random.3 - program_interface_query.uniform.random.31 - program_interface_query.uniform.random.38 - program_interface_query.uniform.random.5 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94116 Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/linker.cpp')
-rw-r--r--src/compiler/glsl/linker.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index f750f5b7722..d9a681ccca1 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -3804,7 +3804,9 @@ calculate_array_size_and_stride(struct gl_shader_program *shProg,
int array_stride = -1;
char *var_name = get_top_level_name(uni->name);
char *interface_name =
- get_top_level_name(shProg->BufferInterfaceBlocks[block_index].Name);
+ get_top_level_name(uni->is_shader_storage ?
+ shProg->ShaderStorageBlocks[block_index]->Name :
+ shProg->UniformBlocks[block_index]->Name);
if (strcmp(var_name, interface_name) == 0) {
/* Deal with instanced array of SSBOs */
@@ -3941,12 +3943,14 @@ build_program_resource_list(struct gl_context *ctx,
ir_var_uniform);
/* Add stagereferences for uniforms in a uniform block. */
+ bool is_shader_storage = shProg->UniformStorage[i].is_shader_storage;
int block_index = shProg->UniformStorage[i].block_index;
if (block_index != -1) {
- stageref |= shProg->BufferInterfaceBlocks[block_index].stageref;
+ stageref |= is_shader_storage ?
+ shProg->ShaderStorageBlocks[block_index]->stageref :
+ shProg->UniformBlocks[block_index]->stageref;
}
- bool is_shader_storage = shProg->UniformStorage[i].is_shader_storage;
GLenum type = is_shader_storage ? GL_BUFFER_VARIABLE : GL_UNIFORM;
if (!should_add_buffer_variable(shProg, type,
shProg->UniformStorage[i].name))