[Mesa-dev] [PATCH 04/26] spirv/nir: fill up nir variable info for ubos and ssbo

Alejandro PiƱeiro apinheiro at igalia.com
Sat Sep 15 16:18:27 UTC 2018

Some nir variables are only filled up for some specific modes. We
found to need the binding for ubos/ssbos.

The comment before that code (starts with XXX) points that binding
still needs to be filled up for uniform variables at that point, and
that should be fixed, although it doesn't specify why that's a problem
or the alternative. For now doing the same for ubos/ssbos, and will
hope that the future fixing is done for all of them.
 src/compiler/spirv/vtn_variables.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 2c367b14607..9f92ea0417c 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1804,7 +1804,9 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
    vtn_foreach_decoration(b, val, var_decoration_cb, var);
-   if (var->mode == vtn_variable_mode_uniform) {
+   if (var->mode == vtn_variable_mode_uniform ||
+       var->mode == vtn_variable_mode_ubo ||
+       var->mode == vtn_variable_mode_ssbo) {
       /* XXX: We still need the binding information in the nir_variable
        * for these. We should fix that.

More information about the mesa-dev mailing list