Skip to content

Commit 005ffa4

Browse files
Fix binning regression.
1 parent 1eec802 commit 005ffa4

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

samples/DrawingBackendBenchmark/SkiaSharpBenchmarkBackend.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ public BenchmarkRenderResult Render(ReadOnlySpan<VisualLine> lines, int width, i
3737
using SKPaint paint = new()
3838
{
3939
IsAntialias = true,
40-
Style = SKPaintStyle.Fill,
41-
StrokeCap = SKStrokeCap.Square,
40+
Style = SKPaintStyle.Stroke,
41+
StrokeCap = SKStrokeCap.Butt,
42+
StrokeJoin = SKStrokeJoin.Miter,
4243
};
4344

4445
Stopwatch stopwatch = Stopwatch.StartNew();

src/ImageSharp.Drawing.WebGPU/WebGPUSceneDispatch.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,15 @@ private static uint ShrinkChunkTileHeight(uint currentTileHeight, uint remaining
14581458
ulong usableBytes = Math.Max(bindingLimitFailure.LimitBytes - (bindingLimitFailure.LimitBytes / 8UL), 1UL);
14591459
uint estimatedTileHeight = checked((uint)Math.Max(1UL, (usableBytes * currentTileHeight) / bindingLimitFailure.RequiredBytes));
14601460
uint alignedTileHeight = AlignChunkTileHeight(Math.Min(estimatedTileHeight, remainingTileHeight), remainingTileHeight);
1461-
return alignedTileHeight < currentTileHeight ? alignedTileHeight : Math.Max(1U, currentTileHeight / 2U);
1461+
if (alignedTileHeight < currentTileHeight)
1462+
{
1463+
return alignedTileHeight;
1464+
}
1465+
1466+
// Chunk starts must remain 16-row aligned because coarse indexes the full-scene
1467+
// bin grid from chunk_tile_y_start / N_TILE_Y. A sub-bin start would read the
1468+
// wrong bin headers for that chunk and drop coverage.
1469+
return currentTileHeight > 16U ? (currentTileHeight - 1U) & ~15U : currentTileHeight;
14621470
}
14631471

14641472
/// <summary>

0 commit comments

Comments
 (0)