diff options
| author | JMC47 <JMC4789@gmail.com> | 2022-10-04 22:40:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-04 22:40:58 -0400 |
| commit | 4b6086b20a95183f453c5957104536f84a510077 (patch) | |
| tree | 3a75ac25c823b8ba7cf30920b11d00a276dd0703 /Source/Core/VideoCommon/FramebufferManager.h | |
| parent | 5479f0e776009d85c509fc6f9874aceeaed9b85b (diff) | |
| parent | 779fe13e62e6c0e9d591f2cb33d00a89191dd6a6 (diff) | |
Merge pull request #11098 from K0bin/refresh-efb-cache
VideoCommon: Update EFB peek cache on draw done and tokens
Diffstat (limited to 'Source/Core/VideoCommon/FramebufferManager.h')
| -rw-r--r-- | Source/Core/VideoCommon/FramebufferManager.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/FramebufferManager.h b/Source/Core/VideoCommon/FramebufferManager.h index 2d27fef09b..1e918ff937 100644 --- a/Source/Core/VideoCommon/FramebufferManager.h +++ b/Source/Core/VideoCommon/FramebufferManager.h @@ -99,7 +99,9 @@ public: float PeekEFBDepth(u32 x, u32 y); void SetEFBCacheTileSize(u32 size); void InvalidatePeekCache(bool forced = true); + void RefreshPeekCache(); void FlagPeekCacheAsOutOfDate(); + void EndOfFrame(); // Writes a value to the framebuffer. This will never block, and writes will be batched. void PokeEFBColor(u32 x, u32 y, u32 color); @@ -117,6 +119,12 @@ protected: }; static_assert(std::is_standard_layout<EFBPokeVertex>::value, "EFBPokeVertex is standard-layout"); + struct EFBCacheTile + { + bool present; + u8 frame_access_mask; + }; + // EFB cache - for CPU EFB access // Tiles are ordered left-to-right, then top-to-bottom struct EFBCacheData @@ -125,9 +133,10 @@ protected: std::unique_ptr<AbstractFramebuffer> framebuffer; std::unique_ptr<AbstractStagingTexture> readback_texture; std::unique_ptr<AbstractPipeline> copy_pipeline; - std::vector<bool> tiles; + std::vector<EFBCacheTile> tiles; bool out_of_date; bool valid; + bool needs_flush; }; bool CreateEFBFramebuffer(); @@ -151,7 +160,7 @@ protected: bool IsUsingTiledEFBCache() const; bool IsEFBCacheTilePresent(bool depth, u32 x, u32 y, u32* tile_index) const; MathUtil::Rectangle<int> GetEFBCacheTileRect(u32 tile_index) const; - void PopulateEFBCache(bool depth, u32 tile_index); + void PopulateEFBCache(bool depth, u32 tile_index, bool async = false); void CreatePokeVertices(std::vector<EFBPokeVertex>* destination_list, u32 x, u32 y, float z, u32 color); |
