mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Add a hlsl_block_add_int_constant() helper.
This commit is contained in:
committed by
Henri Verbeet
parent
992d20def3
commit
d5a2ff5c12
Notes:
Henri Verbeet
2025-02-20 16:07:11 +01:00
Approved-by: Henri Verbeet (@hverbeet) Approved-by: Francisco Casas (@fcasas) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1370
@@ -2328,9 +2328,7 @@ static bool add_increment(struct hlsl_ctx *ctx, struct hlsl_block *block, bool d
|
||||
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_int_constant(ctx, 1, loc)))
|
||||
return false;
|
||||
hlsl_block_add_instr(block, one);
|
||||
one = hlsl_block_add_int_constant(ctx, block, 1, loc);
|
||||
|
||||
if (!add_assignment(ctx, block, lhs, decrement ? ASSIGN_OP_SUB : ASSIGN_OP_ADD, one, false))
|
||||
return false;
|
||||
@@ -9376,12 +9374,9 @@ primary_expr:
|
||||
}
|
||||
| C_INTEGER
|
||||
{
|
||||
struct hlsl_ir_node *c;
|
||||
|
||||
if (!(c = hlsl_new_int_constant(ctx, $1, &@1)))
|
||||
YYABORT;
|
||||
if (!($$ = make_block(ctx, c)))
|
||||
if (!($$ = make_empty_block(ctx)))
|
||||
YYABORT;
|
||||
hlsl_block_add_int_constant(ctx, $$, $1, &@1);
|
||||
}
|
||||
| C_UNSIGNED
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user