summaryrefslogtreecommitdiff
path: root/src/compiler/glsl/lower_named_interface_blocks.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <tarceri@itsqueeze.com>2021-05-12 15:44:02 +1000
committerMarge Bot <eric+marge@anholt.net>2021-05-13 08:07:53 +0000
commit5aabc912739a99ddaee482e54b9ca3fc76a092f1 (patch)
treef4a4f774e1ab94cfe9f4e4d2ff39acf935c4fcb0 /src/compiler/glsl/lower_named_interface_blocks.cpp
parent1a71d6aa6e13179526b41e627f00af25b1612556 (diff)
downloadmesa-5aabc912739a99ddaee482e54b9ca3fc76a092f1.tar.gz
glsl: add missing support for explicit components in interface blocks
From the ARB_enhanced_layouts spec: "As with input layout qualifiers, all shaders except compute shaders allow *location* layout qualifiers on output variable declarations, output block declarations, and output block member declarations. Of these, variables and block members (but not blocks) additionally allow the *component* layout qualifier." We previously had compile tests in piglit to make sure this was not a compile error but no execution tests. Fixes: d99a040bbf2c ("i965: enable ARB_enhanced_layouts for gen8+") Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10763>
Diffstat (limited to 'src/compiler/glsl/lower_named_interface_blocks.cpp')
-rw-r--r--src/compiler/glsl/lower_named_interface_blocks.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/glsl/lower_named_interface_blocks.cpp b/src/compiler/glsl/lower_named_interface_blocks.cpp
index 01c50932a9a..98d27b7109e 100644
--- a/src/compiler/glsl/lower_named_interface_blocks.cpp
+++ b/src/compiler/glsl/lower_named_interface_blocks.cpp
@@ -180,7 +180,12 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions)
(ir_variable_mode) var->data.mode);
}
new_var->data.location = iface_t->fields.structure[i].location;
+ new_var->data.location_frac =
+ iface_t->fields.structure[i].component >= 0 ?
+ iface_t->fields.structure[i].component : 0;
new_var->data.explicit_location = (new_var->data.location >= 0);
+ new_var->data.explicit_component =
+ (iface_t->fields.structure[i].component >= 0);
new_var->data.offset = iface_t->fields.structure[i].offset;
new_var->data.explicit_xfb_offset =
(iface_t->fields.structure[i].offset >= 0);