mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
Revert content-version texture early-out (e8e1521): the SyncTexture cross-draw skip breaks Iris shader retrace validation (correctness regression)
This commit is contained in:
@@ -1065,18 +1065,6 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
|
||||
Bool VkTextureManager::SyncTexture(MG_State::GLState::ITextureObject &texture,
|
||||
TextureResource &outResource) {
|
||||
// Cross-draw fast path: if the resource is already built and neither the texture's
|
||||
// pixel content (bumped in MarkStorageDirty) nor its params changed since the last
|
||||
// sync, there is nothing to re-check or re-upload - skip CheckMipmapCompleteness,
|
||||
// SyncTextureResource, SyncTextureViews and the per-level dirty scan. Layout is
|
||||
// maintained separately by the transition path, so the resource still reflects truth.
|
||||
const Uint64 syncingContentVersion = texture.GetContentVersion();
|
||||
if (outResource.image != VK_NULL_HANDLE &&
|
||||
outResource.syncedContentVersion == syncingContentVersion &&
|
||||
outResource.syncedTextureParamsVersion == texture.GetTextureParamsVersion()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TextureUploadTarget uploadTarget = TextureUploadTarget::Unknown;
|
||||
IntVec3 texelSize{0, 0, 0};
|
||||
SizeT byteSize = 0;
|
||||
@@ -1123,7 +1111,6 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
DumpTextureSyncStats(texture.GetExternalIndex(), texture.GetFormat(), uploadTarget, mipLevelCount,
|
||||
texelSize, byteSize, hasDirtyMipLevel);
|
||||
if (!hasDirtyMipLevel) {
|
||||
outResource.syncedContentVersion = syncingContentVersion;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1131,7 +1118,6 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
MGLOG_D("%s: UploadDirtyMipLevels failed", __func__);
|
||||
return false;
|
||||
}
|
||||
outResource.syncedContentVersion = syncingContentVersion;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,9 +97,6 @@ public:
|
||||
VkImageViewType viewType = VK_IMAGE_VIEW_TYPE_2D;
|
||||
VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_1_BIT;
|
||||
Uint16 syncedTextureParamsVersion = 0;
|
||||
// Snapshot of ITextureObject::GetContentVersion() at the last successful sync;
|
||||
// lets SyncTexture skip the whole re-check/re-upload when content is unchanged.
|
||||
Uint64 syncedContentVersion = 0;
|
||||
|
||||
TextureResource() = default;
|
||||
TextureResource(const TextureResource&) = delete;
|
||||
@@ -123,7 +120,6 @@ public:
|
||||
std::swap(this->viewType, that.viewType);
|
||||
std::swap(this->sampleCount, that.sampleCount);
|
||||
std::swap(this->syncedTextureParamsVersion, that.syncedTextureParamsVersion);
|
||||
std::swap(this->syncedContentVersion, that.syncedContentVersion);
|
||||
}
|
||||
|
||||
void Reset() {
|
||||
@@ -170,7 +166,6 @@ public:
|
||||
viewType = VK_IMAGE_VIEW_TYPE_2D;
|
||||
sampleCount = VK_SAMPLE_COUNT_1_BIT;
|
||||
syncedTextureParamsVersion = 0;
|
||||
syncedContentVersion = 0;
|
||||
}
|
||||
|
||||
~TextureResource() {
|
||||
|
||||
Reference in New Issue
Block a user