]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/commands.cpp
Store default-block uniform data in a memory block
[libs/gl.git] / source / core / commands.cpp
index 2eb4659ad8e6ae0f62ecb2ec2e9aed362dc6afc3..19ff10115e53e10faf612220c2daf3f4697f841e 100644 (file)
@@ -19,9 +19,11 @@ Commands::Commands():
        pipeline_state(0)
 { }
 
-void Commands::use_pipeline(const PipelineState &ps)
+void Commands::use_pipeline(const PipelineState *ps)
 {
-       pipeline_state = &ps;
+       pipeline_state = ps;
+       if(!pipeline_state)
+               PipelineState::clear();
 }
 
 void Commands::clear(const ClearValue *values)
@@ -80,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);
 
@@ -88,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);