]> git.sesse.net Git - movit/blobdiff - resource_pool.h
Explicitly bind fragment shader outputs in order.
[movit] / resource_pool.h
index 8881958d27b0b1c4d2a082bbb649dcecc2304347..5cc2e829e8f836635b04980978372973d3618639 100644 (file)
@@ -29,6 +29,7 @@
 #include <map>
 #include <string>
 #include <utility>
+#include <vector>
 
 namespace movit {
 
@@ -56,7 +57,14 @@ public:
        // compiled program from the cache if possible. Keeps ownership of the
        // program; you must call release_glsl_program() instead of deleting it
        // when you no longer want it.
-       GLuint compile_glsl_program(const std::string& vertex_shader, const std::string& fragment_shader);
+       //
+       // If <fragment_shader_outputs> contains more than one value, the given
+       // outputs will be bound to fragment shader output colors in the order
+       // they appear in the vector. Otherwise, output order is undefined and
+       // determined by the OpenGL driver.
+       GLuint compile_glsl_program(const std::string& vertex_shader,
+                                   const std::string& fragment_shader,
+                                   const std::vector<std::string>& frag_shader_outputs);
        void release_glsl_program(GLuint glsl_program_num);
 
        // Allocate a 2D texture of the given internal format and dimensions,