Skip to content

Commit b47a539

Browse files
Remove debug logging
1 parent 108cac3 commit b47a539

2 files changed

Lines changed: 0 additions & 13 deletions

File tree

src/ImageSharp.Drawing.WebGPU/WebGPUSceneDispatch.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,13 @@ public static bool TryCreateStagedScene<TPixel>(
167167

168168
try
169169
{
170-
Stopwatch sw = Stopwatch.StartNew();
171170
if (!WebGPUSceneEncoder.TryEncode(scene, flushContext.TargetBounds, flushContext.MemoryAllocator, out WebGPUEncodedScene createdScene, out error))
172171
{
173172
flushContext.Dispose();
174173
stagedScene = default;
175174
return false;
176175
}
177176

178-
double encodeMs = sw.Elapsed.TotalMilliseconds;
179-
sw.Restart();
180-
181177
encodedScene = createdScene;
182178
WebGPUSceneConfig config = WebGPUSceneConfig.Create(encodedScene, bumpSizes);
183179
uint baseColor = 0U;
@@ -211,9 +207,6 @@ public static bool TryCreateStagedScene<TPixel>(
211207
return false;
212208
}
213209

214-
double resourceMs = sw.Elapsed.TotalMilliseconds;
215-
File.AppendAllText("bump_debug.log", $"[TIMING] encode={encodeMs:0.000}ms resources={resourceMs:0.000}ms fills={encodedScene.FillCount} paths={encodedScene.PathCount} lines={encodedScene.LineCount}\n");
216-
217210
stagedScene = new WebGPUStagedScene(flushContext, encodedScene, config, resources, segmentChunkingRequired ? bindingLimitFailure : BindingLimitFailure.None);
218211
error = null;
219212
return true;
@@ -916,8 +909,6 @@ public static unsafe bool TryRenderStagedScene(
916909
{
917910
requiresGrowth = true;
918911
grownBumpSizes = GrowBumpSizes(stagedScene.Config.BumpSizes, in bumpAllocators);
919-
WebGPUSceneBumpSizes cfg = stagedScene.Config.BumpSizes;
920-
File.AppendAllText("bump_debug.log", $"[BUMP OVERFLOW] failed={bumpAllocators.Failed:X} | had: lines={cfg.Lines} bin={cfg.Binning} tiles={cfg.PathTiles} segc={cfg.SegCounts} segs={cfg.Segments} blend={cfg.BlendSpill} ptcl={cfg.Ptcl} | gpu: lines={bumpAllocators.Lines} bin={bumpAllocators.Binning} tiles={bumpAllocators.Tile} segc={bumpAllocators.SegCounts} segs={bumpAllocators.Segments} blend={bumpAllocators.BlendSpill} ptcl={bumpAllocators.Ptcl} | grown: lines={grownBumpSizes.Lines} bin={grownBumpSizes.Binning} tiles={grownBumpSizes.PathTiles} segc={grownBumpSizes.SegCounts} segs={grownBumpSizes.Segments} blend={grownBumpSizes.BlendSpill} ptcl={grownBumpSizes.Ptcl}\n");
921912
error = "The staged WebGPU scene needs larger scratch buffers and will be retried.";
922913
return false;
923914
}
@@ -1025,13 +1016,11 @@ private static unsafe bool TryRenderSegmentChunkedStagedScene(
10251016
WebGPUSceneConfig chunkConfig = WebGPUSceneConfig.Create(encodedScene, chunkBumpSize, chunkWindow);
10261017
if (!TryValidateBindingSizes(encodedScene, chunkConfig, maxStorageBufferBindingSize, out BindingLimitFailure bindingLimitFailure, out error))
10271018
{
1028-
File.AppendAllText("bump_debug.log", $"[CHUNK VALIDATION FAIL] buffer={bindingLimitFailure.Buffer} required={bindingLimitFailure.RequiredBytes} limit={bindingLimitFailure.LimitBytes} chunkTileH={requestedTileHeight} totalTileH={totalTileHeight} tiles={chunkBumpSize.PathTiles} segc={chunkBumpSize.SegCounts} segs={chunkBumpSize.Segments} srcTiles={stagedScene.Config.BumpSizes.PathTiles} srcSegc={stagedScene.Config.BumpSizes.SegCounts}\n");
10291019
if (IsChunkableBindingFailure(bindingLimitFailure.Buffer))
10301020
{
10311021
uint smallerTileHeight = ShrinkChunkTileHeight(requestedTileHeight, remainingTileHeight, bindingLimitFailure);
10321022
if (smallerTileHeight >= requestedTileHeight)
10331023
{
1034-
File.AppendAllText("bump_debug.log", $"[CHUNK SHRINK STUCK] smallerH={smallerTileHeight} requestedH={requestedTileHeight}\n");
10351024
return false;
10361025
}
10371026

src/ImageSharp.Drawing.WebGPU/WebGPUSceneResources.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ public static bool TryCreate<TPixel>(
6464
// Reuse arena buffers if all capacities fit this scene.
6565
if (arena is not null && arena.CanReuse(flushContext, config.BufferSizes, infoBinDataByteLength, sceneByteLength))
6666
{
67-
System.IO.File.AppendAllText("bump_debug.log", "[RESOURCE ARENA HIT]\n");
68-
6967
// Upload new scene data and header into the existing arena buffers.
7068
ReadOnlySpan<uint> sceneData = scene.SceneData.Span;
7169
fixed (uint* sceneDataPtr = sceneData)

0 commit comments

Comments
 (0)