diff options
| author | Tilka <tilkax@gmail.com> | 2022-05-29 00:57:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-29 00:57:43 +0100 |
| commit | e17a4f49f5bb2fd3ca4322db82c100206e00cc15 (patch) | |
| tree | 3c71b494b3f9b9a5db726b80caf6f0f6944d34db /Source/Core/VideoCommon/TextureCacheBase.cpp | |
| parent | 3dbc18060bc6f15eeaa3c0e4de907f8a06efa2bf (diff) | |
| parent | c8e20c569b7deae97b411a6eea5c846f342bbf17 (diff) | |
Merge pull request #10668 from Dentomologist/convert_pointerwrap_mode_to_enum_class
Convert PointerWrap::Mode to enum class
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(); |
