[03/28] spirv/nir: setting interface type for ubos/ssbos

Submitted by apinheiro on Oct. 22, 2018, 12:24 p.m.

Details

Message ID 20181022122450.10628-4-apinheiro@igalia.com
State New
Headers show
Series "ARB_gl_spirv: v3 ubo/ssbo support, plus CTS goodness" ( rev: 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

apinheiro Oct. 22, 2018, 12:24 p.m.
Right now, a type is considered a ubo/ssbo if the mode is
uniform/shader_storage and the interface_type is different to
NULL. See ir_variable::in_in_buffer_block as an example.
---
 src/compiler/spirv/vtn_variables.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 5665106ab14..04103455614 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1731,7 +1731,16 @@  vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
       }
       var->var->data.mode = nir_mode;
       var->var->data.location = -1;
-      var->var->interface_type = NULL;
+
+      switch (var->mode) {
+      case vtn_variable_mode_ubo:
+      case vtn_variable_mode_ssbo:
+         var->var->interface_type = without_array->type;
+         break;
+      default:
+         var->var->interface_type = NULL;
+         break;
+      }
       break;
 
    case vtn_variable_mode_workgroup:

Comments

On 22/10/18 11:24 pm, Alejandro PiƱeiro wrote:
> Right now, a type is considered a ubo/ssbo if the mode is
> uniform/shader_storage and the interface_type is different to
> NULL. See ir_variable::in_in_buffer_block as an example.

in_in_buffer_block -> is_in_buffer_block

Otherwise 1-3:

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>

> ---
>   src/compiler/spirv/vtn_variables.c | 11 ++++++++++-
>   1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
> index 5665106ab14..04103455614 100644
> --- a/src/compiler/spirv/vtn_variables.c
> +++ b/src/compiler/spirv/vtn_variables.c
> @@ -1731,7 +1731,16 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
>         }
>         var->var->data.mode = nir_mode;
>         var->var->data.location = -1;
> -      var->var->interface_type = NULL;
> +
> +      switch (var->mode) {
> +      case vtn_variable_mode_ubo:
> +      case vtn_variable_mode_ssbo:
> +         var->var->interface_type = without_array->type;
> +         break;
> +      default:
> +         var->var->interface_type = NULL;
> +         break;
> +      }
>         break;
>   
>      case vtn_variable_mode_workgroup:
>