[Mesa-dev] [PATCH 01/26] spirv/nir: translate uniform blocks

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


They are supported by SPIR-V for ARB_gl_spirv.
---
 src/compiler/spirv/vtn_variables.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 358ff4bef7a..ba1b8816038 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1479,7 +1479,7 @@ vtn_storage_class_to_mode(struct vtn_builder *b,
    case SpvStorageClassUniform:
       if (interface_type->block) {
          mode = vtn_variable_mode_ubo;
-         nir_mode = 0;
+         nir_mode = nir_var_uniform;
       } else if (interface_type->buffer_block) {
          mode = vtn_variable_mode_ssbo;
          nir_mode = 0;
@@ -1677,6 +1677,7 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
    case vtn_variable_mode_local:
    case vtn_variable_mode_global:
    case vtn_variable_mode_uniform:
+   case vtn_variable_mode_ubo:
       /* For these, we create the variable normally */
       var->var = rzalloc(b->shader, nir_variable);
       var->var->name = ralloc_strdup(var->var, val->name);
@@ -1781,7 +1782,6 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
       break;
    }
 
-   case vtn_variable_mode_ubo:
    case vtn_variable_mode_ssbo:
    case vtn_variable_mode_push_constant:
       /* These don't need actual variables. */
-- 
2.14.1



More information about the mesa-dev mailing list