]> git.tdb.fi Git - libs/gl.git/commitdiff
Tweak handling flags in PipelineState::set_framebuffer
authorMikko Rasa <tdb@tdb.fi>
Fri, 1 Oct 2021 15:26:07 +0000 (18:26 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 1 Oct 2021 16:36:23 +0000 (19:36 +0300)
Viewports work slightly differently on Vulkan, so set only the
framebuffer flag here and instead check both when applying the state.

source/core/pipelinestate.cpp

index 262dd26b596b95fb600aea40d5995d0fe08fd56e..78db195d4b28d891a484b3d42268577973e065be 100644 (file)
@@ -69,7 +69,7 @@ void PipelineState::set(T &target, T value, unsigned flag)
 
 void PipelineState::set_framebuffer(const Framebuffer *f)
 {
-       set(framebuffer, f, FRAMEBUFFER|VIEWPORT);
+       set(framebuffer, f, FRAMEBUFFER);
 }
 
 void PipelineState::set_viewport(const Rect *v)
@@ -172,7 +172,7 @@ void PipelineState::apply(unsigned mask) const
                }
        }
 
-       if(mask&VIEWPORT)
+       if(mask&(VIEWPORT|FRAMEBUFFER))
        {
                if(viewport)
                        glViewport(viewport->left, viewport->bottom, viewport->width, viewport->height);