summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_uniforms.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2016-07-02 20:02:47 +1000
committerTimothy Arceri <timothy.arceri@collabora.com>2016-07-05 20:18:05 +1000
commit51f912786f420fcfa50a3d3f1b36794cb2714be2 (patch)
tree23480caa3aebad8619ac22283afbf10fb87a9408 /src/compiler/glsl/link_uniforms.cpp
parent549b9b12fcc94f33af3968e47392f38f73bf3e7f (diff)
downloadexternal_mesa3d-51f912786f420fcfa50a3d3f1b36794cb2714be2.zip
external_mesa3d-51f912786f420fcfa50a3d3f1b36794cb2714be2.tar.gz
external_mesa3d-51f912786f420fcfa50a3d3f1b36794cb2714be2.tar.bz2
glsl: stop allocating memory for UBOs during linking
This just stops counting and assigning a storage location for these uniforms, the count is only used to create the uniform storage. These uniform types don't use this storage. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Diffstat (limited to 'src/compiler/glsl/link_uniforms.cpp')
-rw-r--r--src/compiler/glsl/link_uniforms.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index 807a8f3..dbe808f 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -403,7 +403,7 @@ private:
*/
this->num_active_uniforms++;
- if(!is_gl_identifier(name) && !is_shader_storage)
+ if(!is_gl_identifier(name) && !is_shader_storage && !is_buffer_block)
this->num_values += values;
}
@@ -767,9 +767,10 @@ private:
this->uniforms[id].is_shader_storage =
current_var->is_in_shader_storage_block();
- /* Do not assign storage if the uniform is builtin */
+ /* Do not assign storage if the uniform is a builtin or buffer object */
if (!this->uniforms[id].builtin &&
- !this->uniforms[id].is_shader_storage)
+ !this->uniforms[id].is_shader_storage &&
+ this->buffer_block_index == -1)
this->uniforms[id].storage = this->values;
if (this->buffer_block_index != -1) {
@@ -823,7 +824,8 @@ private:
}
if (!this->uniforms[id].builtin &&
- !this->uniforms[id].is_shader_storage)
+ !this->uniforms[id].is_shader_storage &&
+ this->buffer_block_index == -1)
this->values += values_for_type(type);
}
@@ -1257,7 +1259,8 @@ link_assign_uniform_locations(struct gl_shader_program *prog,
#ifndef NDEBUG
for (unsigned i = 0; i < num_uniforms; i++) {
assert(uniforms[i].storage != NULL || uniforms[i].builtin ||
- uniforms[i].is_shader_storage);
+ uniforms[i].is_shader_storage ||
+ uniforms[i].block_index != -1);
}
assert(parcel.values == data_end);