diff options
| author | 2019-05-08 07:09:02 -0400 | |
|---|---|---|
| committer | 2019-06-20 21:36:12 -0300 | |
| commit | de0b1cb2b2199bd8efff78938d385fa74652cdfb (patch) | |
| tree | 627dc29f0d24dc37aaa823fada0d14c7c40e1eda /src/video_core/texture_cache | |
| parent | surface_base: Add parenthesis to EmplaceOverview's predicate (diff) | |
| download | yuzu-de0b1cb2b2199bd8efff78938d385fa74652cdfb.tar.gz yuzu-de0b1cb2b2199bd8efff78938d385fa74652cdfb.tar.xz yuzu-de0b1cb2b2199bd8efff78938d385fa74652cdfb.zip | |
Fixes to mipmap's process and reconstruct process
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/surface_base.h | 4 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/texture_cache/surface_base.h b/src/video_core/texture_cache/surface_base.h index c11998249..017ee999e 100644 --- a/src/video_core/texture_cache/surface_base.h +++ b/src/video_core/texture_cache/surface_base.h | |||
| @@ -262,20 +262,20 @@ public: | |||
| 262 | view_params.target == SurfaceTarget::Texture3D) { | 262 | view_params.target == SurfaceTarget::Texture3D) { |
| 263 | return {}; | 263 | return {}; |
| 264 | } | 264 | } |
| 265 | const std::size_t size{view_params.GetGuestSizeInBytes()}; | ||
| 266 | const auto layer_mipmap{GetLayerMipmap(view_addr)}; | 265 | const auto layer_mipmap{GetLayerMipmap(view_addr)}; |
| 267 | if (!layer_mipmap) { | 266 | if (!layer_mipmap) { |
| 268 | return {}; | 267 | return {}; |
| 269 | } | 268 | } |
| 270 | const u32 layer{layer_mipmap->first}; | 269 | const u32 layer{layer_mipmap->first}; |
| 271 | const u32 mipmap{layer_mipmap->second}; | 270 | const u32 mipmap{layer_mipmap->second}; |
| 271 | const std::size_t size{view_params.GetGuestSizeInBytes()}; | ||
| 272 | if (GetMipmapSize(mipmap) != size) { | 272 | if (GetMipmapSize(mipmap) != size) { |
| 273 | // TODO: The view may cover many mimaps, this case can still go on. | 273 | // TODO: The view may cover many mimaps, this case can still go on. |
| 274 | // This edge-case can be safely be ignored since it will just result in worse | 274 | // This edge-case can be safely be ignored since it will just result in worse |
| 275 | // performance. | 275 | // performance. |
| 276 | return {}; | 276 | return {}; |
| 277 | } | 277 | } |
| 278 | return GetView(ViewParams(params.target, layer, 1, mipmap, 1)); | 278 | return GetView(ViewParams(view_params.target, layer, 1, mipmap, 1)); |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | TView GetMainView() const { | 281 | TView GetMainView() const { |
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index bb5a50ab9..554b9a228 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -323,7 +323,7 @@ private: | |||
| 323 | const SurfaceParams& params, | 323 | const SurfaceParams& params, |
| 324 | const GPUVAddr gpu_addr, | 324 | const GPUVAddr gpu_addr, |
| 325 | const u8* host_ptr) { | 325 | const u8* host_ptr) { |
| 326 | if (!params.is_layered || params.target == SurfaceTarget::Texture3D) { | 326 | if (params.target == SurfaceTarget::Texture3D) { |
| 327 | return {}; | 327 | return {}; |
| 328 | } | 328 | } |
| 329 | TSurface new_surface = GetUncachedSurface(gpu_addr, params); | 329 | TSurface new_surface = GetUncachedSurface(gpu_addr, params); |