nir/spirv: Use the correct stride for non-32-bit vectors
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 29 Jun 2017 17:33:29 +0000 (10:33 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 5 Jul 2017 22:26:53 +0000 (15:26 -0700)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/compiler/spirv/spirv_to_nir.c

index 18e37341ef7e4ae38a84db16e57e92b162b8f987..7a98843db77ea9102666592bbb4e4b3b02818ebd 100644 (file)
@@ -744,7 +744,7 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
        * is always 4 bytes.  This will have to change if we want to start
        * supporting doubles or half-floats.
        */
-      val->type->stride = 4;
+      val->type->stride = glsl_get_bit_size(base->type) / 8;
       val->type->array_element = base;
       break;
    }