summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_validate.c
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2016-05-31 17:50:04 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2016-06-01 10:44:40 -0400
commitca135a26126edfbcbf19feb6cf6c00eaba3372b9 (patch)
tree2551a00fdde64db2de07e551c52fde7e07efcaff /src/compiler/nir/nir_validate.c
parentbd85e4a041c13c0c8a6a9abc7d15d1ceede42cea (diff)
downloadexternal_mesa3d-ca135a26126edfbcbf19feb6cf6c00eaba3372b9.zip
external_mesa3d-ca135a26126edfbcbf19feb6cf6c00eaba3372b9.tar.gz
external_mesa3d-ca135a26126edfbcbf19feb6cf6c00eaba3372b9.tar.bz2
nir: allow sat on all float destination types
With the introduction of fp64 and fp16 to nir, there are now a bunch of float types running around. A F1 2015 shader ends up with an i2f.sat operation, which has a nir_type_float32 destination. Allow sat on all the float destination types. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "12.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/compiler/nir/nir_validate.c')
-rw-r--r--src/compiler/nir/nir_validate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index 35bb162..e5f5b8a 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -331,7 +331,9 @@ validate_alu_dest(nir_alu_instr *instr, validate_state *state)
* destinations of type float
*/
nir_alu_instr *alu = nir_instr_as_alu(state->instr);
- validate_assert(state, nir_op_infos[alu->op].output_type == nir_type_float ||
+ validate_assert(state,
+ (nir_alu_type_get_base_type(nir_op_infos[alu->op].output_type) ==
+ nir_type_float) ||
!dest->saturate);
unsigned bit_size = dest->dest.is_ssa ? dest->dest.ssa.bit_size