nir: fix support for scalar arrays in nir_lower_io_types()
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 17 Nov 2017 03:27:27 +0000 (14:27 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 3 Dec 2017 22:10:30 +0000 (09:10 +1100)
This was just recreating the same vector type we alreay had and
hitting an assert for scalars.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/nir/nir_lower_io_types.c

index d31082e543ea5fbf5a59ddb8d1b59469a1127fd7..795bbd80d5d88307ff49ab80331670e97897aea3 100644 (file)
@@ -54,15 +54,11 @@ get_new_var(struct lower_io_types_state *state, nir_variable *var,
    }
 
    /* doesn't already exist, so we need to create a new one: */
-   /* TODO figure out if scalar vs vec, and if float/int/uint/(double?)
-    * do we need to fixup interpolation mode for int vs float components
-    * of a struct, etc..
+   /* TODO figure out if we need to fixup interpolation mode for int vs float
+    * components of a struct, etc..
     */
-   const struct glsl_type *ntype =
-      glsl_vector_type(glsl_get_base_type(deref_type),
-                       glsl_get_vector_elements(deref_type));
    nir_variable *nvar = nir_variable_create(state->shader, var->data.mode,
-                                            ntype, NULL);
+                                            deref_type, NULL);
 
    nvar->name = ralloc_asprintf(nvar, "%s@%u", var->name, off);
    nvar->data = var->data;