[Mesa-dev] [PATCH] mesa: Save and restore NV_fog_distance & FOG_COORD_SRC state

Nicholas Miell nmiell at gmail.com
Mon Jun 25 18:53:41 UTC 2018


FOG_DISTANCE_MODE_NV & FOG_COORD_SRC weren't getting saved
into display lists or restored on glPopAttrib(GL_FOG_BIT).

Signed-off-by: Nicholas Miell <nmiell at gmail.com>
---
 src/mesa/main/attrib.c | 4 ++++
 src/mesa/main/dlist.c  | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index cbe93ab6faa..29d7089989e 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1177,6 +1177,10 @@ _mesa_PopAttrib(void)
                _mesa_Fogf(GL_FOG_END, fog->End);
                _mesa_Fogf(GL_FOG_INDEX, fog->Index);
                _mesa_Fogi(GL_FOG_MODE, fog->Mode);
+               _mesa_Fogi(GL_FOG_COORD_SRC, fog->FogCoordinateSource);
+
+               if (ctx->Extensions.NV_fog_distance)
+                 _mesa_Fogi(GL_FOG_DISTANCE_MODE_NV, fog->FogDistanceMode);
             }
             break;
          case GL_HINT_BIT:
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 4fc451000b5..8428791f9e8 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -2611,6 +2611,8 @@ save_Fogiv(GLenum pname, const GLint *params)
    case GL_FOG_START:
    case GL_FOG_END:
    case GL_FOG_INDEX:
+   case GL_FOG_COORD_SRC:
+   case GL_FOG_DISTANCE_MODE_NV:
       p[0] = (GLfloat) *params;
       p[1] = 0.0f;
       p[2] = 0.0f;
-- 
2.17.1



More information about the mesa-dev mailing list