mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Store boolean constants as unsigned.
With this change it is possible to store booleans as 0xffffffff, similarly as what happens at runtime. Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Francisco Casas <fcasas@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
5b24f7a06c
commit
d9dc79de66
@@ -867,7 +867,7 @@ static unsigned int evaluate_array_dimension(struct hlsl_ir_node *node)
|
||||
case HLSL_TYPE_DOUBLE:
|
||||
return value->d;
|
||||
case HLSL_TYPE_BOOL:
|
||||
return value->b;
|
||||
return !!value->u;
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
@@ -3444,7 +3444,7 @@ primary_expr:
|
||||
if (!(c = hlsl_alloc(ctx, sizeof(*c))))
|
||||
YYABORT;
|
||||
init_node(&c->node, HLSL_IR_CONSTANT, hlsl_get_scalar_type(ctx, HLSL_TYPE_BOOL), @1);
|
||||
c->value[0].b = $1;
|
||||
c->value[0].u = $1 ? ~0u : 0;
|
||||
if (!($$ = make_list(ctx, &c->node)))
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user