st/nine: Ignore swizzle on samplers

Prevents a crash running wine tests

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>
This commit is contained in:
Axel Davy 2021-03-11 18:33:24 +01:00 committed by Marge Bot
parent 787b03d5f6
commit 619c53489f
1 changed files with 2 additions and 2 deletions

View File

@ -1095,7 +1095,7 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param)
break;
case D3DSPR_SAMPLER:
assert(param->mod == NINED3DSPSM_NONE);
assert(param->swizzle == NINED3DSP_NOSWIZZLE);
/* assert(param->swizzle == NINED3DSP_NOSWIZZLE); Passed by wine tests */
src = ureg_DECL_sampler(ureg, param->idx);
break;
case D3DSPR_CONST:
@ -1204,7 +1204,7 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param)
break;
}
if (param->swizzle != NINED3DSP_NOSWIZZLE)
if (param->swizzle != NINED3DSP_NOSWIZZLE && param->file != D3DSPR_SAMPLER)
src = ureg_swizzle(src,
(param->swizzle >> 0) & 0x3,
(param->swizzle >> 2) & 0x3,