turnip: fix compute shaders crashing after geometry shader change
authorJonathan Marek <jonathan@marek.ca>
Wed, 8 Apr 2020 01:13:31 +0000 (21:13 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 8 Apr 2020 01:56:53 +0000 (01:56 +0000)
Fixes: 1af71bee734da7d8 ("turnip: Set has_gs in ir3_shader_key")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4483>

src/freedreno/vulkan/tu_shader.c

index 51e1c65177cf6de9cfd7560b2d0a1a12a2dc97db..bd52335093da3a9bdd66147d91f1781f9158d56f 100644 (file)
@@ -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;
+         }
       }
    }