mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Handle discard statement.
Signed-off-by: Ethan Lee <flibitijibibo@gmail.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Alexandre Julliard
parent
6da7d16d4c
commit
59c63ec584
Notes:
Alexandre Julliard
2023-04-26 22:59:12 +02:00
Approved-by: Zebediah Figura (@zfigura) 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/136
@@ -4075,6 +4075,7 @@ static void validate_texture_format_type(struct hlsl_ctx *ctx, struct hlsl_type
|
||||
%type <list> conditional_expr
|
||||
%type <list> declaration
|
||||
%type <list> declaration_statement
|
||||
%type <list> discard_statement
|
||||
%type <list> equality_expr
|
||||
%type <list> expr
|
||||
%type <list> expr_optional
|
||||
@@ -5322,6 +5323,7 @@ statement:
|
||||
declaration_statement
|
||||
| expr_statement
|
||||
| compound_statement
|
||||
| discard_statement
|
||||
| jump_statement
|
||||
| selection_statement
|
||||
| loop_statement
|
||||
@@ -5341,6 +5343,18 @@ jump_statement:
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
discard_statement:
|
||||
KW_DISCARD ';'
|
||||
{
|
||||
struct hlsl_ir_node *discard;
|
||||
|
||||
if (!($$ = make_empty_list(ctx)))
|
||||
YYABORT;
|
||||
if (!(discard = hlsl_new_jump(ctx, HLSL_IR_JUMP_DISCARD, &@1)))
|
||||
return false;
|
||||
list_add_tail($$, &discard->entry);
|
||||
}
|
||||
|
||||
selection_statement:
|
||||
KW_IF '(' expr ')' if_body
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user