[Mesa-dev] [PATCH 2/8] mesa: Add new functions and enums required by GL_ARB_sample_shading
Ian Romanick
idr at freedesktop.org
Tue Oct 15 19:09:56 CEST 2013
On 10/14/2013 10:12 AM, Anuj Phogat wrote:
> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
> index 48fce36..8919852 100644
> --- a/src/mapi/glapi/gen/gl_API.xml
> +++ b/src/mapi/glapi/gen/gl_API.xml
> @@ -8187,7 +8187,7 @@
> <xi:include href="ARB_draw_buffers_blend.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
> <xi:include href="AMD_draw_buffers_blend.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
>
> -<!-- 70. GL_ARB_sample_shading -->
> +<xi:include href="ARB_sample_shading.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
You'll also need to update the API_XML list in Makefile.am.
> <xi:include href="ARB_texture_cube_map_array.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
> <xi:include href="ARB_texture_gather.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
> <!-- 73. GL_ARB_texture_query_lod -->
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> index 89b3bf0..c52133e 100644
> --- a/src/mesa/main/get.c
> +++ b/src/mesa/main/get.c
> @@ -894,6 +894,10 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
> _mesa_problem(ctx, "driver doesn't implement GetTimestamp");
> }
> break;
> + /* GL_ARB_sample_shading */
> + case GL_MIN_SAMPLE_SHADING_VALUE_ARB:
> + v->value_float = ctx->Multisample.MinSampleShadingValue;
> + break;
This hunk is unnecessary. The code you added in get_hash_params.py
takes care of this case.
> }
> }
>
> diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
> index 9c54af0..0d7effb 100644
> --- a/src/mesa/main/get_hash_params.py
> +++ b/src/mesa/main/get_hash_params.py
> @@ -83,6 +83,9 @@ descriptor=[
> [ "SAMPLE_BUFFERS_ARB", "BUFFER_INT(Visual.sampleBuffers), extra_new_buffers" ],
> [ "SAMPLES_ARB", "BUFFER_INT(Visual.samples), extra_new_buffers" ],
>
> +# GL_ARB_sample_shading
> + [ "MIN_SAMPLE_SHADING_VALUE_ARB", "CONTEXT_FLOAT(Multisample.MinSampleShadingValue), NO_EXTRA" ],
> +
NO_EXTRA isn't correct. You'll need to add an
extra_ARB_sample_shading_gl40 predicate to get.c and use it here.
> # GL_SGIS_generate_mipmap
> [ "GENERATE_MIPMAP_HINT_SGIS", "CONTEXT_ENUM(Hint.GenerateMipmap), NO_EXTRA" ],
>
> diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
> index bd97c50..892525e 100644
> --- a/src/mesa/main/multisample.c
> +++ b/src/mesa/main/multisample.c
> @@ -119,6 +119,19 @@ _mesa_SampleMaski(GLuint index, GLbitfield mask)
> ctx->Multisample.SampleMaskValue = mask;
> }
>
> +/**
> + * Called via glMinSampleShadingARB
> + */
> +void GLAPIENTRY
> +_mesa_MinSampleShading(GLclampf value)
> +{
> + GET_CURRENT_CONTEXT(ctx);
Missing extension check.
> +
> + FLUSH_VERTICES(ctx, 0);
> +
> + ctx->Multisample.MinSampleShadingValue = (GLfloat) CLAMP(value, 0.0, 1.0);
> + ctx->NewState |= _NEW_MULTISAMPLE;
> +}
>
> /**
> * Helper for checking a requested sample count against the limit
More information about the mesa-dev
mailing list