[GPU] Write the mip statistics report with its ready marker
This commit is contained in:
parent
fab999316e
commit
d5332f01ca
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue