diff options
author | Axel Davy <[email protected]> | 2014-12-06 22:26:50 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-01-22 22:16:23 +0000 |
commit | 9690bf33d7af835eb36d9e4c5928ac8483ffeeaa (patch) | |
tree | b6d806b04221c5b06e86ab399643f03ba10308d8 /src/gallium/state_trackers | |
parent | bce94ce831492333dae1b85d4387c66fdbfabf57 (diff) |
st/nine: Correct rules for relative adressing and constants.
relative adressing for constants is possible only for vs float
constants.
Reviewed-by: Ilia Mirkin <[email protected]>
Signed-off-by: Axel Davy <[email protected]>
Cc: "10.4" <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/nine/nine_shader.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index f20140d33a5..944b646b30d 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -835,6 +835,7 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param) src = ureg_src_register(TGSI_FILE_SAMPLER, param->idx); break; case D3DSPR_CONST: + assert(!param->rel || IS_VS); if (param->rel) tx->indirect_const_access = TRUE; if (param->rel || !tx_lconstf(tx, &src, param->idx)) { @@ -858,19 +859,20 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param) src = ureg_imm1f(ureg, 0.0f); break; case D3DSPR_CONSTINT: - if (param->rel || !tx_lconsti(tx, &src, param->idx)) { - if (!param->rel) - nine_info_mark_const_i_used(tx->info, param->idx); + /* relative adressing only possible for float constants in vs */ + assert(!param->rel); + if (!tx_lconsti(tx, &src, param->idx)) { + nine_info_mark_const_i_used(tx->info, param->idx); src = ureg_src_register(TGSI_FILE_CONSTANT, tx->info->const_i_base + param->idx); } break; case D3DSPR_CONSTBOOL: - if (param->rel || !tx_lconstb(tx, &src, param->idx)) { + assert(!param->rel); + if (!tx_lconstb(tx, &src, param->idx)) { char r = param->idx / 4; char s = param->idx & 3; - if (!param->rel) - nine_info_mark_const_b_used(tx->info, param->idx); + nine_info_mark_const_b_used(tx->info, param->idx); src = ureg_src_register(TGSI_FILE_CONSTANT, tx->info->const_b_base + r); src = ureg_swizzle(src, s, s, s, s); |