From 62d5bc91f536322941f7e548733c308dc995ef69 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 14 Oct 2024 18:32:15 +0200 Subject: [PATCH] vkd3d-shader/ir: Validate OUTPUT registers. --- libs/vkd3d-shader/ir.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 252592e6..96d2c0fa 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -6230,6 +6230,32 @@ static void vsir_validate_io_register(struct validation_context *ctx, } break; + case VKD3DSPR_OUTPUT: + switch (ctx->program->shader_version.type) + { + case VKD3D_SHADER_TYPE_HULL: + if (ctx->phase == VKD3DSIH_HS_CONTROL_POINT_PHASE) + { + signature = &ctx->program->output_signature; + has_control_point = ctx->program->normalised_hull_cp_io; + } + else if (ctx->program->normalised_io) + { + signature = &ctx->program->output_signature; + has_control_point = true; + } + else + { + signature = &ctx->program->patch_constant_signature; + } + break; + + default: + signature = &ctx->program->output_signature; + break; + } + break; + default: vkd3d_unreachable(); } @@ -6624,6 +6650,10 @@ static void vsir_validate_register(struct validation_context *ctx, vsir_validate_rastout_register(ctx, reg); break; + case VKD3DSPR_OUTPUT: + vsir_validate_io_register(ctx, reg); + break; + case VKD3DSPR_DEPTHOUT: vsir_validate_register_without_indices(ctx, reg); break;