From: Jonathan Marek Date: Wed, 8 Apr 2020 01:13:31 +0000 (-0400) Subject: turnip: fix compute shaders crashing after geometry shader change X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6a8591f72a9f1ce48dc0eefdb89cc0825e8acf7;p=mesa.git 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: --- 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; + } } }