From 9063d554f34268e6c80b77c59a3155e7a916304c Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Fri, 28 Apr 2023 23:52:30 +0200 Subject: [PATCH] frontend/nine: Fix ff ps key The stage index, rather than the texture coord index was used. Cc: mesa-stable Signed-off-by: Axel Davy Part-of: --- src/gallium/frontends/nine/nine_ff.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/frontends/nine/nine_ff.h b/src/gallium/frontends/nine/nine_ff.h index 4e9dc189f48..8d299f2a821 100644 --- a/src/gallium/frontends/nine/nine_ff.h +++ b/src/gallium/frontends/nine/nine_ff.h @@ -88,20 +88,21 @@ nine_ff_get_projected_key(struct nine_context *context, unsigned num_stages) for (s = 0; s < num_stages; ++s) { unsigned gen = (context->ff.tex_stage[s][D3DTSS_TEXCOORDINDEX] >> 16) + 1; unsigned dim = context->ff.tex_stage[s][D3DTSS_TEXTURETRANSFORMFLAGS] & 0x7; + unsigned idx = context->ff.tex_stage[s][D3DTSS_TEXCOORDINDEX] & 7; unsigned proj = !!(context->ff.tex_stage[s][D3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED); if (!context->vs) { if (dim > 4) - dim = input_texture_coord[s]; + dim = input_texture_coord[idx]; if (!dim && gen == NINED3DTSS_TCI_PASSTHRU) - dim = input_texture_coord[s]; + dim = input_texture_coord[idx]; else if (!dim) dim = 4; if (dim == 1) /* NV behaviour */ proj = 0; - if (dim > input_texture_coord[s] && gen == NINED3DTSS_TCI_PASSTHRU) + if (dim > input_texture_coord[idx] && gen == NINED3DTSS_TCI_PASSTHRU) proj = 0; } else { dim = 4;