summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-06-09 01:22:31 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-06-09 01:22:31 +0200
commit6e122f0b2c3fe6a2cccd15256a04bcd4342c86f7 (patch)
tree852d18e943c3643dc954bb8736bd10eeaa0c2181
parentMerge pull request #4034 from ReinUsesLisp/storage-texels (diff)
downloadyuzu-6e122f0b2c3fe6a2cccd15256a04bcd4342c86f7.tar
yuzu-6e122f0b2c3fe6a2cccd15256a04bcd4342c86f7.tar.gz
yuzu-6e122f0b2c3fe6a2cccd15256a04bcd4342c86f7.tar.bz2
yuzu-6e122f0b2c3fe6a2cccd15256a04bcd4342c86f7.tar.lz
yuzu-6e122f0b2c3fe6a2cccd15256a04bcd4342c86f7.tar.xz
yuzu-6e122f0b2c3fe6a2cccd15256a04bcd4342c86f7.tar.zst
yuzu-6e122f0b2c3fe6a2cccd15256a04bcd4342c86f7.zip
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index b88fce2cd..77ae34339 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -110,19 +110,23 @@ public:
});
}
- void Map(std::size_t max_size) {
+ /// Prepares the buffer cache for data uploading
+ /// @param max_size Maximum number of bytes that will be uploaded
+ /// @return True when a stream buffer invalidation was required, false otherwise
+ bool Map(std::size_t max_size) {
std::lock_guard lock{mutex};
+ bool invalidated;
std::tie(buffer_ptr, buffer_offset_base, invalidated) = stream_buffer->Map(max_size, 4);
buffer_offset = buffer_offset_base;
+
+ return invalidated;
}
- /// Finishes the upload stream, returns true on bindings invalidation.
- bool Unmap() {
+ /// Finishes the upload stream
+ void Unmap() {
std::lock_guard lock{mutex};
-
stream_buffer->Unmap(buffer_offset - buffer_offset_base);
- return std::exchange(invalidated, false);
}
void TickFrame() {
@@ -576,8 +580,6 @@ private:
std::unique_ptr<StreamBuffer> stream_buffer;
BufferType stream_buffer_handle{};
- bool invalidated = false;
-
u8* buffer_ptr = nullptr;
u64 buffer_offset = 0;
u64 buffer_offset_base = 0;