From 0363560934172853742390bf516ba2cbaa901968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 17 Aug 2022 17:00:10 -0700 Subject: [PATCH] Added depth MSAA texture validation. Issue #2862. --- src/bgfx.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index c3c609cff..5148e5eb6 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -4502,6 +4502,17 @@ namespace bgfx if (bimg::isDepth(bimg::TextureFormat::Enum(tr.m_format) ) ) { ++depth; + + BGFX_ERROR_CHECK(true + && 0 != (tr.m_flags & BGFX_TEXTURE_RT_MSAA_MASK) + && 0 != (tr.m_flags & BGFX_TEXTURE_RT_WRITE_ONLY) + , _err + , BGFX_ERROR_FRAME_BUFFER_VALIDATION + , "Frame buffer depth MSAA texture cannot be resolved. It must be created with `BGFX_TEXTURE_RT_WRITE_ONLY` flag." + , "Attachment %d, texture flags 0x%016" PRIx64 "." + , ii + , tr.m_flags + ); } else {