[Mesa-dev] [PATCH V2 10/22] mesa: implement sample mask
Eric Anholt
eric at anholt.net
Tue Feb 5 14:38:16 PST 2013
Chris Forbes <chrisf at ijw.co.nz> writes:
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> index 056bacb..3a618fc 100644
> --- a/src/mesa/main/get.c
> +++ b/src/mesa/main/get.c
> @@ -1635,6 +1635,15 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
> 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;
> }
Something went horribly wrong with indentation here.
> @@ -92,7 +96,15 @@ _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);
> + FLUSH_VERTICES(ctx, 0);
> +
> + if (index != 0) {
> + _mesa_error(ctx, GL_INVALID_VALUE, "glSampleMaski(index)");
> + return;
> + }
> +
> + ctx->Multisample.SampleMaskValue = mask;
> + ctx->NewState |= _NEW_MULTISAMPLE;
You can optionally fold the _NEW_MULTISAMPLE NewState into the second
arg of FLUSH_VERTICES since you aren't doing any special NewState
flagging reduction.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130205/76763d1b/attachment-0001.pgp>
More information about the mesa-dev
mailing list