From 768b19d410cfa5c1fd1ed6ae48537f451b824c97 Mon Sep 17 00:00:00 2001 From: Shaun Ren Date: Thu, 17 Oct 2024 11:08:37 -0400 Subject: [PATCH] vkd3d-shader/ir: Validate control point counts correctly. Allow zero input control points for domain shaders, and zero output control points for hull shaders. --- libs/vkd3d-shader/ir.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index b47f12d2..e23c81fa 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -7700,8 +7700,10 @@ enum vkd3d_result vsir_program_validate(struct vsir_program *program, uint64_t c switch (program->shader_version.type) { - case VKD3D_SHADER_TYPE_HULL: case VKD3D_SHADER_TYPE_DOMAIN: + break; + + case VKD3D_SHADER_TYPE_HULL: case VKD3D_SHADER_TYPE_GEOMETRY: if (program->input_control_point_count == 0) validator_error(&ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE, @@ -7718,9 +7720,6 @@ enum vkd3d_result vsir_program_validate(struct vsir_program *program, uint64_t c switch (program->shader_version.type) { case VKD3D_SHADER_TYPE_HULL: - if (program->output_control_point_count == 0) - validator_error(&ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE, - "Invalid zero output control point count."); break; default: