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 <ian.d.romanick@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
+5
-18
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user