]> git.tdb.fi Git - libs/gl.git/commitdiff
Add interface for glBindFragDataLocation, required for modern shaders
authorMikko Rasa <tdb@tdb.fi>
Sun, 15 Dec 2013 23:05:29 +0000 (01:05 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 16 Dec 2013 18:28:46 +0000 (20:28 +0200)
extensions/ext_gpu_shader4.glext [new file with mode: 0644]
source/program.cpp
source/program.h

diff --git a/extensions/ext_gpu_shader4.glext b/extensions/ext_gpu_shader4.glext
new file mode 100644 (file)
index 0000000..54d1360
--- /dev/null
@@ -0,0 +1 @@
+extension EXT_gpu_shader4
index c8ce67a8897fc6fd5499b251e4a7713b71ff496e..9c95ee1730d522665fd78e63ed1124a8ab618556 100644 (file)
@@ -5,6 +5,7 @@
 #include <msp/gl/extensions/arb_shader_objects.h>
 #include <msp/gl/extensions/arb_uniform_buffer_object.h>
 #include <msp/gl/extensions/arb_vertex_shader.h>
+#include <msp/gl/extensions/ext_gpu_shader4.h>
 #include <msp/strings/format.h>
 #include "buffer.h"
 #include "error.h"
@@ -88,6 +89,12 @@ void Program::bind_attribute(unsigned index, const string &name)
        glBindAttribLocation(id, index, name.c_str());
 }
 
+void Program::bind_fragment_data(unsigned index, const string &name)
+{
+       static Require _req(EXT_gpu_shader4);
+       glBindFragDataLocation(id, index, name.c_str());
+}
+
 void Program::link()
 {
        for(ShaderList::iterator i=shaders.begin(); i!=shaders.end(); ++i)
index a7622ecbb586d42d83d9d2380bcdd5d3978d3e24..642bcf5e7755652734069e33d9df182a0e2fad96 100644 (file)
@@ -81,6 +81,7 @@ public:
        const ShaderList &get_shaders() const { return shaders; }
 
        void bind_attribute(unsigned, const std::string &);
+       void bind_fragment_data(unsigned, const std::string &);
 
        void link();
 private: