early-access version 3584
This commit is contained in:
		@@ -131,33 +131,15 @@ std::optional<VideoCore::RasterizerDownloadArea> BufferCache<P>::GetFlushArea(VA
 | 
			
		||||
 | 
			
		||||
template <class P>
 | 
			
		||||
void BufferCache<P>::DownloadMemory(VAddr cpu_addr, u64 size) {
 | 
			
		||||
    WaitOnAsyncFlushes(cpu_addr, size);
 | 
			
		||||
    ForEachBufferInRange(cpu_addr, size, [&](BufferId, Buffer& buffer) {
 | 
			
		||||
        DownloadBufferMemory(buffer, cpu_addr, size);
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <class P>
 | 
			
		||||
void BufferCache<P>::WaitOnAsyncFlushes(VAddr cpu_addr, u64 size) {
 | 
			
		||||
    bool must_wait = false;
 | 
			
		||||
    ForEachInOverlapCounter(async_downloads, cpu_addr, size,
 | 
			
		||||
                            [&](VAddr, VAddr, int) { must_wait = true; });
 | 
			
		||||
    bool must_release = false;
 | 
			
		||||
    ForEachInRangeSet(pending_ranges, cpu_addr, size, [&](VAddr, VAddr) { must_release = true; });
 | 
			
		||||
    if (must_release) {
 | 
			
		||||
        std::function<void()> tmp([]() {});
 | 
			
		||||
        rasterizer.SignalFence(std::move(tmp));
 | 
			
		||||
    }
 | 
			
		||||
    if (must_wait || must_release) {
 | 
			
		||||
        rasterizer.ReleaseFences();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <class P>
 | 
			
		||||
void BufferCache<P>::ClearDownload(IntervalType subtract_interval) {
 | 
			
		||||
    RemoveEachInOverlapCounter(async_downloads, subtract_interval, -1024);
 | 
			
		||||
    uncommitted_ranges.subtract(subtract_interval);
 | 
			
		||||
    pending_ranges.subtract(subtract_interval);
 | 
			
		||||
    for (auto& interval_set : committed_ranges) {
 | 
			
		||||
        interval_set.subtract(subtract_interval);
 | 
			
		||||
    }
 | 
			
		||||
@@ -177,7 +159,6 @@ bool BufferCache<P>::DMACopy(GPUVAddr src_address, GPUVAddr dest_address, u64 am
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const IntervalType subtract_interval{*cpu_dest_address, *cpu_dest_address + amount};
 | 
			
		||||
    WaitOnAsyncFlushes(*cpu_src_address, static_cast<u32>(amount));
 | 
			
		||||
    ClearDownload(subtract_interval);
 | 
			
		||||
 | 
			
		||||
    BufferId buffer_a;
 | 
			
		||||
@@ -205,7 +186,6 @@ bool BufferCache<P>::DMACopy(GPUVAddr src_address, GPUVAddr dest_address, u64 am
 | 
			
		||||
        const IntervalType add_interval{new_base_address, new_base_address + size};
 | 
			
		||||
        tmp_intervals.push_back(add_interval);
 | 
			
		||||
        uncommitted_ranges.add(add_interval);
 | 
			
		||||
        pending_ranges.add(add_interval);
 | 
			
		||||
    };
 | 
			
		||||
    ForEachInRangeSet(common_ranges, *cpu_src_address, amount, mirror);
 | 
			
		||||
    // This subtraction in this order is important for overlapping copies.
 | 
			
		||||
@@ -492,7 +472,6 @@ void BufferCache<P>::CommitAsyncFlushesHigh() {
 | 
			
		||||
    }
 | 
			
		||||
    MICROPROFILE_SCOPE(GPU_DownloadMemory);
 | 
			
		||||
 | 
			
		||||
    pending_ranges.clear();
 | 
			
		||||
    auto it = committed_ranges.begin();
 | 
			
		||||
    while (it != committed_ranges.end()) {
 | 
			
		||||
        auto& current_intervals = *it;
 | 
			
		||||
@@ -1232,7 +1211,6 @@ void BufferCache<P>::MarkWrittenBuffer(BufferId buffer_id, VAddr cpu_addr, u32 s
 | 
			
		||||
    const IntervalType base_interval{cpu_addr, cpu_addr + size};
 | 
			
		||||
    common_ranges.add(base_interval);
 | 
			
		||||
    uncommitted_ranges.add(base_interval);
 | 
			
		||||
    pending_ranges.add(base_interval);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <class P>
 | 
			
		||||
 
 | 
			
		||||
@@ -381,8 +381,6 @@ private:
 | 
			
		||||
 | 
			
		||||
    void RunGarbageCollector();
 | 
			
		||||
 | 
			
		||||
    void WaitOnAsyncFlushes(VAddr cpu_addr, u64 size);
 | 
			
		||||
 | 
			
		||||
    void BindHostIndexBuffer();
 | 
			
		||||
 | 
			
		||||
    void BindHostVertexBuffers();
 | 
			
		||||
@@ -547,7 +545,6 @@ private:
 | 
			
		||||
    IntervalSet uncommitted_ranges;
 | 
			
		||||
    IntervalSet common_ranges;
 | 
			
		||||
    IntervalSet cached_ranges;
 | 
			
		||||
    IntervalSet pending_ranges;
 | 
			
		||||
    std::deque<IntervalSet> committed_ranges;
 | 
			
		||||
 | 
			
		||||
    // Async Buffers
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user