summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-06-29 22:29:39 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-06-29 22:29:39 +0200
commit3f3c3ca5f96fd5742524703f20b531338fa2e5f7 (patch)
tree8d1cbe2d6c6c565cd239aaddf7bb5f97b4aba09f /src
parenttexture_cache: Correct variable naming. (diff)
downloadyuzu-3f3c3ca5f96fd5742524703f20b531338fa2e5f7.tar
yuzu-3f3c3ca5f96fd5742524703f20b531338fa2e5f7.tar.gz
yuzu-3f3c3ca5f96fd5742524703f20b531338fa2e5f7.tar.bz2
yuzu-3f3c3ca5f96fd5742524703f20b531338fa2e5f7.tar.lz
yuzu-3f3c3ca5f96fd5742524703f20b531338fa2e5f7.tar.xz
yuzu-3f3c3ca5f96fd5742524703f20b531338fa2e5f7.tar.zst
yuzu-3f3c3ca5f96fd5742524703f20b531338fa2e5f7.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp5
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.h15
-rw-r--r--src/video_core/texture_cache/surface_base.h2
-rw-r--r--src/video_core/texture_cache/texture_cache.h21
4 files changed, 13 insertions, 30 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index 672f26f37..97014a676 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -236,10 +236,7 @@ CachedSurface::CachedSurface(const GPUVAddr gpu_addr, const SurfaceParams& param
true);
}
-CachedSurface::~CachedSurface() {
- views.clear();
- main_view = nullptr;
-}
+CachedSurface::~CachedSurface() = default;
void CachedSurface::DownloadTexture(std::vector<u8>& staging_buffer) {
MICROPROFILE_SCOPE(OpenGL_Texture_Download);
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h
index 8da81dba3..d4c6e9a30 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.h
+++ b/src/video_core/renderer_opengl/gl_texture_cache.h
@@ -89,21 +89,6 @@ public:
return surface.GetSurfaceParams();
}
- u32 GetWidth() const {
- const auto& owner_params = GetSurfaceParams();
- return owner_params.GetMipWidth(params.base_level);
- }
-
- u32 GetHeight() const {
- const auto& owner_params = GetSurfaceParams();
- return owner_params.GetMipHeight(params.base_level);
- }
-
- u32 GetDepth() const {
- const auto& owner_params = GetSurfaceParams();
- return owner_params.GetMipDepth(params.base_level);
- }
-
void ApplySwizzle(Tegra::Texture::SwizzleSource x_source,
Tegra::Texture::SwizzleSource y_source,
Tegra::Texture::SwizzleSource z_source,
diff --git a/src/video_core/texture_cache/surface_base.h b/src/video_core/texture_cache/surface_base.h
index d632630ce..eaed6545d 100644
--- a/src/video_core/texture_cache/surface_base.h
+++ b/src/video_core/texture_cache/surface_base.h
@@ -294,8 +294,8 @@ protected:
virtual TView CreateView(const ViewParams& view_key) = 0;
- std::unordered_map<ViewParams, TView> views;
TView main_view;
+ std::unordered_map<ViewParams, TView> views;
private:
TView GetView(const ViewParams& key) {
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index b5b0e91ef..9436a5ff2 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -79,10 +79,9 @@ public:
if (surfaces.empty()) {
return;
}
- std::sort(surfaces.begin(), surfaces.end(),
- [](const TSurface& a, const TSurface& b) -> bool {
- return a->GetModificationTick() < b->GetModificationTick();
- });
+ std::sort(surfaces.begin(), surfaces.end(), [](const TSurface& a, const TSurface& b) {
+ return a->GetModificationTick() < b->GetModificationTick();
+ });
for (const auto& surface : surfaces) {
FlushSurface(surface);
}
@@ -181,13 +180,15 @@ public:
}
void MarkColorBufferInUse(std::size_t index) {
- if (render_targets[index].target)
- render_targets[index].target->MarkAsModified(true, Tick());
+ if (auto& render_target = render_targets[index].target) {
+ render_target->MarkAsModified(true, Tick());
+ }
}
void MarkDepthBufferInUse() {
- if (depth_buffer.target)
+ if (depth_buffer.target) {
depth_buffer.target->MarkAsModified(true, Tick());
+ }
}
void SetEmptyDepthBuffer() {
@@ -245,11 +246,11 @@ protected:
}
SetEmptyDepthBuffer();
staging_cache.SetSize(2);
- auto make_siblings = ([this](PixelFormat a, PixelFormat b) {
+ const auto make_siblings = [this](PixelFormat a, PixelFormat b) {
siblings_table[a] = b;
siblings_table[b] = a;
- });
- const u32 max_formats = static_cast<u32>(PixelFormat::Max);
+ };
+ const auto max_formats = static_cast<u32>(PixelFormat::Max);
siblings_table.reserve(max_formats);
for (u32 i = 0; i < max_formats; i++) {
siblings_table[static_cast<PixelFormat>(i)] = PixelFormat::Invalid;