gallium: allow choosing which colorbuffers to clear
Required for glClearBuffer, which only clears one colorbuffer attachment. Example: If the first colorbuffer is float and the second one is int: pipe->clear(pipe, PIPE_CLEAR_COLOR0, float_clear_color, ...); pipe->clear(pipe, PIPE_CLEAR_COLOR1, int_clear_color, ...); This doesn't need any driver changes yet, because all drivers just use: if (flags & PIPE_CLEAR_COLOR) .. The drivers which support GL 3.0 will have to implement it properly though.
This commit is contained in:
@@ -130,7 +130,7 @@ static boolean r300_cbzb_clear_allowed(struct r300_context *r300,
|
||||
(struct pipe_framebuffer_state*)r300->fb_state.state;
|
||||
|
||||
/* Only color clear allowed, and only one colorbuffer. */
|
||||
if (clear_buffers != PIPE_CLEAR_COLOR || fb->nr_cbufs != 1)
|
||||
if ((clear_buffers & ~PIPE_CLEAR_COLOR) != 0 || fb->nr_cbufs != 1)
|
||||
return FALSE;
|
||||
|
||||
return r300_surface(fb->cbufs[0])->cbzb_allowed;
|
||||
|
Reference in New Issue
Block a user