agx: Remove bogus gl_Position assertion
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Fri, 10 Feb 2023 22:21:17 +0000 (17:21 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 13 Feb 2023 10:48:13 +0000 (10:48 +0000)
It is reasonable not to write gl_Position in a transform feedback program.

Fixes rendering of the apitrace of Domekeeper in #7798.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>

src/asahi/compiler/agx_compile.c

index bf261a4..58448dd 100644 (file)
@@ -1762,7 +1762,10 @@ agx_remap_varyings_vs(nir_shader *nir, struct agx_varyings_vs *varyings)
    for (unsigned i = 0; i < ARRAY_SIZE(varyings->slots); ++i)
       varyings->slots[i] = ~0;
 
-   assert(nir->info.outputs_written & VARYING_BIT_POS);
+   /* gl_Position is implicitly written, although it may validly be absent in
+    * vertex programs run only for transform feedback. Those ignore their
+    * varyings so it doesn't matter what we do here as long as we don't fail.
+    */
    varyings->slots[VARYING_SLOT_POS] = base;
    base += 4;