summaryrefslogtreecommitdiffstats
path: root/src/glsl/linker.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-01-22 01:09:16 -0500
committerIan Romanick <[email protected]>2013-01-25 09:07:36 -0500
commit514f8c7ec7cc1ab18be93cebb5b9bf970b1955a9 (patch)
tree7dd462bc3360ff2fced2186fc65550ccb6603fda /src/glsl/linker.cpp
parent0ab7399822b480f6e07cc566a2e50fabedc8258d (diff)
glsl: Calculate UBO data at link-time
Use the function added in the previous commit. This temporarily causes gles3conform uniform_buffer_object_index_of_not_active_block, uniform_buffer_object_inherit_and_override_layouts, and uniform_buffer_object_repeat_global_scope_layouts to assertion fail. This is fixed in the next commit. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r--src/glsl/linker.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index a480dd0523f..63ce178f44c 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -873,7 +873,6 @@ link_intrastage_shaders(void *mem_ctx,
unsigned num_shaders)
{
struct gl_uniform_block *uniform_blocks = NULL;
- unsigned num_uniform_blocks = 0;
/* Check that global variables defined in multiple shaders are consistent.
*/
@@ -881,23 +880,11 @@ link_intrastage_shaders(void *mem_ctx,
return NULL;
/* Check that uniform blocks between shaders for a stage agree. */
- for (unsigned i = 0; i < num_shaders; i++) {
- struct gl_shader *sh = shader_list[i];
-
- for (unsigned j = 0; j < sh->NumUniformBlocks; j++) {
- link_assign_uniform_block_offsets(sh);
-
- int index = link_cross_validate_uniform_block(mem_ctx,
- &uniform_blocks,
- &num_uniform_blocks,
- &sh->UniformBlocks[j]);
- if (index == -1) {
- linker_error(prog, "uniform block `%s' has mismatching definitions",
- sh->UniformBlocks[j].Name);
- return NULL;
- }
- }
- }
+ const int num_uniform_blocks =
+ link_uniform_blocks(mem_ctx, prog, shader_list, num_shaders,
+ &uniform_blocks);
+ if (num_uniform_blocks < 0)
+ return NULL;
/* Check that there is only a single definition of each function signature
* across all shaders.