[Mesa-dev] [PATCH 2/2] nir/validate: Validate that only float ALU outputs are saturated
Jason Ekstrand
jason at jlekstrand.net
Tue Feb 3 12:43:59 PST 2015
---
src/glsl/nir/nir_validate.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c
index 7c801b2..89dfdf8 100644
--- a/src/glsl/nir/nir_validate.c
+++ b/src/glsl/nir/nir_validate.c
@@ -239,6 +239,14 @@ validate_alu_dest(nir_alu_dest *dest, validate_state *state)
* register/SSA value
*/
assert(is_packed || !(dest->write_mask & ~((1 << dest_size) - 1)));
+
+ /* validate that saturate is only ever used on instructions with
+ * destinations of type float
+ */
+ nir_alu_instr *alu = nir_instr_as_alu(state->instr);
+ assert(nir_op_infos[alu->op].output_type == nir_type_float ||
+ !dest->saturate);
+
validate_dest(&dest->dest, state);
}
--
2.2.2
More information about the mesa-dev
mailing list