vkd3d-shader/ir: Validate RESOURCE registers.

This commit is contained in:
Giovanni Mascellani 2024-09-23 18:30:47 +02:00 committed by Henri Verbeet
parent a0b98c1610
commit b7b5b0cff8
Notes: Henri Verbeet 2024-09-30 21:06:02 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Conor McCarthy (@cmccarthy)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1123

View File

@ -5977,6 +5977,23 @@ static void vsir_validate_register(struct validation_context *ctx,
"Invalid dimension SCALAR for a SAMPLER register.");
break;
case VKD3DSPR_RESOURCE:
if (reg->precision != VKD3D_SHADER_REGISTER_PRECISION_DEFAULT)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_PRECISION,
"Invalid precision %#x for a RESOURCE register.",
reg->precision);
if (reg->data_type != VKD3D_DATA_UNUSED)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
"Invalid data type %#x for a RESOURCE register.",
reg->data_type);
if (reg->dimension != VSIR_DIMENSION_VEC4)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DIMENSION,
"Invalid dimension %#x for a RESOURCE register.",
reg->dimension);
break;
default:
break;
}