]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/commands.cpp
Automatically detect which multisample buffers to resolve
[libs/gl.git] / source / core / commands.cpp
index f2c273727c7d2b5fcd7037b77f8df51c1b1f7a1e..19ff10115e53e10faf612220c2daf3f4697f841e 100644 (file)
@@ -82,7 +82,7 @@ void Commands::draw_instanced(const Batch &batch, unsigned count)
        glDrawElementsInstanced(batch.get_gl_primitive_type(), batch.size(), batch.get_gl_index_type(), data_ptr, count);
 }
 
-void Commands::resolve_multisample(Framebuffer &target, BufferBits buffers)
+void Commands::resolve_multisample(Framebuffer &target)
 {
        static Require _req(EXT_framebuffer_blit);
 
@@ -90,6 +90,7 @@ void Commands::resolve_multisample(Framebuffer &target, BufferBits buffers)
 
        unsigned width = min(source->get_width(), target.get_width());
        unsigned height = min(source->get_height(), target.get_height());
+       unsigned buffers = get_gl_buffer_bits(source->get_format())&get_gl_buffer_bits(target.get_format());
 
        if(ARB_direct_state_access)
                glBlitNamedFramebuffer(source->id, target.id, 0, 0, width, height, 0, 0, width, height, buffers, GL_NEAREST);