diff options
author | Dave Airlie <[email protected]> | 2017-11-10 11:50:37 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-11-17 13:15:38 +1000 |
commit | c8ce3c26893e91ae4e07b1c2d6cf4b89e8c297aa (patch) | |
tree | ec40dbd1151d324c4ff7d3dc785e875abf4eadd2 /src/mesa/state_tracker/st_atom_storagebuf.c | |
parent | 8f91aa35a54e127b68415376ef2b577ea8fc30f9 (diff) |
st/mesa: don't move ssbo after atomic buffers if we support hw atomics
There is no need to have these overlap if we support hw atomics.
Reviewed-by: Ilia Mirkin <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_atom_storagebuf.c')
-rw-r--r-- | src/mesa/state_tracker/st_atom_storagebuf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_storagebuf.c b/src/mesa/state_tracker/st_atom_storagebuf.c index a31a8fd4be9..2c55af374f8 100644 --- a/src/mesa/state_tracker/st_atom_storagebuf.c +++ b/src/mesa/state_tracker/st_atom_storagebuf.c @@ -47,12 +47,14 @@ st_bind_ssbos(struct st_context *st, struct gl_program *prog, unsigned i; struct pipe_shader_buffer buffers[MAX_SHADER_STORAGE_BUFFERS]; struct gl_program_constants *c; - + int buffer_base; if (!prog || !st->pipe->set_shader_buffers) return; c = &st->ctx->Const.Program[prog->info.stage]; + buffer_base = st->has_hw_atomics ? 0 : c->MaxAtomicBuffers; + for (i = 0; i < prog->info.num_ssbos; i++) { struct gl_buffer_binding *binding; struct st_buffer_object *st_obj; @@ -79,13 +81,13 @@ st_bind_ssbos(struct st_context *st, struct gl_program *prog, sb->buffer_size = 0; } } - st->pipe->set_shader_buffers(st->pipe, shader_type, c->MaxAtomicBuffers, + st->pipe->set_shader_buffers(st->pipe, shader_type, buffer_base, prog->info.num_ssbos, buffers); /* clear out any stale shader buffers */ if (prog->info.num_ssbos < c->MaxShaderStorageBlocks) st->pipe->set_shader_buffers( st->pipe, shader_type, - c->MaxAtomicBuffers + prog->info.num_ssbos, + buffer_base + prog->info.num_ssbos, c->MaxShaderStorageBlocks - prog->info.num_ssbos, NULL); } |