Module: Mesa
Branch: main
Commit: 6214c9921a26a88aea77fad0414c409dfbd32232
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6214c9921a26a88aea77fad0414c409dfbd32232

Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri Feb 10 17:21:17 2023 -0500

agx: Remove bogus gl_Position assertion

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>

---

 src/asahi/compiler/agx_compile.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c
index bf261a40aa6..58448ddb917 100644
--- a/src/asahi/compiler/agx_compile.c
+++ b/src/asahi/compiler/agx_compile.c
@@ -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;
 

Reply via email to