[Mesa-dev] [PATCH 31/53] st/nine: Clamp ps 1.X constants
Axel Davy
axel.davy at ens.fr
Wed Jan 7 08:36:41 PST 2015
This is wine (and windows) behaviour.
Signed-off-by: Axel Davy <axel.davy at ens.fr>
Cc: "10.4" <mesa-stable at lists.freedesktop.org>
---
src/gallium/state_trackers/nine/nine_shader.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c
index 3fefce4..fb01408 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -854,6 +854,13 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param)
nine_info_mark_const_f_used(tx->info, param->idx);
src = ureg_src_register(TGSI_FILE_CONSTANT, param->idx);
}
+ if (!IS_VS && tx->version.major < 2) {
+ /* ps 1.X clamps constants */
+ tmp = tx_scratch(tx);
+ ureg_MIN(ureg, tmp, src, ureg_imm1f(ureg, 1.0f));
+ ureg_MAX(ureg, tmp, ureg_src(tmp), ureg_imm1f(ureg, -1.0f));
+ src = ureg_src(tmp);
+ }
break;
case D3DSPR_CONST2:
case D3DSPR_CONST3:
--
2.1.3
More information about the mesa-dev
mailing list