From f2d181e65c7e116ba7efdbf1257371e91534146e Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Wed, 9 Oct 2024 23:04:19 +0200 Subject: [PATCH] vkd3d-shader/ir: Only allow PATCHCONST registers as source parameteres in Hull and Domain Shaders. --- libs/vkd3d-shader/ir.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index e07fcece..00500554 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -6443,6 +6443,13 @@ static void vsir_validate_src_param(struct validation_context *ctx, "Invalid OUTPUT register used as source parameter."); break; + case VKD3DSPR_PATCHCONST: + if (ctx->program->shader_version.type != VKD3D_SHADER_TYPE_DOMAIN + && ctx->program->shader_version.type != VKD3D_SHADER_TYPE_HULL) + validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_REGISTER_TYPE, + "PATCHCONST register used as source parameters are only allowed in Hull and Domain Shaders."); + break; + default: break; }