[Mesa-dev] [PATCH] nir/worklist: Don't change the start index when computing the tail index
Mark Janes
mark.a.janes at intel.com
Wed Mar 11 09:30:10 PDT 2015
Reviewed-by: Mark Janes <mark.a.janes at intel.com>
Jason Ekstrand <jason at jlekstrand.net> writes:
> ---
> src/glsl/nir/nir_worklist.c | 10 +++++-----
> src/glsl/nir/nir_worklist.h | 4 ++--
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/src/glsl/nir/nir_worklist.c b/src/glsl/nir/nir_worklist.c
> index a8baae9..3087a1d 100644
> --- a/src/glsl/nir/nir_worklist.c
> +++ b/src/glsl/nir/nir_worklist.c
> @@ -82,7 +82,7 @@ nir_block_worklist_push_head(nir_block_worklist *w, nir_block *block)
> }
>
> nir_block *
> -nir_block_worklist_peek_head(nir_block_worklist *w)
> +nir_block_worklist_peek_head(const nir_block_worklist *w)
> {
> assert(w->count > 0);
>
> @@ -114,18 +114,18 @@ nir_block_worklist_push_tail(nir_block_worklist *w, nir_block *block)
>
> w->count++;
>
> - unsigned tail = w->start = (w->start + w->count - 1) % w->size;
> + unsigned tail = (w->start + w->count - 1) % w->size;
>
> w->blocks[tail] = block;
> BITSET_SET(w->blocks_present, block->index);
> }
>
> nir_block *
> -nir_block_worklist_peek_tail(nir_block_worklist *w)
> +nir_block_worklist_peek_tail(const nir_block_worklist *w)
> {
> assert(w->count > 0);
>
> - unsigned tail = w->start = (w->start + w->count - 1) % w->size;
> + unsigned tail = (w->start + w->count - 1) % w->size;
>
> return w->blocks[tail];
> }
> @@ -135,7 +135,7 @@ nir_block_worklist_pop_tail(nir_block_worklist *w)
> {
> assert(w->count > 0);
>
> - unsigned tail = w->start = (w->start + w->count - 1) % w->size;
> + unsigned tail = (w->start + w->count - 1) % w->size;
>
> w->count--;
>
> diff --git a/src/glsl/nir/nir_worklist.h b/src/glsl/nir/nir_worklist.h
> index d5a8568..829bff2 100644
> --- a/src/glsl/nir/nir_worklist.h
> +++ b/src/glsl/nir/nir_worklist.h
> @@ -74,13 +74,13 @@ nir_block_worklist_is_empty(const nir_block_worklist *w)
>
> void nir_block_worklist_push_head(nir_block_worklist *w, nir_block *block);
>
> -nir_block *nir_block_worklist_peek_head(nir_block_worklist *w);
> +nir_block *nir_block_worklist_peek_head(const nir_block_worklist *w);
>
> nir_block *nir_block_worklist_pop_head(nir_block_worklist *w);
>
> void nir_block_worklist_push_tail(nir_block_worklist *w, nir_block *block);
>
> -nir_block *nir_block_worklist_peek_tail(nir_block_worklist *w);
> +nir_block *nir_block_worklist_peek_tail(const nir_block_worklist *w);
>
> nir_block *nir_block_worklist_pop_tail(nir_block_worklist *w);
>
> --
> 2.3.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list