summaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-05-13 21:35:32 -0400
committerGravatar ReinUsesLisp2019-06-20 21:36:12 -0300
commit4530511ee4dfc92ddbfed7f91978f332be517c90 (patch)
tree79a1845ecbf918642c9255d5a66681d2b511f6bb /src/video_core/texture_cache
parenttexture_cache: Implement Guard mechanism (diff)
downloadyuzu-4530511ee4dfc92ddbfed7f91978f332be517c90.tar.gz
yuzu-4530511ee4dfc92ddbfed7f91978f332be517c90.tar.xz
yuzu-4530511ee4dfc92ddbfed7f91978f332be517c90.zip
texture_cache: Try to Reconstruct Surface on bigger than overlap.
This fixes clouds in SMO Cap Kingdom and lens on Cloud Kingdom. Also moved accurate_gpu setting check to Pick Strategy
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r--src/video_core/texture_cache/texture_cache.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 2ad6210dd..38b56475f 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -295,6 +295,9 @@ private:
295 295
296 RecycleStrategy PickStrategy(std::vector<TSurface>& overlaps, const SurfaceParams& params, 296 RecycleStrategy PickStrategy(std::vector<TSurface>& overlaps, const SurfaceParams& params,
297 const GPUVAddr gpu_addr, const bool untopological) { 297 const GPUVAddr gpu_addr, const bool untopological) {
298 if (Settings::values.use_accurate_gpu_emulation) {
299 return RecycleStrategy::Flush;
300 }
298 // 3D Textures decision 301 // 3D Textures decision
299 if (params.block_depth > 1 || params.target == SurfaceTarget::Texture3D) { 302 if (params.block_depth > 1 || params.target == SurfaceTarget::Texture3D) {
300 return RecycleStrategy::Flush; 303 return RecycleStrategy::Flush;
@@ -319,10 +322,7 @@ private:
319 for (auto surface : overlaps) { 322 for (auto surface : overlaps) {
320 Unregister(surface); 323 Unregister(surface);
321 } 324 }
322 RecycleStrategy strategy = !Settings::values.use_accurate_gpu_emulation 325 switch (PickStrategy(overlaps, params, gpu_addr, untopological)) {
323 ? PickStrategy(overlaps, params, gpu_addr, untopological)
324 : RecycleStrategy::Flush;
325 switch (strategy) {
326 case RecycleStrategy::Ignore: { 326 case RecycleStrategy::Ignore: {
327 return InitializeSurface(gpu_addr, params, preserve_contents); 327 return InitializeSurface(gpu_addr, params, preserve_contents);
328 } 328 }
@@ -453,6 +453,13 @@ private:
453 if (overlaps.size() == 1) { 453 if (overlaps.size() == 1) {
454 TSurface current_surface = overlaps[0]; 454 TSurface current_surface = overlaps[0];
455 if (!current_surface->IsInside(gpu_addr, gpu_addr + candidate_size)) { 455 if (!current_surface->IsInside(gpu_addr, gpu_addr + candidate_size)) {
456 if (current_surface->GetGpuAddr() == gpu_addr) {
457 std::optional<std::pair<TSurface, TView>> view =
458 ReconstructSurface(overlaps, params, gpu_addr, host_ptr);
459 if (view.has_value()) {
460 return *view;
461 }
462 }
456 return RecycleSurface(overlaps, params, gpu_addr, preserve_contents, false); 463 return RecycleSurface(overlaps, params, gpu_addr, preserve_contents, false);
457 } 464 }
458 std::optional<TView> view = 465 std::optional<TView> view =