vkd3d-shader/ir: Validate minimum precision in shader signatures.

This commit is contained in:
Giovanni Mascellani 2024-10-09 17:12:17 +02:00 committed by Henri Verbeet
parent 7b1bc5ca74
commit 831a797837
Notes: Henri Verbeet 2024-10-10 20:09:41 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1167
2 changed files with 6 additions and 0 deletions

View File

@ -6590,6 +6590,11 @@ static void vsir_validate_signature_element(struct validation_context *ctx,
idx, signature_type, element->component_type); idx, signature_type, element->component_type);
break; break;
} }
if (element->min_precision >= VKD3D_SHADER_MINIMUM_PRECISION_COUNT)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE,
"element %u of %s signature: Invalid minimum precision %#x.",
idx, signature_type, element->min_precision);
} }
static void vsir_validate_signature(struct validation_context *ctx, static void vsir_validate_signature(struct validation_context *ctx,

View File

@ -60,6 +60,7 @@
#define VKD3D_DVEC2_SIZE 2 #define VKD3D_DVEC2_SIZE 2
#define VKD3D_SHADER_COMPONENT_TYPE_COUNT (VKD3D_SHADER_COMPONENT_UINT64 + 1) #define VKD3D_SHADER_COMPONENT_TYPE_COUNT (VKD3D_SHADER_COMPONENT_UINT64 + 1)
#define VKD3D_SHADER_MINIMUM_PRECISION_COUNT (VKD3D_SHADER_MINIMUM_PRECISION_UINT_16 + 1)
enum vkd3d_shader_error enum vkd3d_shader_error
{ {