turnip: Execute ir3_nir_lower_gs pass again
[mesa.git] / src / compiler / nir / nir_gather_info.c
index e80a65f19fd618dc8333ce476c3f562fde21f600..f62adb6e1f45ef31ba626ae8d9860a91a204a4dd 100644 (file)
@@ -290,8 +290,11 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader,
    /* fallthrough: quads with helper lanes only might be discarded entirely */
    case nir_intrinsic_discard:
    case nir_intrinsic_discard_if:
-      assert(shader->info.stage == MESA_SHADER_FRAGMENT);
-      shader->info.fs.uses_discard = true;
+      /* Freedreno uses the discard_if intrinsic to end GS invocations that
+       * don't produce a vertex, so we only set uses_discard if executing on
+       * a fragment shader. */
+      if (shader->info.stage == MESA_SHADER_FRAGMENT)
+         shader->info.fs.uses_discard = true;
       break;
 
    case nir_intrinsic_interp_deref_at_centroid: