st/mesa: disable light_twoside if back faces are culled

This potentially improves performance.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26308>
This commit is contained in:
Marek Olšák
2023-11-20 05:41:31 -05:00
committed by Marge Bot
parent 2d3f0a834a
commit a141b52641

View File

@@ -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;