]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/pipelinestate_backend.cpp
Add tessellation shader support to the engine
[libs/gl.git] / source / backends / opengl / pipelinestate_backend.cpp
index 8ffa47fcda75d8ea44e9ff9e74673ca54f43a21a..204e8139f0fc70802aaf3592b68a60779a124bae 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);