nir/lower_source_mods: Don't lower saturate for non-float outputs
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 3 Feb 2015 20:41:36 +0000 (12:41 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 3 Feb 2015 20:46:38 +0000 (12:46 -0800)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir_lower_to_source_mods.c

index c3f39bcd19ff0f3f296adbf5b47632940820b62e..d6bf77f17c1172cc152b9d8f825cde92682bc460 100644 (file)
@@ -120,6 +120,10 @@ nir_lower_to_source_mods_block(nir_block *block, void *state)
       if (!alu->dest.dest.is_ssa)
          continue;
 
+      /* We can only saturate float destinations */
+      if (nir_op_infos[alu->op].output_type != nir_type_float)
+         continue;
+
       if (alu->dest.dest.ssa.if_uses->entries != 0)
          continue;