summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergii Romantsov <sergii.romantsov@gmail.com>2019-01-15 13:08:32 +0200
committerJason Ekstrand <jason.ekstrand@intel.com>2019-01-23 15:43:06 -0600
commitcfca5cd9588fb213e6889c85137f3e2fec8c7757 (patch)
treeb4ddf7cc936345f492f18ce4cff5b662a0d7bd09
parent42aea4f1a79729885e1dd67efbab23662964187a (diff)
downloadmesa-cfca5cd9588fb213e6889c85137f3e2fec8c7757.tar.gz
mesa-cfca5cd9588fb213e6889c85137f3e2fec8c7757.tar.bz2
mesa-cfca5cd9588fb213e6889c85137f3e2fec8c7757.zip
nir: Length of boolean vtn_value now is 1
During conversion type-length was lost due to math. v2 (Jason Ekstrand): - Use a size/offset of 4 bytes Fixes: 44227453ec03 (nir: Switch to using 1-bit Booleans for almost everything) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109353 Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com> Tested-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
-rw-r--r--src/compiler/spirv/spirv_to_nir.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 6b01ad35a71..b54d259e14b 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1044,14 +1044,16 @@ vtn_type_layout_std430(struct vtn_builder *b, struct vtn_type *type,
{
switch (type->base_type) {
case vtn_base_type_scalar: {
- uint32_t comp_size = glsl_get_bit_size(type->type) / 8;
+ uint32_t comp_size = glsl_type_is_boolean(type->type)
+ ? 4 : glsl_get_bit_size(type->type) / 8;
*size_out = comp_size;
*align_out = comp_size;
return type;
}
case vtn_base_type_vector: {
- uint32_t comp_size = glsl_get_bit_size(type->type) / 8;
+ uint32_t comp_size = glsl_type_is_boolean(type->type)
+ ? 4 : glsl_get_bit_size(type->type) / 8;
unsigned align_comps = type->length == 3 ? 4 : type->length;
*size_out = comp_size * type->length,
*align_out = comp_size * align_comps;
@@ -1170,7 +1172,8 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
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->stride = glsl_type_is_boolean(val->type->type)
+ ? 4 : glsl_get_bit_size(base->type) / 8;
val->type->array_element = base;
break;
}