diff options
author | Marek Olšák <[email protected]> | 2019-02-27 21:54:47 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-04-04 19:28:52 -0400 |
commit | 66a82ec6f0fa3586fecee001da6bae1fc33f12d1 (patch) | |
tree | 91352a6aae525110ad061b510bc1b9b21670a3b8 /src/gallium/auxiliary | |
parent | b19494c54e704ce23f5d0523c321fbffc0f70494 (diff) |
gallium: add writable_bitmask parameter into set_shader_buffers
to indicate write usage per buffer.
This is just a hint (it will be used by radeonsi).
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/driver_ddebug/dd_context.c | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/driver_trace/tr_context.c | 7 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_threaded_context.c | 10 |
3 files changed, 16 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/driver_ddebug/dd_context.c b/src/gallium/auxiliary/driver_ddebug/dd_context.c index 53dd8b2517d..96d9a650d86 100644 --- a/src/gallium/auxiliary/driver_ddebug/dd_context.c +++ b/src/gallium/auxiliary/driver_ddebug/dd_context.c @@ -536,14 +536,16 @@ dd_context_set_shader_images(struct pipe_context *_pipe, static void dd_context_set_shader_buffers(struct pipe_context *_pipe, unsigned shader, unsigned start, unsigned num_buffers, - const struct pipe_shader_buffer *buffers) + const struct pipe_shader_buffer *buffers, + unsigned writable_bitmask) { struct dd_context *dctx = dd_context(_pipe); struct pipe_context *pipe = dctx->pipe; safe_memcpy(&dctx->draw_state.shader_buffers[shader][start], buffers, sizeof(buffers[0]) * num_buffers); - pipe->set_shader_buffers(pipe, shader, start, num_buffers, buffers); + pipe->set_shader_buffers(pipe, shader, start, num_buffers, buffers, + writable_bitmask); } static void diff --git a/src/gallium/auxiliary/driver_trace/tr_context.c b/src/gallium/auxiliary/driver_trace/tr_context.c index 7859a3395ca..479a987dfa6 100644 --- a/src/gallium/auxiliary/driver_trace/tr_context.c +++ b/src/gallium/auxiliary/driver_trace/tr_context.c @@ -1692,7 +1692,8 @@ trace_context_set_tess_state(struct pipe_context *_context, static void trace_context_set_shader_buffers(struct pipe_context *_context, enum pipe_shader_type shader, unsigned start, unsigned nr, - const struct pipe_shader_buffer *buffers) + const struct pipe_shader_buffer *buffers, + unsigned writable_bitmask) { struct trace_context *tr_context = trace_context(_context); struct pipe_context *context = tr_context->pipe; @@ -1703,10 +1704,12 @@ static void trace_context_set_shader_buffers(struct pipe_context *_context, trace_dump_arg(uint, start); trace_dump_arg_begin("buffers"); trace_dump_struct_array(shader_buffer, buffers, nr); + trace_dump_arg(uint, writable_bitmask); trace_dump_arg_end(); trace_dump_call_end(); - context->set_shader_buffers(context, shader, start, nr, buffers); + context->set_shader_buffers(context, shader, start, nr, buffers, + writable_bitmask); } static void trace_context_set_shader_images(struct pipe_context *_context, diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index bd2c8f57a10..fc448908564 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -890,6 +890,7 @@ tc_set_shader_images(struct pipe_context *_pipe, struct tc_shader_buffers { ubyte shader, start, count; bool unbind; + unsigned writable_bitmask; struct pipe_shader_buffer slot[0]; /* more will be allocated if needed */ }; @@ -900,11 +901,12 @@ tc_call_set_shader_buffers(struct pipe_context *pipe, union tc_payload *payload) unsigned count = p->count; if (p->unbind) { - pipe->set_shader_buffers(pipe, p->shader, p->start, p->count, NULL); + pipe->set_shader_buffers(pipe, p->shader, p->start, p->count, NULL, 0); return; } - pipe->set_shader_buffers(pipe, p->shader, p->start, p->count, p->slot); + pipe->set_shader_buffers(pipe, p->shader, p->start, p->count, p->slot, + p->writable_bitmask); for (unsigned i = 0; i < count; i++) pipe_resource_reference(&p->slot[i].buffer, NULL); @@ -914,7 +916,8 @@ static void tc_set_shader_buffers(struct pipe_context *_pipe, enum pipe_shader_type shader, unsigned start, unsigned count, - const struct pipe_shader_buffer *buffers) + const struct pipe_shader_buffer *buffers, + unsigned writable_bitmask) { if (!count) return; @@ -928,6 +931,7 @@ tc_set_shader_buffers(struct pipe_context *_pipe, p->start = start; p->count = count; p->unbind = buffers == NULL; + p->writable_bitmask = writable_bitmask; if (buffers) { for (unsigned i = 0; i < count; i++) { |