From a141b5264109f133ba244514e382514cb313295e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 20 Nov 2023 05:41:31 -0500 Subject: [PATCH] st/mesa: disable light_twoside if back faces are culled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This potentially improves performance. Reviewed-by: Tapani Pälli Part-of: --- src/mesa/state_tracker/st_atom_rasterizer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index f76991e2d75..160860d4463 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -295,6 +295,10 @@ st_update_rasterizer(struct st_context *st) raster->cull_face |= PIPE_FACE_BACK; } + /* Disable two-sided colors if back faces are culled. */ + if (raster->cull_face & PIPE_FACE_BACK) + raster->light_twoside = 0; + /* _NEW_TRANSFORM */ raster->depth_clip_near = !ctx->Transform.DepthClampNear; raster->depth_clip_far = !ctx->Transform.DepthClampFar;