summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-07-19 10:34:06 +0200
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-07-31 13:53:39 +0200
commit4de0033d73353f186eec8778074674da87090c5f (patch)
treeefed65f1adeae9c892469690c122bf897dcee873
parentd21ae02fb227ed80f27417ac3fc0b83e491e8c01 (diff)
mesa: add memory_barrier_by_region() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
-rw-r--r--src/mesa/main/barrier.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/main/barrier.c b/src/mesa/main/barrier.c
index e55d13cb6b..0798d6efad 100644
--- a/src/mesa/main/barrier.c
+++ b/src/mesa/main/barrier.c
@@ -67,11 +67,10 @@ _mesa_MemoryBarrier(GLbitfield barriers)
ctx->Driver.MemoryBarrier(ctx, barriers);
}
-void GLAPIENTRY
-_mesa_MemoryBarrierByRegion(GLbitfield barriers)
+static ALWAYS_INLINE void
+memory_barrier_by_region(struct gl_context *ctx, GLbitfield barriers,
+ bool no_error)
{
- GET_CURRENT_CONTEXT(ctx);
-
GLbitfield all_allowed_bits = GL_ATOMIC_COUNTER_BARRIER_BIT |
GL_FRAMEBUFFER_BARRIER_BIT |
GL_SHADER_IMAGE_ACCESS_BARRIER_BIT |
@@ -100,7 +99,7 @@ _mesa_MemoryBarrierByRegion(GLbitfield barriers)
* value ALL_BARRIER_BITS, and has any bits set other than those
* described above."
*/
- if ((barriers & ~all_allowed_bits) != 0) {
+ if (!no_error && (barriers & ~all_allowed_bits) != 0) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glMemoryBarrierByRegion(unsupported barrier bit");
}
@@ -110,6 +109,13 @@ _mesa_MemoryBarrierByRegion(GLbitfield barriers)
}
void GLAPIENTRY
+_mesa_MemoryBarrierByRegion(GLbitfield barriers)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ memory_barrier_by_region(ctx, barriers, false);
+}
+
+void GLAPIENTRY
_mesa_BlendBarrier(void)
{
GET_CURRENT_CONTEXT(ctx);