diff options
author | Samuel Iglesias Gonsálvez <[email protected]> | 2016-11-21 16:30:47 +0100 |
---|---|---|
committer | Samuel Iglesias Gonsálvez <[email protected]> | 2017-01-09 09:10:13 +0100 |
commit | d77ffc3d873683d4a8e14209c25829db29c96dcf (patch) | |
tree | 92547c09f12be8cf8e6ddb098db5a2c60b174155 /src/compiler/spirv | |
parent | 9602c7c02f854beee70c9e2713e39f04234bb558 (diff) |
spirv: add support for loading DF constants
v2 (Jason):
- Add assert.
Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r-- | src/compiler/spirv/spirv_to_nir.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 46e0c386eed..27995ba0d26 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -1003,10 +1003,18 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode, break; } - case SpvOpConstant: + case SpvOpConstant: { assert(glsl_type_is_scalar(val->const_type)); - val->constant->values[0].u32[0] = w[3]; + int bit_size = glsl_get_bit_size(val->const_type); + if (bit_size == 64) { + val->constant->values->u32[0] = w[3]; + val->constant->values->u32[1] = w[4]; + } else { + assert(bit_size == 32); + val->constant->values->u32[0] = w[3]; + } break; + } case SpvOpSpecConstant: assert(glsl_type_is_scalar(val->const_type)); val->constant->values[0].u32[0] = get_specialization(b, val, w[3]); |