Stage timing: Textures and Flush stages; parallel stats: why flushes stay serial (SerialClosed/NotReady/Small/Bytes)
Build & Release / build (push) Canceled after 0s

This commit is contained in:
4DBug committed 2026-10-17 09:55:26 -05:00
1 parent 352a389f1d
commit e413270786
4 files changed
+27 -5

No files matched your search

+7
View File
@@ -26,6 +26,8 @@ M.Config = { Actors = 4, MinTiles = 1, MinPixels = 2048, MaxBytesPerPixel = 0, S
M.Stats = {
ParallelFlushes = 0, SerialFlushes = 0, Tiles = 0, Fallbacks = 0, Late = 0, Pack = 0, Flush = 0, Finish = 0,
SendBytes = 0, TexSends = 0, TexBytes = 0, Rects = 0, Recv = 0, RecvBytes = 0,
-- why a flush stayed serial: dispatch window closed / Actors not ready / below MinTiles or MinPixels / over MaxBytesPerPixel
SerialClosed = 0, SerialNotReady = 0, SerialSmall = 0, SerialBytes = 0,
}
local Stats = M.Stats
@@ -249,6 +251,11 @@ function M.Flush()
bytes += Pn[a] + Tn[a]
end
par = bytes <= cfg.MaxBytesPerPixel * jobs.Px
if not par then Stats.SerialBytes += 1 end
elseif not par then
if not open then Stats.SerialClosed += 1
elseif not (cfg.Sync or ready) then Stats.SerialNotReady += 1
else Stats.SerialSmall += 1 end
end
batch_no += 1
local b = jobs
+6 -2
View File
@@ -748,14 +748,16 @@ function M.RenderDrawData(draw_data)
PB("ImGui RenderDrawData")
BackendData.FrameStartTime = os.clock()
if EditableImages.StageTiming then
EditableImages.StageFrame = { Compare = 0, Collect = 0, Hash = 0, Raster = 0, Upload = 0, Other = 0, Total = 0,
EditableImages.StageFrame = { Compare = 0, Collect = 0, Hash = 0, Raster = 0, Upload = 0, Textures = 0, Flush = 0, Other = 0, Total = 0,
TilesRasterized = 0, PixelsRasterized = 0, Uploads = 0, TilesCreated = 0, TilesFreed = 0 } end
BackendData.FrameTiles = 0
-- the first dirty tile of a frame is always redrawn (progress), the rest within the budget
BackendData.RedrawStarted = false
BackendData.Stale = nil
if EditableImages.StageTiming then EditableImages.BeginStage() end
UpdateTextures(draw_data)
if EditableImages.StageTiming then EditableImages.EndStage("Textures") end
if not RenderRateAllows(BackendData, draw_data) then
PE()
return
@@ -828,13 +830,15 @@ function M.RenderDrawData(draw_data)
BackendData.StaleHeartbeat = BackendData.HeartbeatCount
end
if Parallel.Active then
if EditableImages.StageTiming then EditableImages.BeginStage() end
Parallel.Flush()
if EditableImages.StageTiming then EditableImages.EndStage("Flush") end
end
if EditableImages.StageTiming and EditableImages.StageFrame then
local f = EditableImages.StageFrame
f.Raster -= f.Upload
f.Total = os.clock() - BackendData.FrameStartTime
f.Other = f.Total - f.Compare - f.Collect - f.Hash - f.Raster - f.Upload
f.Other = f.Total - f.Compare - f.Collect - f.Hash - f.Raster - f.Upload - f.Textures - f.Flush
BackendData.FrameStats = f
end
PE()