[Mesa-dev] [PATCH 5/7] spirv: Calculate properly 16-bit vector sizes

Jose Maria Casanova Crespo jmcasanova at igalia.com
Fri Feb 23 09:26:14 UTC 2018


Range in 16-bit push constants load was being calculated
wrongly using 4-bytes per element instead of 2-bytes as it
should be.
---
 src/compiler/spirv/vtn_variables.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 78adab3ed2..81658afbd9 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -687,6 +687,10 @@ vtn_type_block_size(struct vtn_builder *b, struct vtn_type *type)
 		 base_type == GLSL_TYPE_UINT64 ||
 		 base_type == GLSL_TYPE_INT64) {
          return glsl_get_vector_elements(type->type) * 8;
+      } else if (base_type == GLSL_TYPE_FLOAT16 ||
+                 base_type == GLSL_TYPE_UINT16 ||
+                 base_type == GLSL_TYPE_INT16){
+         return glsl_get_vector_elements(type->type) * 2;
       } else {
          return glsl_get_vector_elements(type->type) * 4;
       }
-- 
2.14.3



More information about the mesa-dev mailing list