Module: wine
Branch: master
Commit: 905421351f0cafec94fa1c0be28de23f7ea65214
URL:
http://source.winehq.org/git/wine.git/?a=commit;h=905421351f0cafec94fa1c0be…
Author: Paul Gofman <gofmanp(a)gmail.com>
Date: Fri Apr 28 00:10:15 2017 +0200
d3dx9: Fix register index for the scalar op case in parse_preshader().
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com>
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/d3dx9_36/preshader.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/d3dx9_36/preshader.c b/dlls/d3dx9_36/preshader.c
index 896aca5..0f23488 100644
--- a/dlls/d3dx9_36/preshader.c
+++ b/dlls/d3dx9_36/preshader.c
@@ -758,9 +758,12 @@ static HRESULT parse_preshader(struct d3dx_preshader *pres, unsigned
int *ptr, u
if (pres->ins[i].inputs[j].index_reg.table == PRES_REGTAB_COUNT)
{
+ unsigned int last_component_index = pres->ins[i].scalar_op &&
!j ? 0
+ : pres->ins[i].component_count - 1;
+
table = pres->ins[i].inputs[j].reg.table;
reg_idx = get_reg_offset(table, pres->ins[i].inputs[j].reg.offset
- + pres->ins[i].component_count - 1);
+ + last_component_index);
}
else
{