X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fbuilders%2Fsequencebuilder.cpp;h=12e7bdf3df96ea43c415e3674c5ffdf19d7cf764;hb=2b2676392aff2eb6b38c3e463cc67f4d67a4ef8b;hp=0f2a1b5499d17e3882299e84e53ff85b020ef500;hpb=dff7004fa078d55911664c0f513b5dc6c9449420;p=libs%2Fgl.git diff --git a/source/builders/sequencebuilder.cpp b/source/builders/sequencebuilder.cpp index 0f2a1b54..12e7bdf3 100644 --- a/source/builders/sequencebuilder.cpp +++ b/source/builders/sequencebuilder.cpp @@ -1,5 +1,7 @@ #include #include +#include +#include "deviceinfo.h" #include "error.h" #include "renderbuffer.h" #include "sequence.h" @@ -16,7 +18,7 @@ SequenceBuilder::SequenceBuilder(const SequenceTemplate &t): { const vector &steps = tmpl.get_steps(); for(vector::const_iterator i=steps.begin(); i!=steps.end(); ++i) - renderables[i->renderable_name] = 0; + renderables[i->slot_name] = i->default_renderable; const vector &postprocs = tmpl.get_postprocessors(); for(SequenceTemplate::PostProcessorArray::const_iterator i=postprocs.begin(); i!=postprocs.end(); ++i) if(!i->slot_name.empty()) @@ -33,11 +35,25 @@ void SequenceBuilder::set_postprocessor(const string &name, PostProcessor &pproc get_item(postprocessors, name) = &pproc; } +void SequenceBuilder::set_debug_name(const string &name) +{ +#ifdef DEBUG + debug_name = name; +#else + (void)name; +#endif +} + void SequenceBuilder::build(Sequence &sequence) const { +#ifdef DEBUG + if(!debug_name.empty()) + sequence.set_debug_name(debug_name); +#endif + sequence.set_hdr(tmpl.get_hdr()); sequence.set_alpha(tmpl.get_alpha()); - unsigned samples = min(tmpl.get_maximum_multisample(), Renderbuffer::get_max_samples()); + unsigned samples = min(tmpl.get_maximum_multisample(), Limits::get_global().max_samples); if(samples &steps = tmpl.get_steps(); for(vector::const_iterator i=steps.begin(); i!=steps.end(); ++i) { - Renderable *renderable = get_item(renderables, i->renderable_name); + Renderable *renderable = get_item(renderables, i->slot_name); if(!renderable) continue; Sequence::Step &step = sequence.add_step(i->tag, *renderable); - step.set_blend(i->blend.get()); - step.set_depth_test(i->depth_test.get()); - step.set_lighting(i->lighting.get()); + step.set_blend(i->blend); + step.set_depth_test(i->depth_test); + step.set_stencil_test(i->stencil_test); + step.set_lighting(i->lighting); } const SequenceTemplate::PostProcessorArray &postprocs = tmpl.get_postprocessors(); @@ -66,9 +83,15 @@ void SequenceBuilder::build(Sequence &sequence) const sequence.add_postprocessor(*proc); else if(i->postprocessor_template) { - proc = i->postprocessor_template->create(tmpl.get_resources(), sequence.get_width(), sequence.get_height()); + proc = i->postprocessor_template->create(sequence.get_width(), sequence.get_height()); if(proc) + { +#ifdef DEBUG + if(!debug_name.empty()) + proc->set_debug_name(format("%s/%d.pproc", debug_name, i-postprocs.begin())); +#endif sequence.add_postprocessor_owned(proc); + } } } }