Mesa (main): mesa: enforce pointsize exports if pointsize is being clamped

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 22 13:53:25 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon Jun 20 14:38:06 2022 -0400

mesa: enforce pointsize exports if pointsize is being clamped

min/max pointsize clamping affects the value that must be used,
meaning that it may not be 1.0

in the case where clamping changes the value from 1.0, ensure the shader
export path is used if attenuation isn't enabled

Acked-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17145>

---

 src/mesa/main/points.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index ec0be2f25c1..367ee3a6317 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -39,7 +39,8 @@
 static void
 update_point_size_set(struct gl_context *ctx)
 {
-   ctx->PointSizeIsSet = ctx->Point.Size == 1.0 || ctx->Point._Attenuated;
+   float size = CLAMP(ctx->Point.Size, ctx->Point.MinSize, ctx->Point.MaxSize);
+   ctx->PointSizeIsSet = (size == 1.0 && ctx->Point.Size == 1.0) || ctx->Point._Attenuated;
 }
 
 /**



More information about the mesa-commit mailing list