#include "context.h"
#include "barrier.h"
+#include "state_tracker/st_cb_texturebarrier.h"
+
void GLAPIENTRY
_mesa_TextureBarrierNV(void)
{
return;
}
- ctx->Driver.TextureBarrier(ctx);
+ st_TextureBarrier(ctx);
}
void GLAPIENTRY
{
GET_CURRENT_CONTEXT(ctx);
- if (ctx->Driver.MemoryBarrier)
- ctx->Driver.MemoryBarrier(ctx, barriers);
+ st_MemoryBarrier(ctx, barriers);
}
static ALWAYS_INLINE void
GL_TEXTURE_FETCH_BARRIER_BIT |
GL_UNIFORM_BARRIER_BIT;
- if (ctx->Driver.MemoryBarrier) {
- /* From section 7.11.2 of the OpenGL ES 3.1 specification:
- *
- * "When barriers is ALL_BARRIER_BITS, shader memory accesses will be
- * synchronized relative to all these barrier bits, but not to other
- * barrier bits specific to MemoryBarrier."
- *
- * That is, if barriers is the special value GL_ALL_BARRIER_BITS, then all
- * barriers allowed by glMemoryBarrierByRegion should be activated."
- */
- if (barriers == GL_ALL_BARRIER_BITS) {
- ctx->Driver.MemoryBarrier(ctx, all_allowed_bits);
- return;
- }
-
- /* From section 7.11.2 of the OpenGL ES 3.1 specification:
- *
- * "An INVALID_VALUE error is generated if barriers is not the special
- * value ALL_BARRIER_BITS, and has any bits set other than those
- * described above."
- */
- if (!no_error && (barriers & ~all_allowed_bits) != 0) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glMemoryBarrierByRegion(unsupported barrier bit");
- }
-
- ctx->Driver.MemoryBarrier(ctx, barriers);
+ /* From section 7.11.2 of the OpenGL ES 3.1 specification:
+ *
+ * "When barriers is ALL_BARRIER_BITS, shader memory accesses will be
+ * synchronized relative to all these barrier bits, but not to other
+ * barrier bits specific to MemoryBarrier."
+ *
+ * That is, if barriers is the special value GL_ALL_BARRIER_BITS, then all
+ * barriers allowed by glMemoryBarrierByRegion should be activated."
+ */
+ if (barriers == GL_ALL_BARRIER_BITS) {
+ st_MemoryBarrier(ctx, all_allowed_bits);
+ return;
}
+
+ /* From section 7.11.2 of the OpenGL ES 3.1 specification:
+ *
+ * "An INVALID_VALUE error is generated if barriers is not the special
+ * value ALL_BARRIER_BITS, and has any bits set other than those
+ * described above."
+ */
+ if (!no_error && (barriers & ~all_allowed_bits) != 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glMemoryBarrierByRegion(unsupported barrier bit");
+ }
+
+ st_MemoryBarrier(ctx, barriers);
}
void GLAPIENTRY
return;
}
- ctx->Driver.FramebufferFetchBarrier(ctx);
+ st_FramebufferFetchBarrier(ctx);
}
void GLAPIENTRY
return;
}
- ctx->Driver.FramebufferFetchBarrier(ctx);
+ st_FramebufferFetchBarrier(ctx);
}
struct gl_transform_feedback_object *obj);
/**
- * \name GL_NV_texture_barrier interface
- */
- void (*TextureBarrier)(struct gl_context *ctx);
-
- /**
* \name GL_ARB_texture_multisample
*/
void (*GetSamplePosition)(struct gl_context *ctx,
GLenum (*GetGraphicsResetStatus)(struct gl_context *ctx);
/**
- * \name GL_ARB_shader_image_load_store interface.
- */
- /** @{ */
- void (*MemoryBarrier)(struct gl_context *ctx, GLbitfield barriers);
- /** @} */
-
- /**
- * GL_EXT_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
- * EXT_shader_framebuffer_fetch_non_coherent interface.
- */
- /** @{ */
- void (*FramebufferFetchBarrier)(struct gl_context *ctx);
- /** @} */
-
- /**
* \name GL_ARB_compute_shader interface
*/
/*@{*/
/**
* Called via ctx->Driver.TextureBarrier()
*/
-static void
+void
st_TextureBarrier(struct gl_context *ctx)
{
struct pipe_context *pipe = st_context(ctx)->pipe;
/**
* Called via ctx->Driver.FramebufferFetchBarrier()
*/
-static void
+void
st_FramebufferFetchBarrier(struct gl_context *ctx)
{
struct pipe_context *pipe = st_context(ctx)->pipe;
/**
* Called via ctx->Driver.MemoryBarrier()
*/
-static void
+void
st_MemoryBarrier(struct gl_context *ctx, GLbitfield barriers)
{
struct pipe_context *pipe = st_context(ctx)->pipe;
if (flags && pipe->memory_barrier)
pipe->memory_barrier(pipe, flags);
}
-
-void st_init_texture_barrier_functions(struct dd_function_table *functions)
-{
- functions->TextureBarrier = st_TextureBarrier;
- functions->FramebufferFetchBarrier = st_FramebufferFetchBarrier;
- functions->MemoryBarrier = st_MemoryBarrier;
-}
#include "st_cb_texture.h"
#include "st_cb_xformfb.h"
#include "st_cb_flush.h"
-#include "st_cb_texturebarrier.h"
#include "st_cb_viewport.h"
#include "st_atom.h"
#include "st_draw.h"
st_init_readpixels_functions(functions);
st_init_semaphoreobject_functions(functions);
st_init_texture_functions(functions);
- st_init_texture_barrier_functions(functions);
st_init_flush_functions(screen, functions);
st_init_viewport_functions(functions);
st_init_compute_functions(functions);