diff options
Diffstat (limited to 'src/video_core/buffer_cache')
| -rw-r--r-- | src/video_core/buffer_cache/buffer_cache.h | 10 | ||||
| -rw-r--r-- | src/video_core/buffer_cache/buffer_cache_base.h | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index f1ad5f7cb..2f281b370 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h | |||
| @@ -478,7 +478,6 @@ void BufferCache<P>::CommitAsyncFlushesHigh() { | |||
| 478 | 478 | ||
| 479 | if (committed_ranges.empty()) { | 479 | if (committed_ranges.empty()) { |
| 480 | if constexpr (IMPLEMENTS_ASYNC_DOWNLOADS) { | 480 | if constexpr (IMPLEMENTS_ASYNC_DOWNLOADS) { |
| 481 | |||
| 482 | async_buffers.emplace_back(std::optional<Async_Buffer>{}); | 481 | async_buffers.emplace_back(std::optional<Async_Buffer>{}); |
| 483 | } | 482 | } |
| 484 | return; | 483 | return; |
| @@ -539,7 +538,6 @@ void BufferCache<P>::CommitAsyncFlushesHigh() { | |||
| 539 | committed_ranges.clear(); | 538 | committed_ranges.clear(); |
| 540 | if (downloads.empty()) { | 539 | if (downloads.empty()) { |
| 541 | if constexpr (IMPLEMENTS_ASYNC_DOWNLOADS) { | 540 | if constexpr (IMPLEMENTS_ASYNC_DOWNLOADS) { |
| 542 | |||
| 543 | async_buffers.emplace_back(std::optional<Async_Buffer>{}); | 541 | async_buffers.emplace_back(std::optional<Async_Buffer>{}); |
| 544 | } | 542 | } |
| 545 | return; | 543 | return; |
| @@ -691,7 +689,7 @@ void BufferCache<P>::BindHostIndexBuffer() { | |||
| 691 | const u32 size = channel_state->index_buffer.size; | 689 | const u32 size = channel_state->index_buffer.size; |
| 692 | const auto& draw_state = maxwell3d->draw_manager->GetDrawState(); | 690 | const auto& draw_state = maxwell3d->draw_manager->GetDrawState(); |
| 693 | if (!draw_state.inline_index_draw_indexes.empty()) [[unlikely]] { | 691 | if (!draw_state.inline_index_draw_indexes.empty()) [[unlikely]] { |
| 694 | if constexpr (USE_MEMORY_MAPS) { | 692 | if constexpr (USE_MEMORY_MAPS_FOR_UPLOADS) { |
| 695 | auto upload_staging = runtime.UploadStagingBuffer(size); | 693 | auto upload_staging = runtime.UploadStagingBuffer(size); |
| 696 | std::array<BufferCopy, 1> copies{ | 694 | std::array<BufferCopy, 1> copies{ |
| 697 | {BufferCopy{.src_offset = upload_staging.offset, .dst_offset = 0, .size = size}}}; | 695 | {BufferCopy{.src_offset = upload_staging.offset, .dst_offset = 0, .size = size}}}; |
| @@ -1462,7 +1460,7 @@ bool BufferCache<P>::SynchronizeBufferNoModified(Buffer& buffer, VAddr cpu_addr, | |||
| 1462 | template <class P> | 1460 | template <class P> |
| 1463 | void BufferCache<P>::UploadMemory(Buffer& buffer, u64 total_size_bytes, u64 largest_copy, | 1461 | void BufferCache<P>::UploadMemory(Buffer& buffer, u64 total_size_bytes, u64 largest_copy, |
| 1464 | std::span<BufferCopy> copies) { | 1462 | std::span<BufferCopy> copies) { |
| 1465 | if constexpr (USE_MEMORY_MAPS) { | 1463 | if constexpr (USE_MEMORY_MAPS_FOR_UPLOADS) { |
| 1466 | MappedUploadMemory(buffer, total_size_bytes, copies); | 1464 | MappedUploadMemory(buffer, total_size_bytes, copies); |
| 1467 | } else { | 1465 | } else { |
| 1468 | ImmediateUploadMemory(buffer, largest_copy, copies); | 1466 | ImmediateUploadMemory(buffer, largest_copy, copies); |
| @@ -1473,7 +1471,7 @@ template <class P> | |||
| 1473 | void BufferCache<P>::ImmediateUploadMemory([[maybe_unused]] Buffer& buffer, | 1471 | void BufferCache<P>::ImmediateUploadMemory([[maybe_unused]] Buffer& buffer, |
| 1474 | [[maybe_unused]] u64 largest_copy, | 1472 | [[maybe_unused]] u64 largest_copy, |
| 1475 | [[maybe_unused]] std::span<const BufferCopy> copies) { | 1473 | [[maybe_unused]] std::span<const BufferCopy> copies) { |
| 1476 | if constexpr (!USE_MEMORY_MAPS) { | 1474 | if constexpr (!USE_MEMORY_MAPS_FOR_UPLOADS) { |
| 1477 | std::span<u8> immediate_buffer; | 1475 | std::span<u8> immediate_buffer; |
| 1478 | for (const BufferCopy& copy : copies) { | 1476 | for (const BufferCopy& copy : copies) { |
| 1479 | std::span<const u8> upload_span; | 1477 | std::span<const u8> upload_span; |
| @@ -1532,7 +1530,7 @@ bool BufferCache<P>::InlineMemory(VAddr dest_address, size_t copy_size, | |||
| 1532 | auto& buffer = slot_buffers[buffer_id]; | 1530 | auto& buffer = slot_buffers[buffer_id]; |
| 1533 | SynchronizeBuffer(buffer, dest_address, static_cast<u32>(copy_size)); | 1531 | SynchronizeBuffer(buffer, dest_address, static_cast<u32>(copy_size)); |
| 1534 | 1532 | ||
| 1535 | if constexpr (USE_MEMORY_MAPS) { | 1533 | if constexpr (USE_MEMORY_MAPS_FOR_UPLOADS) { |
| 1536 | auto upload_staging = runtime.UploadStagingBuffer(copy_size); | 1534 | auto upload_staging = runtime.UploadStagingBuffer(copy_size); |
| 1537 | std::array copies{BufferCopy{ | 1535 | std::array copies{BufferCopy{ |
| 1538 | .src_offset = upload_staging.offset, | 1536 | .src_offset = upload_staging.offset, |
diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index c689fe06b..60a1f285e 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h | |||
| @@ -173,6 +173,7 @@ class BufferCache : public VideoCommon::ChannelSetupCaches<BufferCacheChannelInf | |||
| 173 | static constexpr bool USE_MEMORY_MAPS = P::USE_MEMORY_MAPS; | 173 | static constexpr bool USE_MEMORY_MAPS = P::USE_MEMORY_MAPS; |
| 174 | static constexpr bool SEPARATE_IMAGE_BUFFERS_BINDINGS = P::SEPARATE_IMAGE_BUFFER_BINDINGS; | 174 | static constexpr bool SEPARATE_IMAGE_BUFFERS_BINDINGS = P::SEPARATE_IMAGE_BUFFER_BINDINGS; |
| 175 | static constexpr bool IMPLEMENTS_ASYNC_DOWNLOADS = P::IMPLEMENTS_ASYNC_DOWNLOADS; | 175 | static constexpr bool IMPLEMENTS_ASYNC_DOWNLOADS = P::IMPLEMENTS_ASYNC_DOWNLOADS; |
| 176 | static constexpr bool USE_MEMORY_MAPS_FOR_UPLOADS = P::USE_MEMORY_MAPS_FOR_UPLOADS; | ||
| 176 | 177 | ||
| 177 | static constexpr s64 DEFAULT_EXPECTED_MEMORY = 512_MiB; | 178 | static constexpr s64 DEFAULT_EXPECTED_MEMORY = 512_MiB; |
| 178 | static constexpr s64 DEFAULT_CRITICAL_MEMORY = 1_GiB; | 179 | static constexpr s64 DEFAULT_CRITICAL_MEMORY = 1_GiB; |