From: Mikko Rasa Date: Sat, 13 Nov 2021 14:59:22 +0000 (+0200) Subject: Build sequence without target format if there's no postprocessors X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=52122a54426fe3b821680e346b53c961d548c40e;p=libs%2Fgl.git Build sequence without target format if there's no postprocessors --- diff --git a/source/builders/sequencebuilder.cpp b/source/builders/sequencebuilder.cpp index c80e2f09..01208cf4 100644 --- a/source/builders/sequencebuilder.cpp +++ b/source/builders/sequencebuilder.cpp @@ -146,27 +146,30 @@ Sequence *SequenceBuilder::build() const Sequence *SequenceBuilder::build(unsigned w, unsigned h) const { - RefPtr sequence = new Sequence(w, h, create_frame_format()); + RefPtr sequence = create_sequence(w, h); build(*sequence); return sequence.release(); } Sequence *SequenceBuilder::build(const View &view) const { - RefPtr sequence = new Sequence(view.get_width(), view.get_height(), create_frame_format()); + RefPtr sequence = create_sequence(view.get_width(), view.get_height()); build(*sequence); return sequence.release(); } Sequence *SequenceBuilder::build(const Framebuffer &fbo) const { - RefPtr sequence = new Sequence(fbo.get_width(), fbo.get_height(), create_frame_format()); + RefPtr sequence = create_sequence(fbo.get_width(), fbo.get_height()); build(*sequence); return sequence.release(); } -FrameFormat SequenceBuilder::create_frame_format() const +Sequence * SequenceBuilder::create_sequence(unsigned w, unsigned h) const { + if(!w || !h || tmpl.get_postprocessors().empty()) + return new Sequence; + unsigned samples = min(tmpl.get_maximum_multisample(), Device::get_current().get_info().limits.max_samples); if(samples