diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 03813656..76987310 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -1502,6 +1502,10 @@ static void vsir_validate_register(struct validation_context *ctx, if (reg->precision >= VKD3D_SHADER_REGISTER_PRECISION_COUNT) validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_PRECISION, "Invalid register precision %#x.", reg->precision); + + if (reg->data_type >= VKD3D_DATA_COUNT) + validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE, "Invalid register data type %#x.", + reg->data_type); } static void vsir_validate_dst_param(struct validation_context *ctx, diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 6bb0882e..4c483520 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -201,6 +201,7 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_VSIR_INVALID_SHIFT = 9005, VKD3D_SHADER_ERROR_VSIR_INVALID_SWIZZLE = 9006, VKD3D_SHADER_ERROR_VSIR_INVALID_PRECISION = 9007, + VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE = 9008, }; enum vkd3d_shader_opcode @@ -580,6 +581,8 @@ enum vkd3d_data_type VKD3D_DATA_UINT8, VKD3D_DATA_UINT64, VKD3D_DATA_BOOL, + + VKD3D_DATA_COUNT, }; static inline bool data_type_is_integer(enum vkd3d_data_type data_type)