From: Wladimir J. van der Laan Date: Sat, 28 Oct 2017 13:57:14 +0000 (+0200) Subject: etnaviv: Allow clearing constant buffer using buffer==NULL user_buffer==NULL X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ba4320d94f23da45525699c1a3a947f2c598c3e;p=mesa.git etnaviv: Allow clearing constant buffer using buffer==NULL user_buffer==NULL 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 Signed-off-by: Lucas Stach --- diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c index 34bcb190699..ba62c5f194a 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 && !cb->user_buffer))) return; /* there is no support for ARB_uniform_buffer_object */