Procházet zdrojové kódy

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>
tags/17.0-branchpoint
Ilia Mirkin před 9 roky
rodič
revize
a1c8484271

+ 2
- 1
src/gallium/docs/source/context.rst Zobrazit soubor

@@ -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.




+ 2
- 2
src/gallium/drivers/ddebug/dd_context.c Zobrazit soubor

@@ -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

+ 1
- 1
src/gallium/drivers/ilo/ilo_draw.c Zobrazit soubor

@@ -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);


+ 1
- 1
src/gallium/drivers/nouveau/nv50/nv50_context.c Zobrazit soubor

@@ -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;


+ 1
- 1
src/gallium/drivers/nouveau/nvc0/nvc0_context.c Zobrazit soubor

@@ -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;


+ 1
- 1
src/gallium/drivers/r300/r300_state.c Zobrazit soubor

@@ -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);


+ 1
- 1
src/gallium/drivers/r600/r600_state_common.c Zobrazit soubor

@@ -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;


+ 1
- 1
src/gallium/drivers/radeonsi/si_state.c Zobrazit soubor

@@ -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;


+ 2
- 2
src/gallium/drivers/softpipe/sp_flush.c Zobrazit soubor

@@ -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);
}

+ 1
- 1
src/gallium/drivers/softpipe/sp_flush.h Zobrazit soubor

@@ -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

+ 3
- 2
src/gallium/drivers/trace/tr_context.c Zobrazit soubor

@@ -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);
}



+ 1
- 1
src/gallium/include/pipe/p_context.h Zobrazit soubor

@@ -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.

+ 6
- 0
src/gallium/include/pipe/p_defines.h Zobrazit soubor

@@ -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.

+ 1
- 1
src/mesa/state_tracker/st_cb_texturebarrier.c Zobrazit soubor

@@ -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);
}



Načítá se…
Zrušit
Uložit