mesa: enable ARB_vertex_attrib_64bit in compat profile
[mesa.git] / src / mesa / main / multisample.c
index 037c8a6a15c9870519b2aa51fc5a112bc1db6ace..f93a18832da5e0976bccdc46fa91fd8a30e15acb 100644 (file)
@@ -67,6 +67,8 @@ _mesa_init_multisample(struct gl_context *ctx)
    ctx->Multisample.SampleCoverage = GL_FALSE;
    ctx->Multisample.SampleCoverageValue = 1.0;
    ctx->Multisample.SampleCoverageInvert = GL_FALSE;
+   ctx->Multisample.SampleShading = GL_FALSE;
+   ctx->Multisample.MinSampleShadingValue = 0.0f;
 
    /* ARB_texture_multisample / GL3.2 additions */
    ctx->Multisample.SampleMask = GL_FALSE;
@@ -85,7 +87,7 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)
 
    switch (pname) {
    case GL_SAMPLE_POSITION: {
-      if ((int) index >= ctx->DrawBuffer->Visual.samples) {
+      if (index >= ctx->DrawBuffer->Visual.samples) {
          _mesa_error( ctx, GL_INVALID_VALUE, "glGetMultisamplefv(index)" );
          return;
       }
@@ -99,6 +101,24 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)
       return;
    }
 
+   case GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB:
+      if (!ctx->Extensions.ARB_sample_locations) {
+         _mesa_error( ctx, GL_INVALID_ENUM, "glGetMultisamplefv(pname)" );
+         return;
+      }
+
+      if (index >= MAX_SAMPLE_LOCATION_TABLE_SIZE * 2) {
+         _mesa_error( ctx, GL_INVALID_VALUE, "glGetMultisamplefv(index)" );
+         return;
+      }
+
+      if (ctx->DrawBuffer->SampleLocationTable)
+         *val = ctx->DrawBuffer->SampleLocationTable[index];
+      else
+         *val = 0.5f;
+
+      return;
+
    default:
       _mesa_error( ctx, GL_INVALID_ENUM, "glGetMultisamplefv(pname)" );
       return;
@@ -158,6 +178,13 @@ min_sample_shading(struct gl_context *ctx, GLclampf value)
 /**
  * Called via glMinSampleShadingARB
  */
+void GLAPIENTRY
+_mesa_MinSampleShading_no_error(GLclampf value)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   min_sample_shading(ctx, value);
+}
+
 void GLAPIENTRY
 _mesa_MinSampleShading(GLclampf value)
 {