diff options
author | Francisco Jerez <[email protected]> | 2016-02-01 14:59:01 -0800 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2016-02-08 15:23:35 -0800 |
commit | f50a6517267230befe7ca5a5fbf064a5d1153f8e (patch) | |
tree | b4284de246170f2715063c47e3e8474e254bb2e2 /src/compiler/nir | |
parent | 6c4c04690f30af655ad675b590836d3a84440c3a (diff) |
nir/spirv: Create integer types of correct signedness.
vtn_handle_type() creates a signed type regardless of the value of the
signedness flag, which usually doesn't make much of a difference
except when the type is used as base sampled type of an image type,
what will cause the base type of the NIR image variable to be
inconsistent with its format and cause an assertion failure in the
back-end (most likely only reproducible on Gen7), and may change the
semantics of the image intrinsic subtly (e.g. UMIN may become IMIN).
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/spirv/spirv_to_nir.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/nir/spirv/spirv_to_nir.c b/src/compiler/nir/spirv/spirv_to_nir.c index c002457ce12..ee39b333c1a 100644 --- a/src/compiler/nir/spirv/spirv_to_nir.c +++ b/src/compiler/nir/spirv/spirv_to_nir.c @@ -594,9 +594,11 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode, case SpvOpTypeBool: val->type->type = glsl_bool_type(); break; - case SpvOpTypeInt: - val->type->type = glsl_int_type(); + case SpvOpTypeInt: { + const bool signedness = w[3]; + val->type->type = (signedness ? glsl_int_type() : glsl_uint_type()); break; + } case SpvOpTypeFloat: val->type->type = glsl_float_type(); break; |