mesa: add KHR_no_error support for FramebufferTextureLayer
[mesa.git] / src / mesa / main / enable.c
index 1d674bf39f6e136a365c96249dd7057862ebc08f..ef278a318a1bd2dfc329290dd6287c74ed55c976 100644 (file)
@@ -35,7 +35,6 @@
 #include "enable.h"
 #include "errors.h"
 #include "light.h"
-#include "util/simple_list.h"
 #include "mtypes.h"
 #include "enums.h"
 #include "api_arrayelt.h"
@@ -227,7 +226,7 @@ enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit)
    if (texUnit->Enabled == newenabled)
        return GL_FALSE;
 
-   FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+   FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
    texUnit->Enabled = newenabled;
    return GL_TRUE;
 }
@@ -386,6 +385,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
             return;
          FLUSH_VERTICES(ctx, _NEW_FOG);
          ctx->Fog.Enabled = state;
+         ctx->Fog._PackedEnabledMode = state ? ctx->Fog._PackedMode : FOG_NONE;
          break;
       case GL_LIGHT0:
       case GL_LIGHT1:
@@ -402,11 +402,10 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          FLUSH_VERTICES(ctx, _NEW_LIGHT);
          ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
          if (state) {
-            insert_at_tail(&ctx->Light.EnabledList,
-                           &ctx->Light.Light[cap-GL_LIGHT0]);
+            ctx->Light._EnabledLights |= 1u << (cap - GL_LIGHT0);
          }
          else {
-            remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]);
+            ctx->Light._EnabledLights &= ~(1u << (cap - GL_LIGHT0));
          }
          break;
       case GL_LIGHTING:
@@ -441,6 +440,16 @@ _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_has_INTEL_conservative_rasterization(ctx))
+            goto invalid_enum_error;
+         if (ctx->IntelConservativeRasterization == state)
+            return;
+         FLUSH_VERTICES(ctx, 0);
+         ctx->NewDriverState |=
+            ctx->DriverFlags.NewIntelConservativeRasterization;
+         ctx->IntelConservativeRasterization = state;
+         break;
       case GL_COLOR_LOGIC_OP:
          if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
             goto invalid_enum_error;
@@ -710,7 +719,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
                   newenabled |= coordBit;
                if (texUnit->TexGenEnabled == newenabled)
                   return;
-               FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+               FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
                texUnit->TexGenEnabled = newenabled;
             }
          }
@@ -731,7 +740,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
                   newenabled |= STR_BITS;
                if (texUnit->TexGenEnabled == newenabled)
                   return;
-               FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+               FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
                texUnit->TexGenEnabled = newenabled;
             }
          }
@@ -950,7 +959,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
             goto invalid_enum_error;
         CHECK_EXTENSION(ARB_seamless_cube_map, cap);
         if (ctx->Texture.CubeMapSeamless != state) {
-           FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+           FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT);
            ctx->Texture.CubeMapSeamless = state;
         }
         break;
@@ -1019,6 +1028,14 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          ctx->Multisample.SampleMask = state;
          break;
 
+      case GL_BLEND_ADVANCED_COHERENT_KHR:
+         CHECK_EXTENSION(KHR_blend_equation_advanced_coherent, cap);
+         if (ctx->Color.BlendCoherent == state)
+            return;
+         FLUSH_VERTICES(ctx, _NEW_COLOR);
+         ctx->Color.BlendCoherent = state;
+         break;
+
       default:
          goto invalid_enum_error;
    }
@@ -1621,6 +1638,14 @@ _mesa_IsEnabled( GLenum cap )
          CHECK_EXTENSION(ARB_sample_shading);
          return ctx->Multisample.SampleShading;
 
+      case GL_BLEND_ADVANCED_COHERENT_KHR:
+         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;
    }