mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Parse UAV types.
This commit is contained in:
committed by
Alexandre Julliard
parent
fea50d243c
commit
0ef04659c7
Notes:
Alexandre Julliard
2022-10-19 22:07:47 +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/30
@@ -3031,6 +3031,9 @@ static bool add_method_call(struct hlsl_ctx *ctx, struct list *instrs, struct hl
|
||||
%token KW_RETURN
|
||||
%token KW_REGISTER
|
||||
%token KW_ROW_MAJOR
|
||||
%token KW_RWTEXTURE1D
|
||||
%token KW_RWTEXTURE2D
|
||||
%token KW_RWTEXTURE3D
|
||||
%token KW_SAMPLER
|
||||
%token KW_SAMPLER1D
|
||||
%token KW_SAMPLER2D
|
||||
@@ -3168,7 +3171,7 @@ static bool add_method_call(struct hlsl_ctx *ctx, struct list *instrs, struct hl
|
||||
|
||||
%type <reg_reservation> register_opt
|
||||
|
||||
%type <sampler_dim> texture_type
|
||||
%type <sampler_dim> texture_type uav_type
|
||||
|
||||
%type <semantic> semantic
|
||||
|
||||
@@ -3592,6 +3595,20 @@ texture_type:
|
||||
$$ = HLSL_SAMPLER_DIM_CUBEARRAY;
|
||||
}
|
||||
|
||||
uav_type:
|
||||
KW_RWTEXTURE1D
|
||||
{
|
||||
$$ = HLSL_SAMPLER_DIM_1D;
|
||||
}
|
||||
| KW_RWTEXTURE2D
|
||||
{
|
||||
$$ = HLSL_SAMPLER_DIM_2D;
|
||||
}
|
||||
| KW_RWTEXTURE3D
|
||||
{
|
||||
$$ = HLSL_SAMPLER_DIM_3D;
|
||||
}
|
||||
|
||||
type:
|
||||
KW_VECTOR '<' type ',' C_INTEGER '>'
|
||||
{
|
||||
@@ -3697,6 +3714,20 @@ type:
|
||||
}
|
||||
$$ = hlsl_new_texture_type(ctx, $1, $3);
|
||||
}
|
||||
| uav_type '<' type '>'
|
||||
{
|
||||
if ($3->type > HLSL_CLASS_VECTOR)
|
||||
{
|
||||
struct vkd3d_string_buffer *string;
|
||||
|
||||
string = hlsl_type_to_string(ctx, $3);
|
||||
if (string)
|
||||
hlsl_error(ctx, &@3, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE,
|
||||
"UAV data type %s is not scalar or vector.", string->buffer);
|
||||
hlsl_release_string_buffer(ctx, string);
|
||||
}
|
||||
$$ = hlsl_new_uav_type(ctx, $1, $3);
|
||||
}
|
||||
| TYPE_IDENTIFIER
|
||||
{
|
||||
$$ = hlsl_get_type(ctx->cur_scope, $1, true);
|
||||
|
||||
Reference in New Issue
Block a user