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

Author: Roland Scheidegger <[email protected]>
Date:   Sat Aug 27 05:26:34 2022 +0200

llvmpipe: fix front/back face system value in the fs

draw needs to inject the face information for tris in line/point fill
mode since llvmpipe only sees lines and points. But for the new style
face information (which is a system value and not an ordinary input
register) we forgot to tell draw.

Reviewed-by: Brian Paul <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18285>

---

 src/gallium/drivers/llvmpipe/lp_state_derived.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c 
b/src/gallium/drivers/llvmpipe/lp_state_derived.c
index 4df9fd6524f..eb2682145a7 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_derived.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_derived.c
@@ -124,6 +124,18 @@ compute_vertex_info(struct llvmpipe_context *llvmpipe)
       }
    }
 
+   /*
+    * The new style front face is a system value, hence won't show up as
+    * ordinary fs register above. But we still need to assign a vs output
+    * location so draw can inject face info for unfilled tris.
+    */
+   if (llvmpipe->face_slot < 0 && fsInfo->uses_frontface) {
+      vs_index = draw_find_shader_output(llvmpipe->draw,
+                                         TGSI_SEMANTIC_FACE, 0);
+      llvmpipe->face_slot = (int)vinfo->num_attribs;
+      draw_emit_vertex_attr(vinfo, EMIT_4F, vs_index);
+   }
+
    /* Figure out if we need bcolor as well.
     */
    for (i = 0; i < 2; i++) {

Reply via email to