mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Cast to bool before applying LOGIC_NOT.
Before this commit, it is possible for one of the tests of cf-cond-types.shader_test to pass a non-bool to LOGIC_NOT, which should not be allowed.
This commit is contained in:
committed by
Alexandre Julliard
parent
ee5fc7e968
commit
a838f97e3f
Notes:
Alexandre Julliard
2024-03-27 23:07:31 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/724
@@ -2919,6 +2919,9 @@ static bool lower_logic_not(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, st
|
||||
arg = expr->operands[0].node;
|
||||
float_type = hlsl_get_vector_type(ctx, HLSL_TYPE_FLOAT, arg->data_type->dimx);
|
||||
|
||||
/* If this is happens, it means we failed to cast the argument to boolean somewhere. */
|
||||
assert(arg->data_type->base_type == HLSL_TYPE_BOOL);
|
||||
|
||||
if (!(arg_cast = hlsl_new_cast(ctx, arg, float_type, &arg->loc)))
|
||||
return false;
|
||||
hlsl_block_add_instr(block, arg_cast);
|
||||
|
Reference in New Issue
Block a user