[MG_Backend] (Disaggregated): resolve cube face attachments from their wire upload target

This commit is contained in:
2026-09-20 12:27:32 -04:00
parent 5922e54b47
commit 1389e8e7f6
@@ -28,6 +28,13 @@
if (surface.Kind == MG_Pipe::kMGPipeSurfaceKindNone) return out;
const Bool renderbuffer = surface.Kind == MG_Pipe::kMGPipeSurfaceKindRenderbuffer;
Uint32 level = surface.Level, layer = surface.Layer, availableLayers = 1;
// FramebufferTexture2D names a cube face in UploadTarget; its Layer is
// still zero. Resolve that face before applying a texture view's window,
// just as the monolith attachment resolver does.
const auto uploadTarget = static_cast<TextureUploadTarget>(surface.UploadTarget);
if (!renderbuffer && !surface.Layered && uploadTarget >= TextureUploadTarget::CubeMapPositiveX &&
uploadTarget <= TextureUploadTarget::CubeMapNegativeZ)
layer = static_cast<Uint32>(uploadTarget) - static_cast<Uint32>(TextureUploadTarget::CubeMapPositiveX);
VkFormat viewFormat = VK_FORMAT_UNDEFINED;
out.storage = renderbuffer ? surface.Res : m_textureManager->ResolveWireTextureStorage(
surface.Res, level, layer, &viewFormat, &availableLayers);