diff options
author | marha <marha@users.sourceforge.net> | 2013-03-04 09:37:48 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-03-04 09:37:48 +0100 |
commit | ed474047e06f28fe740130f3bb13d3a40f4833a9 (patch) | |
tree | 35a48f61c00ebb1f0579159c25dbbd1bfe812849 /mesalib/src/mesa/main/multisample.c | |
parent | 3c0e16af61a9e0b6f9edab1d403adfaa85456599 (diff) | |
parent | d4d629b77742e60caac3d120ff40e9f386380af2 (diff) | |
download | vcxsrv-ed474047e06f28fe740130f3bb13d3a40f4833a9.tar.gz vcxsrv-ed474047e06f28fe740130f3bb13d3a40f4833a9.tar.bz2 vcxsrv-ed474047e06f28fe740130f3bb13d3a40f4833a9.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
fontconfig libX11 mesalib pixman xserver xkeyboard-config git update 4 Mar 2013
Conflicts:
libX11/src/xkb/XKBGAlloc.c
libX11/src/xkb/XKBMisc.c
Diffstat (limited to 'mesalib/src/mesa/main/multisample.c')
-rw-r--r-- | mesalib/src/mesa/main/multisample.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/multisample.c b/mesalib/src/mesa/main/multisample.c index f792ad01e..248494615 100644 --- a/mesalib/src/mesa/main/multisample.c +++ b/mesalib/src/mesa/main/multisample.c @@ -28,6 +28,7 @@ #include "main/macros.h" #include "main/multisample.h" #include "main/mtypes.h" +#include "main/fbobject.h" /** @@ -59,4 +60,55 @@ _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; +} + + +void GLAPIENTRY +_mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val) +{ + GET_CURRENT_CONTEXT(ctx); + + switch (pname) { + case GL_SAMPLE_POSITION: { + if (index >= ctx->DrawBuffer->Visual.samples) { + _mesa_error( ctx, GL_INVALID_VALUE, "glGetMultisamplefv(index)" ); + return; + } + + ctx->Driver.GetSamplePosition(ctx, ctx->DrawBuffer, index, val); + + /* winsys FBOs are upside down */ + if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) + val[1] = 1 - val[1]; + + return; + } + + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetMultisamplefv(pname)" ); + return; + } +} + +void GLAPIENTRY +_mesa_SampleMaski(GLuint index, GLbitfield mask) +{ + 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; } |