Module: Mesa Branch: main Commit: a141b5264109f133ba244514e382514cb313295e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a141b5264109f133ba244514e382514cb313295e
Author: Marek Olšák <[email protected]> Date: Mon Nov 20 05:41:31 2023 -0500 st/mesa: disable light_twoside if back faces are culled This potentially improves performance. Reviewed-by: Tapani Pälli <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26308> --- 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;
