summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_uniforms.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2016-01-08 21:06:41 +1100
committerTimothy Arceri <timothy.arceri@collabora.com>2016-03-05 19:38:44 +1100
commit96527c3cf29acaa74a0e7b8624f29e514a76e42e (patch)
tree8f0c3e44b5c834a17449a7243c65fa0c7f10c427 /src/compiler/glsl/link_uniforms.cpp
parente12a49ac1289ab7fbac92761cde1534f042103cd (diff)
downloadexternal_mesa3d-96527c3cf29acaa74a0e7b8624f29e514a76e42e.zip
external_mesa3d-96527c3cf29acaa74a0e7b8624f29e514a76e42e.tar.gz
external_mesa3d-96527c3cf29acaa74a0e7b8624f29e514a76e42e.tar.bz2
glsl: copy explicit offset to uniform storage
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/compiler/glsl/link_uniforms.cpp')
-rw-r--r--src/compiler/glsl/link_uniforms.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index deaba94..fb915c9 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -194,6 +194,9 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
if (t->fields.structure[i].type->is_record())
this->visit_field(&t->fields.structure[i]);
+ if (t->is_interface() && t->fields.structure[i].offset != -1)
+ this->set_buffer_offset(t->fields.structure[i].offset);
+
/* Append '.field' to the current variable name. */
if (name_length == 0) {
ralloc_asprintf_rewrite_tail(name, &new_length, "%s", field);
@@ -298,6 +301,11 @@ program_resource_visitor::leave_record(const glsl_type *, const char *, bool,
}
void
+program_resource_visitor::set_buffer_offset(unsigned)
+{
+}
+
+void
program_resource_visitor::set_record_array_count(unsigned)
{
}
@@ -676,6 +684,11 @@ private:
}
}
+ virtual void set_buffer_offset(unsigned offset)
+ {
+ this->ubo_byte_offset = offset;
+ }
+
virtual void set_record_array_count(unsigned record_array_count)
{
this->record_array_count = record_array_count;