vkd3d-shader/hlsl: Add parser support for the ByteAddressBuffer type.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2024-11-03 15:31:29 +01:00 committed by Henri Verbeet
parent 8438aacc3b
commit 1a28e7d9c6
Notes: Henri Verbeet 2024-11-06 23:01:27 +01:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1245
3 changed files with 12 additions and 0 deletions

View File

@ -2774,6 +2774,12 @@ struct vkd3d_string_buffer *hlsl_type_to_string(struct hlsl_ctx *ctx, const stru
return string;
case HLSL_CLASS_TEXTURE:
if (type->sampler_dim == HLSL_SAMPLER_DIM_RAW_BUFFER)
{
vkd3d_string_buffer_printf(string, "ByteAddressBuffer");
return string;
}
if (type->sampler_dim == HLSL_SAMPLER_DIM_GENERIC)
{
vkd3d_string_buffer_printf(string, "Texture");

View File

@ -74,6 +74,7 @@ ANY (.)
BlendState {return KW_BLENDSTATE; }
break {return KW_BREAK; }
Buffer {return KW_BUFFER; }
ByteAddressBuffer {return KW_BYTEADDRESSBUFFER; }
case {return KW_CASE; }
cbuffer {return KW_CBUFFER; }
centroid {return KW_CENTROID; }

View File

@ -6509,6 +6509,7 @@ static void validate_uav_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim dim,
%token KW_BLENDSTATE
%token KW_BREAK
%token KW_BUFFER
%token KW_BYTEADDRESSBUFFER
%token KW_CASE
%token KW_CONSTANTBUFFER
%token KW_CBUFFER
@ -7878,6 +7879,10 @@ type_no_void:
$$ = hlsl_new_texture_type(ctx, $1, $3, sample_count);
}
| KW_BYTEADDRESSBUFFER
{
$$ = hlsl_new_texture_type(ctx, HLSL_SAMPLER_DIM_RAW_BUFFER, hlsl_get_scalar_type(ctx, HLSL_TYPE_UINT), 0);
}
| uav_type '<' resource_format '>'
{
validate_uav_type(ctx, $1, $3, &@3);