]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/pipelinestate_backend.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / backends / opengl / pipelinestate_backend.cpp
index a2b8ab32717555bc329b85a515f2b58818738ff0..da5f495712408926bde3f9445349b383009c819c 100644 (file)
@@ -4,6 +4,7 @@
 #include <msp/gl/extensions/arb_shader_objects.h>
 #include <msp/gl/extensions/arb_uniform_buffer_object.h>
 #include <msp/gl/extensions/arb_vertex_array_object.h>
+#include <msp/gl/extensions/arb_tessellation_shader.h>
 #include <msp/gl/extensions/ext_framebuffer_object.h>
 #include <msp/gl/extensions/msp_primitive_restart.h>
 #include "blend.h"
@@ -180,6 +181,13 @@ void OpenGLPipelineState::apply() const
                }
        }
 
+       if(changes&PipelineState::PATCH_SIZE)
+               if(self.patch_size)
+               {
+                       static Require _req(ARB_tessellation_shader);
+                       glPatchParameteri(GL_PATCH_VERTICES, self.patch_size);
+               }
+
        if(changes&PipelineState::FACE_CULL)
        {
                glFrontFace(self.front_face==CLOCKWISE ? GL_CW : GL_CCW);
@@ -237,8 +245,18 @@ void OpenGLPipelineState::apply() const
                        glDisable(GL_BLEND);
                        glColorMask(true, true, true, true);
                }
+
+               if(blend.alpha_to_coverage && self.framebuffer && self.framebuffer->get_format().get_samples()>1)
+                       glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);
+               else
+                       glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
        }
 
+#ifdef DEBUG
+       if(changes&(PipelineState::SHPROG|PipelineState::RESOURCES))
+               self.check_bound_resources();
+#endif
+
        applied_to = &device;
        dev_state.last_pipeline = this;
        changes = 0;