summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-12-06 09:13:29 -0800
committerJason Ekstrand <[email protected]>2017-12-11 19:02:47 -0800
commit2bc9123c3358a67b3b12fa6f1e5041b402221a4f (patch)
tree677381d189eae60be6e3ee1a17a7f60b37589e4d /src/compiler/spirv
parent3342a432fa1452459ac4b6a0b20e634437791cee (diff)
spirv: Set lengths on scalar and vector types
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r--src/compiler/spirv/spirv_to_nir.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index e5d447f23a9..5d105431763 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -887,6 +887,7 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
case SpvOpTypeBool:
val->type->base_type = vtn_base_type_scalar;
val->type->type = glsl_bool_type();
+ val->type->length = 1;
break;
case SpvOpTypeInt: {
int bit_size = w[2];
@@ -905,6 +906,7 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
default:
vtn_fail("Invalid int bit size");
}
+ val->type->length = 1;
break;
}
@@ -924,6 +926,7 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
default:
vtn_fail("Invalid float bit size");
}
+ val->type->length = 1;
break;
}
@@ -934,6 +937,7 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
vtn_assert(glsl_type_is_scalar(base->type));
val->type->base_type = vtn_base_type_vector;
val->type->type = glsl_vector_type(glsl_get_base_type(base->type), elems);
+ val->type->length = elems;
val->type->stride = glsl_get_bit_size(base->type) / 8;
val->type->array_element = base;
break;