From: Mikko Rasa Date: Fri, 12 Nov 2021 16:22:16 +0000 (+0200) Subject: Allow BGR format in FrameAttachment, but disallow swizzled formats X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=f0081c84106c3aead61e48f76d52bd92b61ed131 Allow BGR format in FrameAttachment, but disallow swizzled formats Vulkan likes to use BGR for swapchain images, at least on my machine --- diff --git a/source/core/frameformat.cpp b/source/core/frameformat.cpp index fefb3582..649693a4 100644 --- a/source/core/frameformat.cpp +++ b/source/core/frameformat.cpp @@ -78,7 +78,9 @@ FrameAttachment make_typed_attachment(FrameAttachment fa, PixelFormat pf) } else { - if(comp!=RED && comp!=RG && comp!=RGB && comp!=RGBA) + if(comp!=RED && comp!=RG && comp!=RGB && comp!=RGBA && comp!=BGR && comp!=BGRA) + throw invalid_argument("make_typed_attachment"); + if(get_required_swizzle(comp)) throw invalid_argument("make_typed_attachment"); }