spirv/nir: fill up nir variable info for ubos and ssbo
authorAlejandro Piñeiro <apinheiro@igalia.com>
Mon, 4 Dec 2017 15:29:34 +0000 (16:29 +0100)
committerArcady Goldmints-Orlov <agoldmints@igalia.com>
Sun, 30 Jun 2019 21:58:26 +0000 (16:58 -0500)
The data for some nir variables is only filled up for some specific
modes. We need now too for UBO/SSBO, as such info would be used when
linking for OpenGL (ARB_gl_spirv).

There is an existing comment just before that code (starts with XXX)
that 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 what would be the alternative. For now
doing the same for UBO/SSBO, and will hope that the future fixing is
done for all of them.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/spirv/vtn_variables.c

index c640e3a..b7ec2ed 100644 (file)
@@ -2292,7 +2292,9 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
       assign_missing_member_locations(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.
        */