mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Introduce a hlsl_new_bool_constant() helper.
This commit is contained in:
committed by
Alexandre Julliard
parent
4c5fd9c7b9
commit
3fc2fdc37f
Notes:
Alexandre Julliard
2022-10-18 00:13:00 +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/22
@@ -2800,7 +2800,7 @@ static bool add_method_call(struct hlsl_ctx *ctx, struct list *instrs, struct hl
|
||||
struct hlsl_type *type;
|
||||
INT intval;
|
||||
FLOAT floatval;
|
||||
BOOL boolval;
|
||||
bool boolval;
|
||||
char *name;
|
||||
DWORD modifiers;
|
||||
struct hlsl_ir_node *instr;
|
||||
@@ -3857,11 +3857,11 @@ initializer_expr_list:
|
||||
boolean:
|
||||
KW_TRUE
|
||||
{
|
||||
$$ = TRUE;
|
||||
$$ = true;
|
||||
}
|
||||
| KW_FALSE
|
||||
{
|
||||
$$ = FALSE;
|
||||
$$ = false;
|
||||
}
|
||||
|
||||
statement_list:
|
||||
@@ -4001,12 +4001,13 @@ primary_expr:
|
||||
{
|
||||
struct hlsl_ir_constant *c;
|
||||
|
||||
if (!(c = hlsl_alloc(ctx, sizeof(*c))))
|
||||
if (!(c = hlsl_new_bool_constant(ctx, $1, &@1)))
|
||||
YYABORT;
|
||||
init_node(&c->node, HLSL_IR_CONSTANT, hlsl_get_scalar_type(ctx, HLSL_TYPE_BOOL), @1);
|
||||
c->value[0].u = $1 ? ~0u : 0;
|
||||
if (!($$ = make_list(ctx, &c->node)))
|
||||
{
|
||||
hlsl_free_instr(&c->node);
|
||||
YYABORT;
|
||||
}
|
||||
}
|
||||
| VAR_IDENTIFIER
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user