Re: [Mesa-dev] [PATCH v2] etnaviv: Allow clearing constant buffer using buffer==NULL user_buffer==NULL

2017-11-01 Thread Wladimir J. van der Laan
On Wed, Nov 01, 2017 at 02:27:40PM +0100, Lucas Stach wrote:
> Am Montag, den 30.10.2017, 17:14 +0100 schrieb Wladimir J. van der Laan:
> > On Mon, Oct 30, 2017 at 02:21:07PM +0100, Lucas Stach wrote:
> > > I would prefer the shorter expression (!cb->buffer && !cb->user_buffer) 
> > > here, which seems more consistent with the rest of the codebase.
> > 
> > Well, I mimiced the style from other assertion in the function which 
> > compares
> > explicitly with NULL. But ok, I'll update it some time.
> 
> If you agree with my suggestion I can also just fix it up while
> applying, but I'll leave the decision how you want to handle this up to
> you.

Feel free to do so while applying - I don't mind how it's solved really, it's
just useful to not have this crash :)

Regards,
Wladimir
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] etnaviv: Allow clearing constant buffer using buffer==NULL user_buffer==NULL

2017-11-01 Thread Lucas Stach
Am Montag, den 30.10.2017, 17:14 +0100 schrieb Wladimir J. van der Laan:
> On Mon, Oct 30, 2017 at 02:21:07PM +0100, Lucas Stach wrote:
> > I would prefer the shorter expression (!cb->buffer && !cb->user_buffer) 
> > here, which seems more consistent with the rest of the codebase.
> 
> Well, I mimiced the style from other assertion in the function which compares
> explicitly with NULL. But ok, I'll update it some time.

If you agree with my suggestion I can also just fix it up while
applying, but I'll leave the decision how you want to handle this up to
you.

Regards,
Lucas
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] etnaviv: Allow clearing constant buffer using buffer==NULL user_buffer==NULL

2017-10-30 Thread Wladimir J. van der Laan
On Mon, Oct 30, 2017 at 02:21:07PM +0100, Lucas Stach wrote:
> I would prefer the shorter expression (!cb->buffer && !cb->user_buffer) 
> here, which seems more consistent with the rest of the codebase.

Well, I mimiced the style from other assertion in the function which compares
explicitly with NULL. But ok, I'll update it some time.

Wladimir
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] etnaviv: Allow clearing constant buffer using buffer==NULL user_buffer==NULL

2017-10-30 Thread Lucas Stach
Am Samstag, den 28.10.2017, 16:16 +0200 schrieb Wladimir J. van der Laan:
> Prevents an assertion when using GALLIUM_HUD with ioquake3,
> when cso_restore_constant_buffer_slot0 restores an empty
> constant buffer in slot 0.
> 
> > Signed-off-by: Wladimir J. van der Laan 
> ---
>  src/gallium/drivers/etnaviv/etnaviv_state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Oops - needed to pull the rest of the expression into unlikely(...) too
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c 
> b/src/gallium/drivers/etnaviv/etnaviv_state.c
> index 34bcb19..91f12f3 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_state.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c
> @@ -89,7 +89,7 @@ etna_set_constant_buffer(struct pipe_context *pctx,
>  
> /* Note that the state tracker can unbind constant buffers by
>  * passing NULL here. */
> -   if (unlikely(!cb))
> +   if (unlikely(!cb || (cb->buffer == NULL && cb->user_buffer == NULL)))

I would prefer the shorter expression (!cb->buffer && !cb->user_buffer) 
here, which seems more consistent with the rest of the codebase.

Regards,
Lucas

>    return;
>  
> /* there is no support for ARB_uniform_buffer_object */
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev