mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/ir: Validate descriptor resource types in vsir programs.
This commit is contained in:
committed by
Henri Verbeet
parent
0da80c1f25
commit
01f47e00f2
Notes:
Henri Verbeet
2025-04-16 16:52:04 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1447
@@ -8869,6 +8869,15 @@ static void vsir_validate_descriptors(struct validation_context *ctx)
|
||||
if (descriptor->type >= VKD3D_SHADER_DESCRIPTOR_TYPE_COUNT)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DESCRIPTOR_TYPE,
|
||||
"Descriptor %u has invalid type %#x.", i, descriptor->type);
|
||||
|
||||
if (descriptor->resource_type >= VKD3D_SHADER_RESOURCE_TYPE_COUNT)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_RESOURCE_TYPE,
|
||||
"Descriptor %u has invalid resource type %#x.", i, descriptor->resource_type);
|
||||
else if ((descriptor->resource_type == VKD3D_SHADER_RESOURCE_NONE)
|
||||
!= (descriptor->type == VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER))
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_RESOURCE_TYPE,
|
||||
"Descriptor %u has invalid resource type %#x for descriptor type %#x.",
|
||||
i, descriptor->resource_type, descriptor->type);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user