vkd3d-shader/ir: Validate that constant interpolation is used with integer types.

This commit is contained in:
Giovanni Mascellani 2024-10-09 17:30:34 +02:00 committed by Henri Verbeet
parent e366fc3ad6
commit 690c47dbf8
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

View File

@ -6510,6 +6510,7 @@ static void vsir_validate_signature_element(struct validation_context *ctx,
unsigned int idx)
{
const struct signature_element *element = &signature->elements[idx];
bool integer_type = false;
if (element->register_count == 0)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE,
@ -6581,6 +6582,9 @@ static void vsir_validate_signature_element(struct validation_context *ctx,
{
case VKD3D_SHADER_COMPONENT_INT:
case VKD3D_SHADER_COMPONENT_UINT:
integer_type = true;
break;
case VKD3D_SHADER_COMPONENT_FLOAT:
break;
@ -6600,6 +6604,12 @@ static void vsir_validate_signature_element(struct validation_context *ctx,
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE,
"element %u of %s signature: Invalid interpolation mode %#x.",
idx, signature_type, element->interpolation_mode);
if (integer_type && element->interpolation_mode != VKD3DSIM_NONE
&& element->interpolation_mode != VKD3DSIM_CONSTANT)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE,
"element %u of %s signature: Invalid interpolation mode %#x for integer component type.",
idx, signature_type, element->interpolation_mode);
}
static void vsir_validate_signature(struct validation_context *ctx,