diff options
author | Axel Davy <[email protected]> | 2014-12-24 09:58:49 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-01-22 23:43:28 +0000 |
commit | 9ea8e7f0df06ec7d58c172e612db33b73a9df228 (patch) | |
tree | d55fe241d47ba8580e7ba24a5723e2115b4d282b /src | |
parent | d0d09a4eee93fd4b319206004606c01ce73d8609 (diff) |
st/nine: Clamp ps 1.X constants
This is wine (and windows) behaviour.
Reviewed-by: Ilia Mirkin <[email protected]>
Signed-off-by: Axel Davy <[email protected]>
Cc: "10.4" <[email protected]>
(cherry picked from commit 018407b5d8ce894815f940480c52e9791beb9e97)
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/nine/nine_shader.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index 9873373c6dc..96474c3fd2f 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -842,6 +842,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: |