turnip: Execute ir3_nir_lower_gs pass again

This commit fixes a GS regression introduced in !4562 where
ir3's GS lowering pass was moved from common code (ir3_nir) to
freedreno-specific code (ir3_shader). For GS support in turnip, we
need to add the GS lowering pass back in, this time in tu_shader.

As for the nir_gather_info change, the GS lowering pass has always
introduced a discard_if intrinsic into the GS. Previously, we simply
ran nir_shader_gather_info before GS lowering, but now since we lower
the GS before we need to remove the assertion that only a FS can use
the discard_if intrinsic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4892>
This commit is contained in:
Brian Ho
2020-05-04 13:55:06 -07:00
parent 1bd38746d5
commit a43e974064
2 changed files with 8 additions and 2 deletions

View 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: