From 7926b42d41058e5d2b99ba0e8810f93bc7c12d36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 19 Aug 2009 09:34:53 +0100 Subject: [PATCH] llvmpipe: Implement saturation. --- src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c index 6561155bfd7..805d9fd4b24 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c @@ -199,12 +199,17 @@ emit_store( break; case TGSI_SAT_ZERO_ONE: - /* assert( 0 ); */ + value = lp_build_max(&bld->base, value, bld->base.zero); + value = lp_build_min(&bld->base, value, bld->base.one); break; case TGSI_SAT_MINUS_PLUS_ONE: - assert( 0 ); + value = lp_build_max(&bld->base, value, lp_build_const_uni(bld->base.type, -1.0)); + value = lp_build_min(&bld->base, value, bld->base.one); break; + + default: + assert(0); } switch( reg->DstRegister.File ) { -- 2.30.2