diff options
Diffstat (limited to 'src/glsl/link_uniforms.cpp')
-rw-r--r-- | src/glsl/link_uniforms.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 8014a3d9a99..cfb23effcf7 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -513,7 +513,7 @@ private: virtual void visit_field(const glsl_type *type, const char *name, bool row_major, const glsl_type *record_type, - bool /* last_field */) + bool last_field) { assert(!type->without_array()->is_record()); assert(!type->without_array()->is_interface()); @@ -582,6 +582,9 @@ private: this->uniforms[id].offset = this->ubo_byte_offset; this->ubo_byte_offset += type->std140_size(ubo_row_major); + if (last_field) + this->ubo_byte_offset = glsl_align(this->ubo_byte_offset, 16); + if (type->is_array()) { this->uniforms[id].array_stride = glsl_align(type->fields.array->std140_size(ubo_row_major), 16); |