%%%%%%%%%%%%%%%
This function flushes all pending writes to the currently-set surfaces and
-invalidates all read caches of the currently-set samplers.
+invalidates all read caches of the currently-set samplers. This can be used
+for both regular textures as well as for framebuffers read via FBFETCH.
*/
static void
-dd_context_texture_barrier(struct pipe_context *_pipe)
+dd_context_texture_barrier(struct pipe_context *_pipe, unsigned flags)
{
struct pipe_context *pipe = dd_context(_pipe)->pipe;
- pipe->texture_barrier(pipe);
+ pipe->texture_barrier(pipe, flags);
}
static void
}
static void
-ilo_texture_barrier(struct pipe_context *pipe)
+ilo_texture_barrier(struct pipe_context *pipe, unsigned flags)
{
struct ilo_context *ilo = ilo_context(pipe);
}
static void
-nv50_texture_barrier(struct pipe_context *pipe)
+nv50_texture_barrier(struct pipe_context *pipe, unsigned flags)
{
struct nouveau_pushbuf *push = nv50_context(pipe)->base.pushbuf;
}
static void
-nvc0_texture_barrier(struct pipe_context *pipe)
+nvc0_texture_barrier(struct pipe_context *pipe, unsigned flags)
{
struct nouveau_pushbuf *push = nvc0_context(pipe)->base.pushbuf;
}
}
-static void r300_texture_barrier(struct pipe_context *pipe)
+static void r300_texture_barrier(struct pipe_context *pipe, unsigned flags)
{
struct r300_context *r300 = r300_context(pipe);
radeon_set_context_reg(cs, R_028438_SX_ALPHA_REF, alpha_ref);
}
-static void r600_texture_barrier(struct pipe_context *ctx)
+static void r600_texture_barrier(struct pipe_context *ctx, unsigned flags)
{
struct r600_context *rctx = (struct r600_context *)ctx;
pipe_resource_reference(&cb.buffer, NULL);
}
-static void si_texture_barrier(struct pipe_context *ctx)
+static void si_texture_barrier(struct pipe_context *ctx, unsigned flags)
{
struct si_context *sctx = (struct si_context *)ctx;
return TRUE;
}
-void softpipe_texture_barrier(struct pipe_context *pipe)
+void softpipe_texture_barrier(struct pipe_context *pipe, unsigned flags)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
uint i, sh;
void softpipe_memory_barrier(struct pipe_context *pipe, unsigned flags)
{
- softpipe_texture_barrier(pipe);
+ softpipe_texture_barrier(pipe, 0);
}
boolean cpu_access,
boolean do_not_block);
-void softpipe_texture_barrier(struct pipe_context *pipe);
+void softpipe_texture_barrier(struct pipe_context *pipe, unsigned flags);
void softpipe_memory_barrier(struct pipe_context *pipe, unsigned flags);
#endif
static void
-trace_context_texture_barrier(struct pipe_context *_context)
+trace_context_texture_barrier(struct pipe_context *_context, unsigned flags)
{
struct trace_context *tr_context = trace_context(_context);
struct pipe_context *context = tr_context->pipe;
trace_dump_call_begin("pipe_context", "texture_barrier");
trace_dump_arg(ptr, context);
+ trace_dump_arg(uint, flags);
trace_dump_call_end();
- context->texture_barrier(context);
+ context->texture_barrier(context, flags);
}
/**
* Flush any pending framebuffer writes and invalidate texture caches.
*/
- void (*texture_barrier)(struct pipe_context *);
+ void (*texture_barrier)(struct pipe_context *, unsigned flags);
/**
* Flush caches according to flags.
#define PIPE_BARRIER_GLOBAL_BUFFER (1 << 11)
#define PIPE_BARRIER_ALL ((1 << 12) - 1)
+/**
+ * Flags for pipe_context::texture_barrier.
+ */
+#define PIPE_TEXTURE_BARRIER_SAMPLER (1 << 0)
+#define PIPE_TEXTURE_BARRIER_FRAMEBUFFER (1 << 1)
+
/**
* Resource binding flags -- state tracker must specify in advance all
* the ways a resource might be used.
{
struct pipe_context *pipe = st_context(ctx)->pipe;
- pipe->texture_barrier(pipe);
+ pipe->texture_barrier(pipe, PIPE_TEXTURE_BARRIER_SAMPLER);
}