]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/sequence.cpp
Decouple the Predicate enum from OpenGL constants
[libs/gl.git] / source / render / sequence.cpp
index 06b1403bd827e934400a550cd29f2bcef919e64b..9161c75146cc7552ac5363e21d69700a7ff5b564 100644 (file)
@@ -185,7 +185,8 @@ void Sequence::render(Renderer &renderer, Tag tag) const
                else
                        Blend::unbind();
 
-               renderer.set_lighting(i->get_lighting());
+               if (const Lighting *lighting = i->get_lighting())
+                       renderer.add_shader_data(lighting->get_shader_data());
                renderer.set_clipping(i->get_clipping());
 
                if(const Renderable *renderable = i->get_renderable())
@@ -241,6 +242,33 @@ void Sequence::create_targets(unsigned recreate)
 
        if(!target_ms && samples)
                target_ms = new RenderTarget(width, height, samples, fmt);
+
+#ifdef DEBUG
+       if(!debug_name.empty())
+               set_target_debug_names();
+#endif
+}
+
+void Sequence::set_debug_name(const string &name)
+{
+#ifdef DEBUG
+       debug_name = name;
+       if(!name.empty())
+               set_target_debug_names();
+#else
+       (void)name;
+#endif
+}
+
+void Sequence::set_target_debug_names()
+{
+#ifdef DEBUG
+       for(unsigned i=0; i<2; ++i)
+               if(target[i])
+                       target[i]->set_debug_name(format("%s [RT:%d]", debug_name, i));
+       if(target_ms)
+               target_ms->set_debug_name(debug_name+" [RT:ms]");
+#endif
 }