From f0081c84106c3aead61e48f76d52bd92b61ed131 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 12 Nov 2021 18:22:16 +0200 Subject: [PATCH] Allow BGR format in FrameAttachment, but disallow swizzled formats Vulkan likes to use BGR for swapchain images, at least on my machine --- source/core/frameformat.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"); } -- 2.43.0