::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag
(std::max)((std::min)(device_local_memory - min_vacancy_critical, min_spacing_critical),
DEFAULT_CRITICAL_MEMORY));
minimum_memory = static_cast ::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag
critical_memory = DEFAULT_CRITICAL_MEMORY + 1_GiB;
minimum_memory = 0;
- chunk_size = 32_MiB;
- slices_per_batch = 32;
-
lowmemorydevice = true;
}
}
@@ -1479,18 +1473,38 @@ void TextureCache ::TickAsyncUnswizzle() {
task.initialized = true;
}
+ size_t CHUNK_SIZE;
+ switch (Settings::values.gpu_unzwizzle_stream_size.GetValue()) {
+ case Settings::GpuUnswizzle::VeryLow: CHUNK_SIZE = 4_MiB; break;
+ case Settings::GpuUnswizzle::Low: CHUNK_SIZE = 8_MiB; break;
+ case Settings::GpuUnswizzle::Normal: CHUNK_SIZE = 16_MiB; break;
+ case Settings::GpuUnswizzle::Medium: CHUNK_SIZE = 32_MiB; break;
+ case Settings::GpuUnswizzle::High: CHUNK_SIZE = 64_MiB; break;
+ default: CHUNK_SIZE = 16_MiB;
+ }
+
+ u32 SLICES_PER_BATCH;
+ switch (Settings::values.gpu_unzwizzle_chunk_size.GetValue()) {
+ case Settings::GpuUnswizzleChunk::VeryLow: SLICES_PER_BATCH = 32; break;
+ case Settings::GpuUnswizzleChunk::Low: SLICES_PER_BATCH = 64; break;
+ case Settings::GpuUnswizzleChunk::Normal: SLICES_PER_BATCH = 128; break;
+ case Settings::GpuUnswizzleChunk::Medium: SLICES_PER_BATCH = 256; break;
+ case Settings::GpuUnswizzleChunk::High: SLICES_PER_BATCH = 512; break;
+ default: SLICES_PER_BATCH = 128;
+ }
+
// Read data
if (task.current_offset < task.total_size) {
const size_t remaining = task.total_size - task.current_offset;
- size_t copy_amount = std::min(chunk_size, remaining);
-
- if (remaining > chunk_size) {
+ size_t copy_amount = std::min(CHUNK_SIZE, remaining);
+
+ if (remaining > CHUNK_SIZE) {
copy_amount = (copy_amount / task.bytes_per_slice) * task.bytes_per_slice;
if (copy_amount == 0) copy_amount = task.bytes_per_slice;
}
- gpu_memory->ReadBlockUnsafe(image.gpu_addr + task.current_offset,
+ gpu_memory->ReadBlock(image.gpu_addr + task.current_offset,
task.staging_buffer.mapped_span.data() + task.current_offset,
copy_amount);
task.current_offset += copy_amount;
@@ -1500,7 +1514,7 @@ void TextureCache ::TickAsyncUnswizzle() {
const u32 complete_slices = static_cast ::TickAsyncUnswizzle() {
image.flags &= ~ImageFlagBits::IsDecoding;
unswizzle_queue.pop_front();
- if (total_used_memory >= expected_memory) {
- RunGarbageCollector();
- }
-
// Wait 4 frames to process the next entry
current_unswizzle_frame = 4u;
}
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h
index 7b642850fd..616d77776a 100644
--- a/src/video_core/texture_cache/texture_cache_base.h
+++ b/src/video_core/texture_cache/texture_cache_base.h
@@ -475,8 +475,6 @@ private:
u64 minimum_memory;
u64 expected_memory;
u64 critical_memory;
- size_t chunk_size;
- size_t slices_per_batch;
bool lowmemorydevice = false;
struct BufferDownload {