diff options
author | Marek Olšák <[email protected]> | 2016-01-08 02:11:16 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-01-08 20:07:16 +0100 |
commit | 1e463d20ba38d0af409b7b9b825b31330f4b4f0b (patch) | |
tree | f25e95d6b29db97afc0a28260b6b92e144fde95b /src/gallium/state_trackers/nine/nine_ff.c | |
parent | d0cf66d8358448ea752a1d84fdb1503e61b49065 (diff) |
nine: allow fragment shader POSITION and FACE to be system values
Reported-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/nine_ff.c')
-rw-r--r-- | src/gallium/state_trackers/nine/nine_ff.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c index fe26086ef3d..0feaeab7330 100644 --- a/src/gallium/state_trackers/nine/nine_ff.c +++ b/src/gallium/state_trackers/nine/nine_ff.c @@ -1391,7 +1391,15 @@ nine_ff_build_ps(struct NineDevice9 *device, struct nine_ff_ps_key *key) /* Fog. */ if (key->fog_mode) { - struct ureg_src vPos = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, 0, TGSI_INTERPOLATE_LINEAR); + struct ureg_src vPos; + if (device->screen->get_param(device->screen, + PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL)) { + vPos = ureg_DECL_system_value(ureg, TGSI_SEMANTIC_POSITION, 0); + } else { + vPos = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, 0, + TGSI_INTERPOLATE_LINEAR); + } + struct ureg_dst rFog = ureg_writemask(ps.rTmp, TGSI_WRITEMASK_X); if (key->fog_mode == D3DFOG_EXP) { ureg_MUL(ureg, rFog, _ZZZZ(vPos), _ZZZZ(_CONST(22))); |