summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glsl/lower_ubo_reference.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/lower_ubo_reference.cpp b/src/glsl/lower_ubo_reference.cpp
index e581306019b..247620e6148 100644
--- a/src/glsl/lower_ubo_reference.cpp
+++ b/src/glsl/lower_ubo_reference.cpp
@@ -754,6 +754,12 @@ lower_ubo_reference_visitor::emit_access(bool is_write,
add(base_offset,
new(mem_ctx) ir_constant(deref_offset + i * matrix_stride));
if (is_write) {
+ /* If the component is not in the writemask, then don't
+ * store any value.
+ */
+ if (!((1 << i) & write_mask))
+ continue;
+
base_ir->insert_after(ssbo_store(swizzle(deref, i, 1), chan_offset, 1));
} else {
if (!this->is_shader_storage) {