vkd3d-shader/ir: Validate descriptor resource data types in vsir programs.

This commit is contained in:
Giovanni Mascellani
2025-03-28 10:51:57 +01:00
committed by Henri Verbeet
parent 01f47e00f2
commit be94a37e23
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

View File

@@ -8878,6 +8878,15 @@ static void vsir_validate_descriptors(struct validation_context *ctx)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_RESOURCE_TYPE, validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_RESOURCE_TYPE,
"Descriptor %u has invalid resource type %#x for descriptor type %#x.", "Descriptor %u has invalid resource type %#x for descriptor type %#x.",
i, descriptor->resource_type, descriptor->type); i, descriptor->resource_type, descriptor->type);
if (descriptor->resource_data_type >= VKD3D_DATA_COUNT)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
"Descriptor %u has invalid resource data type %#x.", i, descriptor->resource_data_type);
else if ((descriptor->resource_data_type == VKD3D_DATA_UNUSED)
!= (descriptor->type == VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER))
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
"Descriptor %u has invalid resource data type %#x for descriptor type %#x.",
i, descriptor->resource_data_type, descriptor->type);
} }
} }