diff options
| author | Dentomologist <dentomologist@gmail.com> | 2022-05-17 22:29:05 -0700 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2022-05-25 13:06:41 -0700 |
| commit | f6b9acccfc66794cfc718355e777aa34914e881c (patch) | |
| tree | 8c916273a264850351e47d19b19db5be46816803 /Source/Core/VideoCommon/TextureCacheBase.cpp | |
| parent | 7fcc866c4118487c010116a2ea164abc867e65f4 (diff) | |
Common: Refactor PointerWrap
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 406a7bef21..dc08fd90bc 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -432,7 +432,7 @@ void TextureCacheBase::SerializeTexture(AbstractTexture* tex, const TextureConfi PointerWrap& p) { // If we're in measure mode, skip the actual readback to save some time. - const bool skip_readback = p.GetMode() == PointerWrap::MODE_MEASURE; + const bool skip_readback = p.IsMeasureMode(); p.DoPOD(config); if (skip_readback || CheckReadbackTexture(config.width, config.height, config.format)) @@ -459,7 +459,7 @@ void TextureCacheBase::SerializeTexture(AbstractTexture* tex, const TextureConfi // needing to allocate/free an extra buffer. u8* texture_data = p.DoExternal(total_size); - if (!skip_readback && p.GetMode() == PointerWrap::MODE_MEASURE) + if (!skip_readback && p.IsMeasureMode()) { ERROR_LOG_FMT(VIDEO, "Couldn't acquire {} bytes for serializing texture.", total_size); return; @@ -502,7 +502,7 @@ std::optional<TextureCacheBase::TexPoolEntry> TextureCacheBase::DeserializeTextu u32 total_size = 0; u8* texture_data = p.DoExternal(total_size); - if (p.GetMode() != PointerWrap::MODE_READ || total_size == 0) + if (!p.IsReadMode() || total_size == 0) return std::nullopt; auto tex = AllocateTexture(config); @@ -542,7 +542,7 @@ void TextureCacheBase::DoState(PointerWrap& p) p.Do(last_entry_id); - if (p.GetMode() == PointerWrap::MODE_WRITE || p.GetMode() == PointerWrap::MODE_MEASURE) + if (p.IsWriteMode() || p.IsMeasureMode()) DoSaveState(p); else DoLoadState(p); @@ -673,7 +673,7 @@ void TextureCacheBase::DoLoadState(PointerWrap& p) // Only clear out state when actually restoring/loading. // Since we throw away entries when not in loading mode now, we don't need to check // before inserting entries into the cache, as GetEntry will always return null. - const bool commit_state = p.GetMode() == PointerWrap::MODE_READ; + const bool commit_state = p.IsReadMode(); if (commit_state) Invalidate(); |
