mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Make pre/post decrement generate a signed one.
If a float expression is pre/post decremented and an unsigned one is used to execute it, the unsigned one is first negated (becoming 2^32-1) and then casted to float (becoming 2^32), which leads to an incorrect result. Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
c64627313f
commit
0e45838370
@@ -1255,7 +1255,7 @@ static bool add_increment(struct hlsl_ctx *ctx, struct list *instrs, bool decrem
|
||||
hlsl_error(ctx, &loc, VKD3D_SHADER_ERROR_HLSL_MODIFIES_CONST,
|
||||
"Argument to %s%screment operator is const.", post ? "post" : "pre", decrement ? "de" : "in");
|
||||
|
||||
if (!(one = hlsl_new_uint_constant(ctx, 1, loc)))
|
||||
if (!(one = hlsl_new_int_constant(ctx, 1, loc)))
|
||||
return false;
|
||||
list_add_tail(instrs, &one->node.entry);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user