summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_uniform_initializers.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2015-09-30 11:00:02 +1000
committerTimothy Arceri <[email protected]>2015-10-05 10:53:24 +1100
commit763cd8c080353482cb41da578cb3d6f7892a0c9f (patch)
treedff9ba9c0e6a4ebc0e706d578fe5313bc1cbda4f /src/glsl/link_uniform_initializers.cpp
parentb85757bc72350df609f50e000512bc80d07f1497 (diff)
glsl: reduce memory footprint of uniform_storage struct
The uniform will only be of a single type so store the data for opaque types in a single array. Cc: Francisco Jerez <[email protected]> Cc: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/glsl/link_uniform_initializers.cpp')
-rw-r--r--src/glsl/link_uniform_initializers.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/glsl/link_uniform_initializers.cpp b/src/glsl/link_uniform_initializers.cpp
index 34830829b4a..0918d2af9b8 100644
--- a/src/glsl/link_uniform_initializers.cpp
+++ b/src/glsl/link_uniform_initializers.cpp
@@ -134,16 +134,16 @@ set_opaque_binding(gl_shader_program *prog, const char *name, int binding)
if (shader) {
if (storage->type->base_type == GLSL_TYPE_SAMPLER &&
- storage->sampler[sh].active) {
+ storage->opaque[sh].active) {
for (unsigned i = 0; i < elements; i++) {
- const unsigned index = storage->sampler[sh].index + i;
+ const unsigned index = storage->opaque[sh].index + i;
shader->SamplerUnits[index] = storage->storage[i].i;
}
} else if (storage->type->base_type == GLSL_TYPE_IMAGE &&
- storage->image[sh].active) {
+ storage->opaque[sh].active) {
for (unsigned i = 0; i < elements; i++) {
- const unsigned index = storage->image[sh].index + i;
+ const unsigned index = storage->opaque[sh].index + i;
shader->ImageUnits[index] = storage->storage[i].i;
}
}
@@ -243,8 +243,8 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) {
gl_shader *shader = prog->_LinkedShaders[sh];
- if (shader && storage->sampler[sh].active) {
- unsigned index = storage->sampler[sh].index;
+ if (shader && storage->opaque[sh].active) {
+ unsigned index = storage->opaque[sh].index;
shader->SamplerUnits[index] = storage->storage[0].i;
}