From 4470ec63ccc727c48e85af16bfeecc07e48e6674 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 15 Apr 2021 14:54:27 +0100 Subject: [PATCH] vkd3d-shader: Don't emit builtin clip/cull arrays for hull shaders There are no output built-ins here, just per-vertex stuff passed directly to DS to deal with there. Closes: #227 Signed-off-by: Joshua Ashton --- libs/vkd3d-shader/spirv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index c1e560ed..6452dc72 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5624,9 +5624,15 @@ static void vkd3d_dxbc_compiler_emit_initial_declarations(struct vkd3d_dxbc_comp } if (compiler->shader_type != VKD3D_SHADER_TYPE_HULL) + { vkd3d_spirv_builder_begin_main_function(builder); - vkd3d_dxbc_compiler_emit_clip_cull_outputs(compiler); + /* Don't emit arrayed clip/cull builtins for HULL + * shaders, as this is simply just per-vertex state + * passed directly to DS to deal with, like SV_Position. */ + vkd3d_dxbc_compiler_emit_clip_cull_outputs(compiler); + } + } static size_t vkd3d_dxbc_compiler_get_current_function_location(struct vkd3d_dxbc_compiler *compiler)