summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsálvez <[email protected]>2016-11-21 16:19:13 +0100
committerSamuel Iglesias Gonsálvez <[email protected]>2017-01-09 09:10:13 +0100
commit8076c8b59f2f2acebdd8e8454290c54191805645 (patch)
tree76af01f27e5f1fca82b964b83ffd178b0ee0ac52 /src
parenta9663878835b14051fbd79f644bae3f23daf1787 (diff)
spirv: add double support to SpvOpCompositeExtract
v2 (Jason): - Add asserts. Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/spirv/spirv_to_nir.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 82d67fa8886..00bcdd57799 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1180,8 +1180,14 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,
val->constant = *c;
} else {
unsigned num_components = glsl_get_vector_elements(type);
+ unsigned bit_size = glsl_get_bit_size(type);
for (unsigned i = 0; i < num_components; i++)
- val->constant->values[0].u32[i] = (*c)->values[col].u32[elem + i];
+ if (bit_size == 64) {
+ val->constant->values[0].u64[i] = (*c)->values[col].u64[elem + i];
+ } else {
+ assert(bit_size == 32);
+ val->constant->values[0].u32[i] = (*c)->values[col].u32[elem + i];
+ }
}
} else {
struct vtn_value *insert =
@@ -1191,8 +1197,14 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,
*c = insert->constant;
} else {
unsigned num_components = glsl_get_vector_elements(type);
+ unsigned bit_size = glsl_get_bit_size(type);
for (unsigned i = 0; i < num_components; i++)
- (*c)->values[col].u32[elem + i] = insert->constant->values[0].u32[i];
+ if (bit_size == 64) {
+ (*c)->values[col].u64[elem + i] = insert->constant->values[0].u64[i];
+ } else {
+ assert(bit_size == 32);
+ (*c)->values[col].u32[elem + i] = insert->constant->values[0].u32[i];
+ }
}
}
break;