[Fix] (MG_State/GLState, MG_Backend): track layered framebuffer textures

This commit is contained in:
2026-07-03 10:38:51 +08:00
parent 6418561d3c
commit 940ab5fd8e
10 changed files with 155 additions and 39 deletions
@@ -923,11 +923,26 @@ namespace MobileGL::MG_Backend::DirectVulkan {
return false;
}
static Bool HasLayeredTextureAttachment(const MG_State::GLState::FramebufferObject& framebufferObject) {
if (framebufferObject.GetExternalIndex() == 0) {
return false;
}
for (const auto& attachment : framebufferObject.GetAllAttachmentObjects()) {
if (attachment.IsTexture() && attachment.IsLayered()) {
return true;
}
}
return false;
}
static Bool IsUnsupportedFramebufferForDirectVulkan(
const MG_State::GLState::FramebufferObject& framebufferObject) {
// TODO: Revisit this gate when DirectVulkan has full color renderbuffer render/blit/readback support.
// TODO: Implement DirectVulkan layered framebuffer rendering instead of rejecting layered draw targets.
return HasDistinctCompleteDepthStencilTextureAttachments(framebufferObject) ||
HasUnsupportedCompleteRenderbufferAttachment(framebufferObject);
HasUnsupportedCompleteRenderbufferAttachment(framebufferObject) ||
HasLayeredTextureAttachment(framebufferObject);
}
static void RecordUnsupportedFramebufferError(const char* func) {