Mesa (master): mesa: fix glPopAttrib for GL_COORD_REPLACE for r200

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 8 19:12:54 UTC 2020


Module: Mesa
Branch: master
Commit: 8f11b848c3ec4b7169fcab226efe1d130b997af2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f11b848c3ec4b7169fcab226efe1d130b997af2

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Dec  5 11:47:50 2020 -0500

mesa: fix glPopAttrib for GL_COORD_REPLACE for r200

Fixes: 959380dc "mesa: more optimizations in glPopAttrib (colormask, drawbuffers, coord replace)"

Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7956>

---

 src/mesa/main/attrib.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 0e385111dd9..8f1fff8dfaa 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -970,11 +970,22 @@ _mesa_PopAttrib(void)
          TEST_AND_CALL1_SEL(Point.MaxSize, PointParameterf, GL_POINT_SIZE_MAX_EXT);
          TEST_AND_CALL1_SEL(Point.Threshold, PointParameterf, GL_POINT_FADE_THRESHOLD_SIZE_EXT);
       }
-      if (ctx->Extensions.NV_point_sprite
-          || ctx->Extensions.ARB_point_sprite) {
+      if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite) {
          if (ctx->Point.CoordReplace != attr->Point.CoordReplace) {
             ctx->NewState |= _NEW_POINT;
             ctx->Point.CoordReplace = attr->Point.CoordReplace;
+
+            if (ctx->Driver.TexEnv) {
+               unsigned active_texture = ctx->Texture.CurrentUnit;
+
+               for (unsigned i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+                  float param = !!(ctx->Point.CoordReplace & (1 << i));
+                  ctx->Texture.CurrentUnit = i;
+                  ctx->Driver.TexEnv(ctx, GL_POINT_SPRITE, GL_COORD_REPLACE,
+                                     &param);
+               }
+               ctx->Texture.CurrentUnit = active_texture;
+            }
          }
          TEST_AND_UPDATE(ctx->Point.PointSprite, attr->Point.PointSprite,
                          GL_POINT_SPRITE_NV);



More information about the mesa-commit mailing list