[Mesa-dev] [PATCH 06/17] mesa: Add blend barrier entry point and driver hook.
Kenneth Graunke
kenneth at whitecape.org
Sat Aug 13 00:39:50 UTC 2016
On Wednesday, July 20, 2016 9:49:36 PM PDT Francisco Jerez wrote:
> Both MESA_shader_framebuffer_fetch_non_coherent and the non-coherent
> variant of KHR_blend_equation_advanced will use this driver hook to
> request coherency between framebuffer reads and writes. This
> intentionally doesn't hook up glBlendBarrierMESA to the dispatch layer
> since the extension isn't exposed to applications yet, see [1]
> for more details.
>
> [1] https://lists.freedesktop.org/archives/mesa-dev/2016-July/124028.html
> ---
> src/mesa/main/barrier.c | 14 ++++++++++++++
> src/mesa/main/barrier.h | 3 +++
> src/mesa/main/dd.h | 12 ++++++++++++
> 3 files changed, 29 insertions(+)
>
> diff --git a/src/mesa/main/barrier.c b/src/mesa/main/barrier.c
> index 7ae8fc6..42a5e0f 100644
> --- a/src/mesa/main/barrier.c
> +++ b/src/mesa/main/barrier.c
> @@ -108,3 +108,17 @@ _mesa_MemoryBarrierByRegion(GLbitfield barriers)
> ctx->Driver.MemoryBarrier(ctx, barriers);
> }
> }
> +
> +void GLAPIENTRY
> +_mesa_BlendBarrierMESA(void)
> +{
> + GET_CURRENT_CONTEXT(ctx);
> +
> + if (!ctx->Extensions.MESA_shader_framebuffer_fetch_non_coherent) {
> + _mesa_error(ctx, GL_INVALID_OPERATION,
> + "glBlendBarrier(not supported)");
> + return;
> + }
> +
> + ctx->Driver.BlendBarrier(ctx);
> +}
> diff --git a/src/mesa/main/barrier.h b/src/mesa/main/barrier.h
> index 8eee583..21dce90 100644
> --- a/src/mesa/main/barrier.h
> +++ b/src/mesa/main/barrier.h
> @@ -47,4 +47,7 @@ _mesa_MemoryBarrier(GLbitfield barriers);
> void GLAPIENTRY
> _mesa_MemoryBarrierByRegion(GLbitfield barriers);
>
> +void GLAPIENTRY
> +_mesa_BlendBarrierMESA(void);
> +
> #endif /* BARRIER_H */
> diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
> index 114cbd2..807cb2a 100644
> --- a/src/mesa/main/dd.h
> +++ b/src/mesa/main/dd.h
> @@ -959,6 +959,18 @@ struct dd_function_table {
> /** @} */
>
> /**
> + * GL_MESA_shader_framebuffer_fetch_non_coherent rendering barrier.
> + *
> + * On return from this function any framebuffer contents written by
> + * previous draw commands are guaranteed to be visible from subsequent
> + * fragment shader invocations using the
> + * MESA_shader_framebuffer_fetch_non_coherent interface.
> + */
> + /** @{ */
> + void (*BlendBarrier)(struct gl_context *ctx);
> + /** @} */
> +
> + /**
> * \name GL_ARB_compute_shader interface
> */
> /*@{*/
>
Don't you need to add this to the glapi XML? Otherwise, it probably
won't actually be exposed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160812/a44f9670/attachment.sig>
More information about the mesa-dev
mailing list