From 0fbd073dc284f952ea7df691941a65ddc89b7554 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Sat, 2 Apr 2016 13:54:06 +1100 Subject: 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 --- src/compiler/glsl/linker.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/compiler/glsl/linker.cpp') 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)) -- cgit v1.2.3