[GPU] Write the mip statistics report with its ready marker

This commit is contained in:
ParantezTech 2026-10-11 19:01:25 +03:00
parent fab999316e
commit d5332f01ca
1 changed files with 10 additions and 0 deletions

View File

@ -14,6 +14,7 @@ public sealed class MipStatistics
public const uint CounterWords = 257;
public const ulong CounterBufferBytes = 2 * CounterWords * sizeof(uint);
public const uint NoCounterField = 0x8000;
public const uint ReportWithoutCounters = 1;
private const int CounterBytes = 2 * sizeof(uint);
private const uint FinestMip = 0;
@ -70,6 +71,15 @@ public sealed class MipStatistics
}
}
public void WriteReport(Span<byte> report)
{
var hasCounters = TryWriteReport(report);
if (report.Length >= sizeof(uint))
{
BinaryPrimitives.WriteUInt32LittleEndian(report, hasCounters ? FirstCounterOffset : ReportWithoutCounters);
}
}
public bool TryWriteReport(Span<byte> report)
{
if (report.Length < ReportBytes)