summaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-06-29 17:29:39 -0300
committerGravatar ReinUsesLisp2019-06-29 17:29:39 -0300
commit3f3c3ca5f96fd5742524703f20b531338fa2e5f7 (patch)
tree8d1cbe2d6c6c565cd239aaddf7bb5f97b4aba09f /src/video_core/texture_cache
parenttexture_cache: Correct variable naming. (diff)
downloadyuzu-3f3c3ca5f96fd5742524703f20b531338fa2e5f7.tar.gz
yuzu-3f3c3ca5f96fd5742524703f20b531338fa2e5f7.tar.xz
yuzu-3f3c3ca5f96fd5742524703f20b531338fa2e5f7.zip
texture_cache: Address feedback
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r--src/video_core/texture_cache/surface_base.h2
-rw-r--r--src/video_core/texture_cache/texture_cache.h21
2 files changed, 12 insertions, 11 deletions
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:
294 294
295 virtual TView CreateView(const ViewParams& view_key) = 0; 295 virtual TView CreateView(const ViewParams& view_key) = 0;
296 296
297 std::unordered_map<ViewParams, TView> views;
298 TView main_view; 297 TView main_view;
298 std::unordered_map<ViewParams, TView> views;
299 299
300private: 300private:
301 TView GetView(const ViewParams& key) { 301 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:
79 if (surfaces.empty()) { 79 if (surfaces.empty()) {
80 return; 80 return;
81 } 81 }
82 std::sort(surfaces.begin(), surfaces.end(), 82 std::sort(surfaces.begin(), surfaces.end(), [](const TSurface& a, const TSurface& b) {
83 [](const TSurface& a, const TSurface& b) -> bool { 83 return a->GetModificationTick() < b->GetModificationTick();
84 return a->GetModificationTick() < b->GetModificationTick(); 84 });
85 });
86 for (const auto& surface : surfaces) { 85 for (const auto& surface : surfaces) {
87 FlushSurface(surface); 86 FlushSurface(surface);
88 } 87 }
@@ -181,13 +180,15 @@ public:
181 } 180 }
182 181
183 void MarkColorBufferInUse(std::size_t index) { 182 void MarkColorBufferInUse(std::size_t index) {
184 if (render_targets[index].target) 183 if (auto& render_target = render_targets[index].target) {
185 render_targets[index].target->MarkAsModified(true, Tick()); 184 render_target->MarkAsModified(true, Tick());
185 }
186 } 186 }
187 187
188 void MarkDepthBufferInUse() { 188 void MarkDepthBufferInUse() {
189 if (depth_buffer.target) 189 if (depth_buffer.target) {
190 depth_buffer.target->MarkAsModified(true, Tick()); 190 depth_buffer.target->MarkAsModified(true, Tick());
191 }
191 } 192 }
192 193
193 void SetEmptyDepthBuffer() { 194 void SetEmptyDepthBuffer() {
@@ -245,11 +246,11 @@ protected:
245 } 246 }
246 SetEmptyDepthBuffer(); 247 SetEmptyDepthBuffer();
247 staging_cache.SetSize(2); 248 staging_cache.SetSize(2);
248 auto make_siblings = ([this](PixelFormat a, PixelFormat b) { 249 const auto make_siblings = [this](PixelFormat a, PixelFormat b) {
249 siblings_table[a] = b; 250 siblings_table[a] = b;
250 siblings_table[b] = a; 251 siblings_table[b] = a;
251 }); 252 };
252 const u32 max_formats = static_cast<u32>(PixelFormat::Max); 253 const auto max_formats = static_cast<u32>(PixelFormat::Max);
253 siblings_table.reserve(max_formats); 254 siblings_table.reserve(max_formats);
254 for (u32 i = 0; i < max_formats; i++) { 255 for (u32 i = 0; i < max_formats; i++) {
255 siblings_table[static_cast<PixelFormat>(i)] = PixelFormat::Invalid; 256 siblings_table[static_cast<PixelFormat>(i)] = PixelFormat::Invalid;