vkd3d-shader: Add a flag marking raw buffers to struct vkd3d_shader_descriptor_info.

This commit is contained in:
Zebediah Figura 2023-08-09 18:59:51 -05:00 committed by Alexandre Julliard
parent c1ebba9515
commit 622311da8e
Notes: Alexandre Julliard 2023-08-23 22:51:23 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/304
2 changed files with 8 additions and 4 deletions

View File

@ -1339,6 +1339,8 @@ enum vkd3d_shader_descriptor_info_flag
/** The descriptor is a UAV resource, on which the shader performs
* atomic ops. \since 1.6 */
VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_ATOMICS = 0x00000008,
/** The descriptor is a raw (byte-addressed) buffer. \since 1.9 */
VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_RAW_BUFFER = 0x00000010,
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_DESCRIPTOR_INFO_FLAG),
};

View File

@ -819,7 +819,7 @@ static void vkd3d_shader_scan_sampler_declaration(struct vkd3d_shader_scan_conte
static void vkd3d_shader_scan_resource_declaration(struct vkd3d_shader_scan_context *context,
const struct vkd3d_shader_resource *resource, enum vkd3d_shader_resource_type resource_type,
enum vkd3d_shader_resource_data_type resource_data_type,
unsigned int sample_count, unsigned int structure_stride)
unsigned int sample_count, unsigned int structure_stride, bool raw)
{
struct vkd3d_shader_descriptor_info1 *d;
enum vkd3d_shader_descriptor_type type;
@ -836,6 +836,8 @@ static void vkd3d_shader_scan_resource_declaration(struct vkd3d_shader_scan_cont
return;
d->sample_count = sample_count;
d->structure_stride = structure_stride;
if (raw)
d->flags |= VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_RAW_BUFFER;
}
static void vkd3d_shader_scan_typed_resource_declaration(struct vkd3d_shader_scan_context *context,
@ -894,7 +896,7 @@ static void vkd3d_shader_scan_typed_resource_declaration(struct vkd3d_shader_sca
}
vkd3d_shader_scan_resource_declaration(context, &semantic->resource,
semantic->resource_type, resource_data_type, semantic->sample_count, 0);
semantic->resource_type, resource_data_type, semantic->sample_count, 0, false);
}
static void vkd3d_shader_scan_error(struct vkd3d_shader_scan_context *context,
@ -928,13 +930,13 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
case VKD3DSIH_DCL_RESOURCE_RAW:
case VKD3DSIH_DCL_UAV_RAW:
vkd3d_shader_scan_resource_declaration(context, &instruction->declaration.raw_resource.resource,
VKD3D_SHADER_RESOURCE_BUFFER, VKD3D_SHADER_RESOURCE_DATA_UINT, 0, 0);
VKD3D_SHADER_RESOURCE_BUFFER, VKD3D_SHADER_RESOURCE_DATA_UINT, 0, 0, true);
break;
case VKD3DSIH_DCL_RESOURCE_STRUCTURED:
case VKD3DSIH_DCL_UAV_STRUCTURED:
vkd3d_shader_scan_resource_declaration(context, &instruction->declaration.structured_resource.resource,
VKD3D_SHADER_RESOURCE_BUFFER, VKD3D_SHADER_RESOURCE_DATA_UINT, 0,
instruction->declaration.structured_resource.byte_stride);
instruction->declaration.structured_resource.byte_stride, false);
break;
case VKD3DSIH_IF:
cf_info = vkd3d_shader_scan_push_cf_info(context);