mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
gallium: add flags parameter to texture barrier
This is so that we can differentiate between flushing any framebuffer reading caches from regular sampler caches. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
ee3ebe68f9
commit
a1c8484271
14 changed files with 24 additions and 16 deletions
|
|
@ -578,7 +578,8 @@ texture_barrier
|
|||
%%%%%%%%%%%%%%%
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -676,11 +676,11 @@ dd_context_texture_subdata(struct pipe_context *_pipe,
|
|||
*/
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -603,7 +603,7 @@ ilo_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
|||
}
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ nv50_flush(struct pipe_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;
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ nvc0_flush(struct pipe_context *pipe,
|
|||
}
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -2068,7 +2068,7 @@ static void r300_set_constant_buffer(struct pipe_context *pipe,
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ void r600_emit_alphatest_state(struct r600_context *rctx, struct r600_atom *atom
|
|||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -3498,7 +3498,7 @@ static void si_set_tess_state(struct pipe_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;
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ softpipe_flush_resource(struct pipe_context *pipe,
|
|||
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;
|
||||
|
|
@ -192,5 +192,5 @@ void softpipe_texture_barrier(struct pipe_context *pipe)
|
|||
|
||||
void softpipe_memory_barrier(struct pipe_context *pipe, unsigned flags)
|
||||
{
|
||||
softpipe_texture_barrier(pipe);
|
||||
softpipe_texture_barrier(pipe, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,6 @@ softpipe_flush_resource(struct pipe_context *pipe,
|
|||
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
|
||||
|
|
|
|||
|
|
@ -1681,7 +1681,7 @@ trace_context_render_condition(struct pipe_context *_context,
|
|||
|
||||
|
||||
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;
|
||||
|
|
@ -1689,10 +1689,11 @@ trace_context_texture_barrier(struct pipe_context *_context)
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ struct pipe_context {
|
|||
/**
|
||||
* 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.
|
||||
|
|
|
|||
|
|
@ -399,6 +399,12 @@ enum pipe_flush_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.
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ st_TextureBarrier(struct gl_context *ctx)
|
|||
{
|
||||
struct pipe_context *pipe = st_context(ctx)->pipe;
|
||||
|
||||
pipe->texture_barrier(pipe);
|
||||
pipe->texture_barrier(pipe, PIPE_TEXTURE_BARRIER_SAMPLER);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue