mesa: add support for GL_INTEL_conservative_rasterization
[mesa.git] / src / mesa / main / enable.c
index d1ab81e50eef3acba0b038a636588b8348ca5629..c9f10abb383797ca7e4301b23466073b68403c55 100644 (file)
@@ -439,6 +439,14 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          FLUSH_VERTICES(ctx, _NEW_COLOR);
          ctx->Color.IndexLogicOpEnabled = state;
          break;
+      case GL_CONSERVATIVE_RASTERIZATION_INTEL:
+         if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
+            goto invalid_enum_error;
+         if (ctx->IntelConservativeRasterization == state)
+            return;
+         FLUSH_VERTICES(ctx, _NEW_POLYGON);
+         ctx->IntelConservativeRasterization = state;
+         break;
       case GL_COLOR_LOGIC_OP:
          if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
             goto invalid_enum_error;
@@ -1631,6 +1639,10 @@ _mesa_IsEnabled( GLenum cap )
          CHECK_EXTENSION(KHR_blend_equation_advanced_coherent);
          return ctx->Color.BlendCoherent;
 
+      case GL_CONSERVATIVE_RASTERIZATION_INTEL:
+         CHECK_EXTENSION(INTEL_conservative_rasterization);
+         return ctx->IntelConservativeRasterization;
+
       default:
          goto invalid_enum_error;
    }