diff --git a/backends/roblox/parallel.lua b/backends/roblox/parallel.lua index 54ad100..89993be 100644 --- a/backends/roblox/parallel.lua +++ b/backends/roblox/parallel.lua @@ -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 diff --git a/backends/roblox/render.lua b/backends/roblox/render.lua index b576a3f..f03898c 100644 --- a/backends/roblox/render.lua +++ b/backends/roblox/render.lua @@ -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() diff --git a/build/ImGui.linemap.json b/build/ImGui.linemap.json index acb16a4..a6847a8 100644 --- a/build/ImGui.linemap.json +++ b/build/ImGui.linemap.json @@ -1 +1 @@ -[[46, "imgui.lua"], [22664, "imgui_demo.lua"], [34521, "imgui_draw.lua"], [42861, "imgui_h.lua"], [45864, "roblox/raster.lua"], [46340, "roblox/textures.lua"], [46519, "roblox/layers.lua"], [46856, "roblox/overlays.lua"], [46937, "roblox/render.lua"], [47782, "roblox/parallel.lua"], [48204, "imgui_impl_roblox.lua"], [48705, "imgui_impl_roblox_fonts.lua"], [55108, "imgui_internal.lua"], [59076, "imgui_tables.lua"], [64168, "imgui_widgets.lua"], [76409, "imstb_rectpack.lua"], [77086, "imstb_textedit.lua"], [78628, "imstb_truetype.lua"], [81569, "imstd_minstdio.lua"]] \ No newline at end of file +[[46, "imgui.lua"], [22664, "imgui_demo.lua"], [34521, "imgui_draw.lua"], [42861, "imgui_h.lua"], [45864, "roblox/raster.lua"], [46340, "roblox/textures.lua"], [46519, "roblox/layers.lua"], [46856, "roblox/overlays.lua"], [46937, "roblox/render.lua"], [47786, "roblox/parallel.lua"], [48215, "imgui_impl_roblox.lua"], [48716, "imgui_impl_roblox_fonts.lua"], [55119, "imgui_internal.lua"], [59087, "imgui_tables.lua"], [64179, "imgui_widgets.lua"], [76420, "imstb_rectpack.lua"], [77097, "imstb_textedit.lua"], [78639, "imstb_truetype.lua"], [81580, "imstd_minstdio.lua"]] \ No newline at end of file diff --git a/build/ImGui.luau b/build/ImGui.luau index c5e798b..0e3c812 100644 --- a/build/ImGui.luau +++ b/build/ImGui.luau @@ -47684,14 +47684,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 @@ -47764,13 +47766,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() @@ -47807,6 +47811,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 @@ -48030,6 +48036,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