diff options
author | Chris Forbes <[email protected]> | 2012-11-30 21:22:14 +1300 |
---|---|---|
committer | Chris Forbes <[email protected]> | 2013-03-02 11:35:16 +1300 |
commit | 1822496f3a7baf1c1726fda008cb89fbbade5c8d (patch) | |
tree | 03eec65012883b8a943b24fdc8837bd3fa0b0f14 /src/mesa/main/multisample.c | |
parent | 7c1017e292b2d27af6d7e15db874f50223d73e15 (diff) |
mesa: implement sample mask
V2: - fix multiline comment style
- stop using ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH since that
doesn't exist anymore.
V3: - check for the extension being enabled
- tidier flagging of _NEW_MULTISAMPLE
- fix weird indentation in get.c
V4: - move flush later in SampleMaski()
Signed-off-by: Chris Forbes <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/multisample.c')
-rw-r--r-- | src/mesa/main/multisample.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c index 2d3a35ef389..2484946158f 100644 --- a/src/mesa/main/multisample.c +++ b/src/mesa/main/multisample.c @@ -60,6 +60,10 @@ _mesa_init_multisample(struct gl_context *ctx) 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; } @@ -93,6 +97,18 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val) 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; } |