Mesa (master): glsl: remove unused link_assign_uniform_block_offsets
Tapani Pälli
tpalli at kemper.freedesktop.org
Fri Sep 26 05:29:44 UTC 2014
Module: Mesa
Branch: master
Commit: 9caa5c3b130787587c21867c1b5b300d6dee5d5c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9caa5c3b130787587c21867c1b5b300d6dee5d5c
Author: Tapani Pälli <tapani.palli at intel.com>
Date: Wed Sep 24 14:09:23 2014 +0300
glsl: remove unused link_assign_uniform_block_offsets
ubo offsets are assigned by link_uniform_blocks since 514f8c7e
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/glsl/link_uniforms.cpp | 34 ----------------------------------
src/glsl/linker.h | 3 ---
2 files changed, 37 deletions(-)
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index a6683a0..400e134 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -771,40 +771,6 @@ link_update_uniform_buffer_variables(struct gl_shader *shader)
}
}
-void
-link_assign_uniform_block_offsets(struct gl_shader *shader)
-{
- for (unsigned b = 0; b < shader->NumUniformBlocks; b++) {
- struct gl_uniform_block *block = &shader->UniformBlocks[b];
-
- unsigned offset = 0;
- for (unsigned int i = 0; i < block->NumUniforms; i++) {
- struct gl_uniform_buffer_variable *ubo_var = &block->Uniforms[i];
- const struct glsl_type *type = ubo_var->Type;
-
- unsigned alignment = type->std140_base_alignment(ubo_var->RowMajor);
- unsigned size = type->std140_size(ubo_var->RowMajor);
-
- offset = glsl_align(offset, alignment);
- ubo_var->Offset = offset;
- offset += size;
- }
-
- /* From the GL_ARB_uniform_buffer_object spec:
- *
- * "For uniform blocks laid out according to [std140] rules,
- * the minimum buffer object size returned by the
- * UNIFORM_BLOCK_DATA_SIZE query is derived by taking the
- * offset of the last basic machine unit consumed by the
- * last uniform of the uniform block (including any
- * end-of-array or end-of-structure padding), adding one,
- * and rounding up to the next multiple of the base
- * alignment required for a vec4."
- */
- block->UniformBufferSize = glsl_align(offset, 16);
- }
-}
-
/**
* Scan the program for image uniforms and store image unit access
* information into the gl_shader data structure.
diff --git a/src/glsl/linker.h b/src/glsl/linker.h
index 9440794..6ee5858 100644
--- a/src/glsl/linker.h
+++ b/src/glsl/linker.h
@@ -50,9 +50,6 @@ link_cross_validate_uniform_block(void *mem_ctx,
unsigned int *num_linked_blocks,
struct gl_uniform_block *new_block);
-void
-link_assign_uniform_block_offsets(struct gl_shader *shader);
-
extern bool
link_uniform_blocks_are_compatible(const gl_uniform_block *a,
const gl_uniform_block *b);
More information about the mesa-commit
mailing list