summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-12-10 09:34:37 -0400
committerGravatar FernandoS272019-12-22 12:24:34 -0400
commita3916588b6964c6764a4f601c86b09a7d5eb2d4f (patch)
tree113b3d188241b486c4931216fe77d89fa3a29968 /src
parentTexture Cache: Add HLE methods for building 3D textures within the GPU in cer... (diff)
downloadyuzu-a3916588b6964c6764a4f601c86b09a7d5eb2d4f.tar.gz
yuzu-a3916588b6964c6764a4f601c86b09a7d5eb2d4f.tar.xz
yuzu-a3916588b6964c6764a4f601c86b09a7d5eb2d4f.zip
Texture Cache: Address Feedback
Diffstat (limited to 'src')
-rw-r--r--src/video_core/texture_cache/surface_params.h6
-rw-r--r--src/video_core/texture_cache/texture_cache.h16
2 files changed, 11 insertions, 11 deletions
diff --git a/src/video_core/texture_cache/surface_params.h b/src/video_core/texture_cache/surface_params.h
index 1c6be25da..84c8b2940 100644
--- a/src/video_core/texture_cache/surface_params.h
+++ b/src/video_core/texture_cache/surface_params.h
@@ -138,13 +138,13 @@ public:
138 138
139 std::size_t GetConvertedMipmapSize(u32 level) const; 139 std::size_t GetConvertedMipmapSize(u32 level) const;
140 140
141 // Get this texture Tegra Block size in guest memory layout 141 /// Get this texture Tegra Block size in guest memory layout
142 u32 GetBlockSize() const; 142 u32 GetBlockSize() const;
143 143
144 // Get X, Y sizes of a block 144 /// Get X, Y sizes of a block
145 std::pair<u32, u32> GetBlockXY() const; 145 std::pair<u32, u32> GetBlockXY() const;
146 146
147 // Get the offset in x, y, z coordinates from a memory offset 147 /// Get the offset in x, y, z coordinates from a memory offset
148 std::tuple<u32, u32, u32> GetBlockOffsetXYZ(u32 offset) const; 148 std::tuple<u32, u32, u32> GetBlockOffsetXYZ(u32 offset) const;
149 149
150 /// Returns the size of a layer in bytes in guest memory. 150 /// Returns the size of a layer in bytes in guest memory.
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 5416eee3b..9c2d108d3 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -619,10 +619,10 @@ private:
619 * Takes care of managing 3D textures and its slices. Does some HLE methods when possible. 619 * Takes care of managing 3D textures and its slices. Does some HLE methods when possible.
620 * Fallsback to LLE when it isn't possible. 620 * Fallsback to LLE when it isn't possible.
621 * 621 *
622 * @param overlaps The overlapping surfaces registered in the cache. 622 * @param overlaps The overlapping surfaces registered in the cache.
623 * @param params The parameters on the new surface. 623 * @param params The parameters on the new surface.
624 * @param gpu_addr The starting address of the new surface. 624 * @param gpu_addr The starting address of the new surface.
625 * @param cache_addr The starting address of the new surface on physical memory. 625 * @param cache_addr The starting address of the new surface on physical memory.
626 * @param preserve_contents Indicates that the new surface should be loaded from memory or 626 * @param preserve_contents Indicates that the new surface should be loaded from memory or
627 * left blank. 627 * left blank.
628 */ 628 */
@@ -669,7 +669,8 @@ private:
669 } 669 }
670 new_surface->MarkAsModified(modified, Tick()); 670 new_surface->MarkAsModified(modified, Tick());
671 Register(new_surface); 671 Register(new_surface);
672 return {{new_surface, new_surface->GetMainView()}}; 672 auto view = new_surface->GetMainView();
673 return {{std::move(new_surface), view}};
673 } else { 674 } else {
674 for (const auto& surface : overlaps) { 675 for (const auto& surface : overlaps) {
675 if (!surface->MatchTarget(params.target)) { 676 if (!surface->MatchTarget(params.target)) {
@@ -685,8 +686,7 @@ private:
685 if (surface->GetCacheAddr() != cache_addr) { 686 if (surface->GetCacheAddr() != cache_addr) {
686 continue; 687 continue;
687 } 688 }
688 const auto struct_result = surface->MatchesStructure(params); 689 if (surface->MatchesStructure(params) == MatchStructureResult::FullMatch) {
689 if (struct_result == MatchStructureResult::FullMatch) {
690 return {{surface, surface->GetMainView()}}; 690 return {{surface, surface->GetMainView()}};
691 } 691 }
692 } 692 }
@@ -768,7 +768,7 @@ private:
768 768
769 // Look if it's a 3D texture 769 // Look if it's a 3D texture
770 if (params.block_depth > 0) { 770 if (params.block_depth > 0) {
771 std::optional<std::pair<TSurface, TView>> surface = 771 auto surface =
772 Manage3DSurfaces(overlaps, params, gpu_addr, cache_addr, preserve_contents); 772 Manage3DSurfaces(overlaps, params, gpu_addr, cache_addr, preserve_contents);
773 if (surface) { 773 if (surface) {
774 return *surface; 774 return *surface;