summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_uniforms.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2015-03-23 06:32:08 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2015-03-24 10:10:13 -0400
commitbaa22c8825133a69fd0657f09d2a027236233eb1 (patch)
treef0a2a8210509d245c6586be5cb3a199ce3db0533 /src/glsl/link_uniforms.cpp
parent43277fcd59b163a8bdd00d7875557bb71ecf48ff (diff)
downloadexternal_mesa3d-baa22c8825133a69fd0657f09d2a027236233eb1.zip
external_mesa3d-baa22c8825133a69fd0657f09d2a027236233eb1.tar.gz
external_mesa3d-baa22c8825133a69fd0657f09d2a027236233eb1.tar.bz2
glsl: avoid calling base_alignment when samplers are involved
Earlier commit 53bf7c8fd2e changed the logic to always call base_alignment on structs. 1ec715ce8b12 hacked the function to return 0 for sampler fields, but didn't handle sampler arrays. Instead of extending the hack, avoid calling base_alignment in the first place on non-UBO uniforms. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89726 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Tapani Palli <tapani.palli@intel.com>
Diffstat (limited to 'src/glsl/link_uniforms.cpp')
-rw-r--r--src/glsl/link_uniforms.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index 799c74b..59adc29 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -547,6 +547,8 @@ private:
virtual void enter_record(const glsl_type *type, const char *name,
bool row_major) {
assert(type->is_record());
+ if (this->ubo_block_index == -1)
+ return;
this->ubo_byte_offset = glsl_align(
this->ubo_byte_offset, type->std140_base_alignment(row_major));
}
@@ -554,6 +556,8 @@ private:
virtual void leave_record(const glsl_type *type, const char *name,
bool row_major) {
assert(type->is_record());
+ if (this->ubo_block_index == -1)
+ return;
this->ubo_byte_offset = glsl_align(
this->ubo_byte_offset, type->std140_base_alignment(row_major));
}