}
break;
+ /* ARB_texture_multisample */
+ case GL_SAMPLE_MASK:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ CHECK_EXTENSION(ARB_texture_multisample, cap);
+ if (ctx->Multisample.SampleMask == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleMask = state;
+ break;
+
default:
goto invalid_enum_error;
}
CHECK_EXTENSION(OES_EGL_image_external);
return is_texture_enabled(ctx, TEXTURE_EXTERNAL_BIT);
+ /* ARB_texture_multisample */
+ case GL_SAMPLE_MASK:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ CHECK_EXTENSION(ARB_texture_multisample);
+ return ctx->Multisample.SampleMask;
+
default:
goto invalid_enum_error;
}
goto invalid_enum;
v->value_int = ctx->UniformBufferBindings[index].Size;
return TYPE_INT;
+
+ /* ARB_texture_multisample / GL3.2 */
+ case GL_SAMPLE_MASK_VALUE:
+ if (index != 0)
+ goto invalid_value;
+ if (!ctx->Extensions.ARB_texture_multisample)
+ goto invalid_enum;
+ v->value_int = ctx->Multisample.SampleMaskValue;
+ return TYPE_INT;
}
invalid_enum:
[ "MAX_COLOR_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxColorTextureSamples), extra_ARB_texture_multisample" ],
[ "MAX_DEPTH_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxDepthTextureSamples), extra_ARB_texture_multisample" ],
[ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), extra_ARB_texture_multisample" ],
+ [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), extra_ARB_texture_multisample" ],
+ [ "MAX_SAMPLE_MASK_WORDS", "CONST(1), extra_ARB_texture_multisample" ],
# GL_ARB_sampler_objects / GL 3.3
GLboolean SampleCoverage;
GLfloat SampleCoverageValue;
GLboolean SampleCoverageInvert;
+
+ /* ARB_texture_multisample / GL3.2 additions */
+ GLboolean SampleMask;
+ GLbitfield SampleMaskValue; /* GL spec defines this as an array but >32x MSAA is
+ * madness
+ */
};
ctx->Multisample.SampleCoverage = GL_FALSE;
ctx->Multisample.SampleCoverageValue = 1.0;
ctx->Multisample.SampleCoverageInvert = GL_FALSE;
+
+ /* ARB_texture_multisample / GL3.2 additions */
+ ctx->Multisample.SampleMask = GL_FALSE;
+ ctx->Multisample.SampleMaskValue = ~(GLbitfield)0;
}
void GLAPIENTRY
_mesa_SampleMaski(GLuint index, GLbitfield mask)
{
- assert(!"Not implemented");
- // TODO: make this work
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (!ctx->Extensions.ARB_texture_multisample) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleMaski");
+ return;
+ }
+
+ if (index != 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSampleMaski(index)");
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleMaskValue = mask;
}