On Thu, Apr 21, 2016 at 2:49 PM, Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl> wrote: > On Wed, Apr 20, 2016 at 5:47 PM, Marek Olšák <mar...@gmail.com> wrote: >> From: Marek Olšák <marek.ol...@amd.com> >> >> --- >> src/gallium/drivers/radeonsi/si_descriptors.c | 50 >> +++++++++++++-------------- >> src/gallium/drivers/radeonsi/si_pipe.h | 2 +- >> 2 files changed, 25 insertions(+), 27 deletions(-) >> >> diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c >> b/src/gallium/drivers/radeonsi/si_descriptors.c >> index 01cf79e..c802b1e 100644 >> --- a/src/gallium/drivers/radeonsi/si_descriptors.c >> +++ b/src/gallium/drivers/radeonsi/si_descriptors.c >> @@ -900,7 +900,7 @@ void si_set_ring_buffer(struct pipe_context *ctx, uint >> shader, uint slot, >> unsigned element_size, unsigned index_stride, >> uint64_t offset) >> { >> struct si_context *sctx = (struct si_context *)ctx; >> - struct si_buffer_resources *buffers = &sctx->rw_buffers[shader]; >> + struct si_buffer_resources *buffers = &sctx->rw_buffers; >> >> if (shader >= SI_NUM_SHADERS) >> return; > > I think it would be nice to remove this check and the shader argument > to this function. > >> @@ -994,7 +994,7 @@ static void si_set_streamout_targets(struct pipe_context >> *ctx, >> const unsigned *offsets) >> { >> struct si_context *sctx = (struct si_context *)ctx; >> - struct si_buffer_resources *buffers = >> &sctx->rw_buffers[PIPE_SHADER_VERTEX]; >> + struct si_buffer_resources *buffers = &sctx->rw_buffers; >> unsigned old_num_targets = sctx->b.streamout.num_targets; >> unsigned i, bufidx; >> >> @@ -1198,7 +1198,7 @@ static void si_invalidate_buffer(struct pipe_context >> *ctx, struct pipe_resource >> >> /* Read/Write buffers. */ >> for (shader = 0; shader < SI_NUM_SHADERS; shader++) { >> - struct si_buffer_resources *buffers = >> &sctx->rw_buffers[shader]; >> + struct si_buffer_resources *buffers = &sctx->rw_buffers; >> uint64_t mask = buffers->desc.enabled_mask; > > Looping over the shaders here seems not necessary. Also the check in > the loop is wrong when we add the PS entries to the rw_buffers set, as > all of the entries get first processed at the VS.
Thanks. I'll do that in a follow-up patch. Marek _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev