From d6a8591f72a9f1ce48dc0eefdb89cc0825e8acf7 Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Tue, 7 Apr 2020 21:13:31 -0400 Subject: [PATCH] turnip: fix compute shaders crashing after geometry shader change Fixes: 1af71bee734da7d8 ("turnip: Set has_gs in ir3_shader_key") Signed-off-by: Jonathan Marek Part-of: --- src/freedreno/vulkan/tu_shader.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c index 51e1c65177c..bd52335093d 100644 --- a/src/freedreno/vulkan/tu_shader.c +++ b/src/freedreno/vulkan/tu_shader.c @@ -574,10 +574,12 @@ tu_shader_compile_options_init( const VkGraphicsPipelineCreateInfo *pipeline_info) { bool has_gs = false; - for (uint32_t i = 0; i < pipeline_info->stageCount; i++) { - if (pipeline_info->pStages[i].stage == VK_SHADER_STAGE_GEOMETRY_BIT) { - has_gs = true; - break; + if (pipeline_info) { + for (uint32_t i = 0; i < pipeline_info->stageCount; i++) { + if (pipeline_info->pStages[i].stage == VK_SHADER_STAGE_GEOMETRY_BIT) { + has_gs = true; + break; + } } } -- 2.30.2