]> git.tdb.fi Git - libs/gl.git/commitdiff
Allow BGR format in FrameAttachment, but disallow swizzled formats
authorMikko Rasa <tdb@tdb.fi>
Fri, 12 Nov 2021 16:22:16 +0000 (18:22 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 12 Nov 2021 16:34:00 +0000 (18:34 +0200)
Vulkan likes to use BGR for swapchain images, at least on my machine

source/core/frameformat.cpp

index fefb3582665380b4333098e0fc3cf34b54714c75..649693a43715a94b02974501148b21e4bc576592 100644 (file)
@@ -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");
        }