bool
brw_blorp_clear_color(struct brw_context *brw, struct gl_framebuffer *fb,
- bool partial_clear);
+ GLbitfield mask, bool partial_clear);
void
brw_blorp_resolve_color(struct brw_context *brw,
extern "C" {
bool
brw_blorp_clear_color(struct brw_context *brw, struct gl_framebuffer *fb,
- bool partial_clear)
+ GLbitfield mask, bool partial_clear)
{
for (unsigned buf = 0; buf < fb->_NumColorDrawBuffers; buf++) {
struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buf];
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+ /* Only clear the buffers present in the provided mask */
+ if (((1 << fb->_ColorDrawBufferIndexes[buf]) & mask) == 0)
+ continue;
+
/* If this is an ES2 context or GL_ARB_ES2_compatibility is supported,
* the framebuffer can be complete with some attachments missing. In
* this case the _ColorDrawBuffers pointer will be NULL.
/* BLORP is currently only supported on Gen6+. */
if (brw->gen >= 6 && brw->gen < 8) {
if (mask & BUFFER_BITS_COLOR) {
- if (brw_blorp_clear_color(brw, fb, partial_clear)) {
+ if (brw_blorp_clear_color(brw, fb, mask, partial_clear)) {
debug_mask("blorp color", mask & BUFFER_BITS_COLOR);
mask &= ~BUFFER_BITS_COLOR;
}