freedreno: Handle non-null cb with null buffer

u_blitter does this to restore constant state, so we need to handle both
cases.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30064>
This commit is contained in:
Rob Clark
2024-07-14 08:42:26 -07:00
committed by Marge Bot
parent 9123ee0f18
commit 9372875222

View File

@@ -152,9 +152,9 @@ fd_set_constant_buffer(struct pipe_context *pctx, enum pipe_shader_type shader,
util_copy_constant_buffer(&so->cb[index], cb, take_ownership);
/* Note that gallium frontends can unbind constant buffers by
* passing NULL here.
* passing a NULL cb, or a cb with no buffer:
*/
if (unlikely(!cb)) {
if (!cb || !(cb->user_buffer || cb->buffer)) {
so->enabled_mask &= ~(1 << index);
return;
}