mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Only read used coordinates in encode_texel_offset_as_aoffimmi().
The V and W offsets may be uninitialized, which may spuriously trigger "out of range" errors.
This commit is contained in:
parent
7b476573ff
commit
974528cbe3
Notes:
Alexandre Julliard
2023-06-08 23:22:36 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/223
@ -3657,8 +3657,12 @@ static bool encode_texel_offset_as_aoffimmi(struct sm4_instruction *instr,
|
||||
|
||||
modif.type = VKD3D_SM4_MODIFIER_AOFFIMMI;
|
||||
modif.u.aoffimmi.u = offset->value.u[0].i;
|
||||
modif.u.aoffimmi.v = offset->value.u[1].i;
|
||||
modif.u.aoffimmi.w = offset->value.u[2].i;
|
||||
modif.u.aoffimmi.v = 0;
|
||||
modif.u.aoffimmi.w = 0;
|
||||
if (offset->node.data_type->dimx > 1)
|
||||
modif.u.aoffimmi.v = offset->value.u[1].i;
|
||||
if (offset->node.data_type->dimx > 2)
|
||||
modif.u.aoffimmi.w = offset->value.u[2].i;
|
||||
if (modif.u.aoffimmi.u < -8 || modif.u.aoffimmi.u > 7
|
||||
|| modif.u.aoffimmi.v < -8 || modif.u.aoffimmi.v > 7
|
||||
|| modif.u.aoffimmi.w < -8 || modif.u.aoffimmi.w > 7)
|
||||
|
Loading…
x
Reference in New Issue
Block a user