mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/ir: Validate UAV flags in vsir programs.
This commit is contained in:
committed by
Henri Verbeet
parent
32bf71ba96
commit
56247130c1
Notes:
Henri Verbeet
2025-07-16 18:16:52 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1620
@@ -10479,7 +10479,7 @@ static void vsir_validate_descriptors(struct validation_context *ctx)
|
||||
for (i = 0; i < descriptors->descriptor_count; ++i)
|
||||
{
|
||||
const struct vkd3d_shader_descriptor_info1 *descriptor = &descriptors->descriptors[i];
|
||||
uint32_t flags_mask = 0;
|
||||
uint32_t flags_mask = 0, uav_flags_mask = 0;
|
||||
|
||||
if (descriptor->type >= VKD3D_SHADER_DESCRIPTOR_TYPE_COUNT)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DESCRIPTOR_TYPE,
|
||||
@@ -10520,6 +10520,9 @@ static void vsir_validate_descriptors(struct validation_context *ctx)
|
||||
| VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_READ
|
||||
| VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_ATOMICS
|
||||
| VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_RAW_BUFFER;
|
||||
uav_flags_mask = VKD3DSUF_GLOBALLY_COHERENT
|
||||
| VKD3DSUF_RASTERISER_ORDERED_VIEW
|
||||
| VKD3DSUF_ORDER_PRESERVING_COUNTER;
|
||||
break;
|
||||
|
||||
case VKD3D_SHADER_DESCRIPTOR_TYPE_CBV:
|
||||
@@ -10537,6 +10540,11 @@ static void vsir_validate_descriptors(struct validation_context *ctx)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_FLAGS,
|
||||
"Descriptor %u of type %#x has invalid flags %#x.",
|
||||
i, descriptor->type, descriptor->flags);
|
||||
|
||||
if (descriptor->uav_flags & ~uav_flags_mask)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_FLAGS,
|
||||
"Descriptor %u of type %#x has invalid UAV flags %#x.",
|
||||
i, descriptor->type, descriptor->uav_flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user