mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
gallium/util: easy fixes for NULL colorbuffers
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
9baa45f78b
commit
9677cfab32
2 changed files with 7 additions and 1 deletions
|
|
@ -47,7 +47,10 @@ util_clear(struct pipe_context *pipe,
|
|||
for (i = 0; i < framebuffer->nr_cbufs; i++) {
|
||||
if (buffers & (PIPE_CLEAR_COLOR0 << i)) {
|
||||
struct pipe_surface *ps = framebuffer->cbufs[i];
|
||||
pipe->clear_render_target(pipe, ps, color, 0, 0, ps->width, ps->height);
|
||||
|
||||
if (ps) {
|
||||
pipe->clear_render_target(pipe, ps, color, 0, 0, ps->width, ps->height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,6 +127,9 @@ util_framebuffer_min_size(const struct pipe_framebuffer_state *fb,
|
|||
unsigned i;
|
||||
|
||||
for (i = 0; i < fb->nr_cbufs; i++) {
|
||||
if (!fb->cbufs[i])
|
||||
continue;
|
||||
|
||||
w = MIN2(w, fb->cbufs[i]->width);
|
||||
h = MIN2(h, fb->cbufs[i]->height);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue