From cb971ad654256f2de89119a7f9e2a98bb312241f Mon Sep 17 00:00:00 2001 From: Feng Chen Date: Wed, 9 Nov 2022 15:57:42 +0800 Subject: video_core: Reimplement inline index buffer binding --- src/video_core/buffer_cache/buffer_cache.h | 33 ++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'src/video_core/buffer_cache') diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 2ba33543c..599551013 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -992,7 +992,20 @@ void BufferCache
::BindHostIndexBuffer() {
TouchBuffer(buffer, index_buffer.buffer_id);
const u32 offset = buffer.Offset(index_buffer.cpu_addr);
const u32 size = index_buffer.size;
- SynchronizeBuffer(buffer, index_buffer.cpu_addr, size);
+ if (maxwell3d->inline_index_draw_indexes.size()) {
+ if constexpr (USE_MEMORY_MAPS) {
+ auto upload_staging = runtime.UploadStagingBuffer(size);
+ std::array ::UpdateIndexBuffer() {
}
flags[Dirty::IndexBuffer] = false;
last_index_count = index_array.count;
-
+ if (maxwell3d->inline_index_draw_indexes.size()) {
+ auto inline_index_size = static_cast ::OverlapResult BufferCache ::ResolveOverlaps(VAddr cpu
VAddr end = cpu_addr + wanted_size;
int stream_score = 0;
bool has_stream_leap = false;
+ if (begin == 0) {
+ return OverlapResult{
+ .ids = std::move(overlap_ids),
+ .begin = begin,
+ .end = end,
+ .has_stream_leap = has_stream_leap,
+ };
+ }
for (; cpu_addr >> YUZU_PAGEBITS < Common::DivCeil(end, YUZU_PAGESIZE);
cpu_addr += YUZU_PAGESIZE) {
const BufferId overlap_id = page_table[cpu_addr >> YUZU_PAGEBITS];
--
cgit v1.2.3