diff options
author | Axel Davy <[email protected]> | 2018-04-05 22:38:03 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2019-04-30 19:18:51 +0200 |
commit | a92a43d41dd2ae4719ee314cbf831583c751754a (patch) | |
tree | b2ef28f3766e53e7281a069aebeb3cc84f3ed391 /src/gallium/state_trackers/nine | |
parent | 5974401a4adba2373232fc72940db96c32bbb4b6 (diff) |
st/nine: Refactor param->rel
Refactor param->rel to enable different paths
for constants and inputs relative addressing.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine')
-rw-r--r-- | src/gallium/state_trackers/nine/nine_shader.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index ff65344d25b..1ec03c67924 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -979,6 +979,8 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param) } } } + if (param->rel) + src = ureg_src_indirect(src, tx_src_param(tx, param->rel)); break; case D3DSPR_PREDICATE: if (ureg_dst_is_undef(tx->regs.predicate)) { @@ -994,8 +996,6 @@ 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: - if (param->rel) - tx->indirect_const_access = TRUE; if (param->rel || !tx_lconstf(tx, &src, param->idx)) { if (!param->rel) nine_info_mark_const_f_used(tx->info, param->idx); @@ -1019,6 +1019,10 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param) } } else src = NINE_CONSTANT_SRC(param->idx); + if (param->rel) { + tx->indirect_const_access = TRUE; + src = ureg_src_indirect(src, tx_src_param(tx, param->rel)); + } } if (!IS_VS && tx->version.major < 2) { /* ps 1.X clamps constants */ @@ -1113,8 +1117,6 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param) default: assert(!"invalid src D3DSPR"); } - if (param->rel) - src = ureg_src_indirect(src, tx_src_param(tx, param->rel)); switch (param->mod) { case NINED3DSPSM_DW: |