Fix interaction between mipmaps/msaa resolution;
@@ -1397,16 +1397,16 @@ void lovrCanvasBind(Canvas* canvas) {
}
void lovrCanvasResolve(Canvas* canvas) {
- if (!canvas->needsResolve || !canvas->flags.msaa) {
+ if (!canvas->needsResolve) {
return;
}
+ if (canvas->flags.msaa) {
int w = canvas->width;
int h = canvas->height;
glBindFramebuffer(GL_READ_FRAMEBUFFER, canvas->framebuffer);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, canvas->resolveBuffer);
state.framebuffer = canvas->resolveBuffer;
- canvas->needsResolve = false;
if (canvas->count == 1) {
glBlitFramebuffer(0, 0, w, h, 0, 0, w, h, GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -1421,6 +1421,7 @@ void lovrCanvasResolve(Canvas* canvas) {
glReadBuffer(0);
glDrawBuffers(canvas->count, buffers);
}
+ }
if (canvas->flags.mipmaps) {
for (int i = 0; i < canvas->count; i++) {
@@ -1431,6 +1432,8 @@ void lovrCanvasResolve(Canvas* canvas) {
}
}
}
+
+ canvas->needsResolve = false;
}
void lovrCanvasBlit(Canvas* canvas) {
