[Feat] (MG_Backend/DirectVulkan): GenerateMipmap WIP

This commit is contained in:
2026-05-07 15:14:25 +08:00
parent 7337b00ca8
commit 76e3950028
6 changed files with 477 additions and 5 deletions
@@ -69,6 +69,14 @@ namespace MobileGL::MG_Backend::DirectVulkan {
if (att.IsTexture()) {
const Int textureLevel = att.GetTextureLevel();
XXHASH_VERIFY(XXH64_update(m_hashState, &textureLevel, sizeof(textureLevel)));
Uint64 imageIdentity = 0;
auto* texture = att.GetTexture().get();
auto* resource = m_textureManager.SyncTextureAndGetDescriptor(*texture);
if (resource != nullptr) {
imageIdentity = reinterpret_cast<Uint64>(resource->image);
}
XXHASH_VERIFY(XXH64_update(m_hashState, &imageIdentity, sizeof(imageIdentity)));
}
if (includePendingClear && att.IsTexture()) {
@@ -94,9 +102,9 @@ namespace MobileGL::MG_Backend::DirectVulkan {
currentLayout = m_swapchainObject.GetDepthStencilImageLayout(swapchainImageIndex);
}
} else {
auto* resource = m_textureManager.SyncTextureAndGetDescriptor(*texture);
if (resource != nullptr) {
currentLayout = resource->layout;
auto* textureResource = m_textureManager.SyncTextureAndGetDescriptor(*texture);
if (textureResource != nullptr) {
currentLayout = textureResource->layout;
}
}
XXHASH_VERIFY(XXH64_update(m_hashState, &currentLayout, sizeof(currentLayout)));