}
/* if we get here, there's no error so set new state */
- _mesa_drawbuffers(ctx, fb, 1, &buffer, &destMask);
+ const GLenum16 buffer16 = buffer;
+ _mesa_drawbuffers(ctx, fb, 1, &buffer16, &destMask);
/* Call device driver function only if fb is the bound draw buffer */
if (fb == ctx->DrawBuffer) {
- if (ctx->Driver.DrawBuffers)
- ctx->Driver.DrawBuffers(ctx, 1, &buffer);
- else if (ctx->Driver.DrawBuffer)
- ctx->Driver.DrawBuffer(ctx, buffer);
+ if (ctx->Driver.DrawBuffer)
+ ctx->Driver.DrawBuffer(ctx);
+ if (ctx->Driver.DrawBufferAllocate)
+ ctx->Driver.DrawBufferAllocate(ctx);
}
}
}
/* OK, if we get here, there were no errors so set the new state */
- _mesa_drawbuffers(ctx, fb, n, buffers, destMask);
+ GLenum16 buffers16[MAX_DRAW_BUFFERS];
+ for (int i = 0; i < n; i++)
+ buffers16[i] = buffers[i];
+
+ _mesa_drawbuffers(ctx, fb, n, buffers16, destMask);
/*
* Call device driver function if fb is the bound draw buffer.
* may not be valid.
*/
if (fb == ctx->DrawBuffer) {
- if (ctx->Driver.DrawBuffers)
- ctx->Driver.DrawBuffers(ctx, n, buffers);
- else if (ctx->Driver.DrawBuffer)
- ctx->Driver.DrawBuffer(ctx, n > 0 ? buffers[0] : GL_NONE);
+ if (ctx->Driver.DrawBuffer)
+ ctx->Driver.DrawBuffer(ctx);
+ if (ctx->Driver.DrawBufferAllocate)
+ ctx->Driver.DrawBufferAllocate(ctx);
}
}
*/
void
_mesa_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint n, const GLenum *buffers, const GLbitfield *destMask)
+ GLuint n, const GLenum16 *buffers,
+ const GLbitfield *destMask)
{
GLbitfield mask[MAX_DRAW_BUFFERS];
GLuint buf;