mesa: Flush vertices before changing the OpenGL state.
authorMathias Fröhlich <mathias.froehlich@web.de>
Wed, 26 Feb 2020 06:49:27 +0000 (07:49 +0100)
committerMathias Fröhlich <mathias.froehlich@web.de>
Thu, 27 Feb 2020 05:58:56 +0000 (06:58 +0100)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3958>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3958>

src/mesa/main/conservativeraster.c

index 9068a00b4c93b4ff90b715ab705a85b7ba5de415..d27c21c1f361fe7d831100051030e91c86a30925 100644 (file)
@@ -59,6 +59,11 @@ conservative_raster_parameter(GLenum pname, GLfloat param,
          _mesa_error(ctx, GL_INVALID_VALUE, "%s(param=%g)", func, param);
          return;
       }
+
+      FLUSH_VERTICES(ctx, 0);
+      ctx->NewDriverState |=
+         ctx->DriverFlags.NewNvConservativeRasterizationParams;
+
       ctx->ConservativeRasterDilate =
          CLAMP(param,
                ctx->Const.ConservativeRasterDilateRange[0],
@@ -74,6 +79,11 @@ conservative_raster_parameter(GLenum pname, GLfloat param,
                      "%s(pname=%s)", func, _mesa_enum_to_string(param));
          return;
       }
+
+      FLUSH_VERTICES(ctx, 0);
+      ctx->NewDriverState |=
+         ctx->DriverFlags.NewNvConservativeRasterizationParams;
+
       ctx->ConservativeRasterMode = param;
       break;
    default:
@@ -81,10 +91,6 @@ conservative_raster_parameter(GLenum pname, GLfloat param,
       break;
    }
 
-   FLUSH_VERTICES(ctx, 0);
-   ctx->NewDriverState |=
-      ctx->DriverFlags.NewNvConservativeRasterizationParams;
-
    return;
 invalid_pname_enum:
    if (!no_error)