st/clear: handle null color renderbuffer

Fixes: 2eb45daa9c ("gallium: de-pointerize pipe_surface")

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35973>
This commit is contained in:
Mike Blumenkrantz
2025-07-07 10:04:11 -04:00
committed by Marge Bot
parent 0dd73981b2
commit df0c25610e
+1 -1
View File
@@ -406,12 +406,12 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
if (b != BUFFER_NONE && mask & (1 << b)) {
struct gl_renderbuffer *rb
= ctx->DrawBuffer->Attachment[b].Renderbuffer;
enum pipe_format format = _mesa_renderbuffer_get_format(ctx, rb);
int colormask_index = ctx->Extensions.EXT_draw_buffers2 ? i : 0;
if (!rb || !rb->texture)
continue;
enum pipe_format format = _mesa_renderbuffer_get_format(ctx, rb);
unsigned colormask =
GET_COLORMASK(ctx->Color.ColorMask, colormask_index);