panfrost: Only clear existing color buffers
in case that only one cbuf allocated but all clear bits set, the driver will crash due to null pointer dereference. Signed-off-by: luc <onion0709@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11515>
This commit is contained in:
@@ -1153,7 +1153,7 @@ panfrost_batch_clear(struct panfrost_batch *batch,
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
|
||||
if (buffers & PIPE_CLEAR_COLOR) {
|
||||
for (unsigned i = 0; i < PIPE_MAX_COLOR_BUFS; ++i) {
|
||||
for (unsigned i = 0; i < ctx->pipe_framebuffer.nr_cbufs; ++i) {
|
||||
if (!(buffers & (PIPE_CLEAR_COLOR0 << i)))
|
||||
continue;
|
||||
|
||||
|
Reference in New Issue
Block a user