graphics: count DCC/CMASK metadata readbacks in the performance overlay

This commit is contained in:
nmzik committed 2026-10-22 16:12:20 +02:00
1 parent c5016d9455
commit 5f5d6effa4
4 files changed
+17

No files matched your search

+2
View File
@@ -29,6 +29,8 @@ enum class Counter {
TextureUploadBytes,
TextureDownloadBytes,
TextureEvictions,
ColorMetadataReadbacks, // CPU blocked reading back GPU-written DCC/CMASK metadata.
ColorMetadataReadbackNs,
BufferUploadBytes,
BufferDownloadBytes,
BufferEvictions,
+3
View File
@@ -1070,6 +1070,9 @@ void TextureCache::MaterializeColorClear(ImageId id, const ImageDesc& desc,
// Finish native metadata writes before reading backing bytes. This can submit the scheduler,
// so discovery runs before final draw uploads and never holds the texture lock across it.
if (m_buffer_cache.IsRegionGpuModified(range.address, range.size)) {
Common::DebugCounters::ScopedTimer timer(
Common::DebugCounters::Counter::ColorMetadataReadbacks,
Common::DebugCounters::Counter::ColorMetadataReadbackNs);
m_buffer_cache.ReadMemory(range.address, range.size, false);
}
const auto slice_size = range.size / layers;
@@ -310,6 +310,9 @@ void GpuActivityRows(const Snapshot& shown) {
Row("CPU waiting on GPU",
Fmt("%.0f ms/s (%.0f waits/s)", Rate(shown, Counter::GpuWaitNs) / 1e6,
Rate(shown, Counter::GpuWaits)));
Row("DCC/CMASK readbacks",
Fmt("%.0f ms/s (%.0f/s)", Rate(shown, Counter::ColorMetadataReadbackNs) / 1e6,
Rate(shown, Counter::ColorMetadataReadbacks)));
}
void CompilationRows(const Snapshot& shown) {