vkd3d-shader/ir: Only allow PATCHCONST registers as source parameteres in Hull and Domain Shaders.

This commit is contained in:
Giovanni Mascellani 2024-10-09 23:04:19 +02:00 committed by Henri Verbeet
parent 6cbe5ffa15
commit f2d181e65c
Notes: Henri Verbeet 2024-10-10 20:10:37 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1172

View File

@ -6443,6 +6443,13 @@ static void vsir_validate_src_param(struct validation_context *ctx,
"Invalid OUTPUT register used as source parameter."); "Invalid OUTPUT register used as source parameter.");
break; 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: default:
break; break;
} }