summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 1a9a25fa7ec..719f9805af8 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -567,6 +567,10 @@ ConstantFolding::expr(Instruction *i,
ImmediateValue src0;
if (i->src(0).getImmediate(src0))
expr(i, src0, *i->getSrc(1)->asImm());
+ if (i->saturate && !prog->getTarget()->isSatSupported(i)) {
+ bld.setPosition(i, false);
+ i->setSrc(1, bld.loadImm(NULL, res.data.u32));
+ }
} else {
i->op = i->saturate ? OP_SAT : OP_MOV; /* SAT handled by unary() */
}