summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-03-17 19:49:26 -0500
committerNicolai Hähnle <[email protected]>2016-03-23 11:48:15 -0500
commitfc94bc2986e6a46a45c643c2236f3e2ced4a2bf3 (patch)
treed94f0f728b879e3553736ed2d5e6754e0f63bb59 /src/mesa
parentb15b1faefdf403b727ec416addc3f4ae16feb5c0 (diff)
st/mesa: add missing MemoryBarrier bits and some explanations
Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_cb_texturebarrier.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_texturebarrier.c b/src/mesa/state_tracker/st_cb_texturebarrier.c
index 6319b6258ac..fecba65a64d 100644
--- a/src/mesa/state_tracker/st_cb_texturebarrier.c
+++ b/src/mesa/state_tracker/st_cb_texturebarrier.c
@@ -75,14 +75,37 @@ st_MemoryBarrier(struct gl_context *ctx, GLbitfield barriers)
flags |= PIPE_BARRIER_IMAGE;
if (barriers & GL_COMMAND_BARRIER_BIT)
flags |= PIPE_BARRIER_INDIRECT_BUFFER;
- if (barriers & GL_PIXEL_BUFFER_BARRIER_BIT)
+ if (barriers & GL_PIXEL_BUFFER_BARRIER_BIT) {
+ /* The PBO may be
+ * (1) bound as a texture for PBO uploads, or
+ * (2) accessed by the CPU via transfer ops.
+ * For case (2), we assume automatic flushing by the driver.
+ */
flags |= PIPE_BARRIER_TEXTURE;
+ }
+ /* GL_TEXTURE_UPDATE_BARRIER_BIT:
+ * Texture updates translate to:
+ * (1) texture transfers to/from the CPU,
+ * (2) texture as blit destination, or
+ * (3) texture as framebuffer.
+ * In all cases, we assume the driver does the required flushing
+ * automatically.
+ */
+ /* GL_BUFFER_UPDATE_BARRIER_BIT:
+ * Buffer updates translate to
+ * (1) buffer transfers to/from the CPU,
+ * (2) resource copies and clears.
+ * In all cases, we assume the driver does the required flushing
+ * automatically.
+ */
if (barriers & GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT)
flags |= PIPE_BARRIER_MAPPED_BUFFER;
if (barriers & GL_QUERY_BUFFER_BARRIER_BIT)
flags |= PIPE_BARRIER_QUERY_BUFFER;
if (barriers & GL_FRAMEBUFFER_BARRIER_BIT)
flags |= PIPE_BARRIER_FRAMEBUFFER;
+ if (barriers & GL_TRANSFORM_FEEDBACK_BARRIER_BIT)
+ flags |= PIPE_BARRIER_STREAMOUT_BUFFER;
if (barriers & GL_ATOMIC_COUNTER_BARRIER_BIT)
flags |= PIPE_BARRIER_SHADER_BUFFER;
if (barriers & GL_SHADER_STORAGE_BARRIER_BIT)