[Mesa-dev] [PATCH 11/26] spirv/nir: fill glsl_struct_field explicit_matrix_stride

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


---
 src/compiler/spirv/spirv_to_nir.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 101e2b0bf02..02de2f640c1 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -798,6 +798,12 @@ struct_member_matrix_stride_cb(struct vtn_builder *b,
       vtn_assert(mat_type->array_element->stride > 0);
       mat_type->stride = dec->literals[0];
    }
+
+   /* For the glsl_type we use the stride defined at SPIR-V, as anyone (ie:
+    * ARB_gl_spirv linker) that wants to use it would be also using the matrix
+    * layout.
+    */
+   ctx->fields[member].explicit_matrix_stride = dec->literals[0];
 }
 
 static void
-- 
2.14.1



More information about the mesa-dev mailing list