[perf] Unconditional destination imageLoad/imageStore before early-out (ui-quads.comp.glsl) #127

Closed
opened 2026-06-17 21:18:55 +02:00 by jorijnvdgraaf · 0 comments

Found by an adversarially-verified performance audit (confirmed real after a skeptic pass).

Location: shaders/ui-quads.comp.glsl:32-35
Severity: low · Effort: trivial · Category: gpu

Problem

The standalone per-category shaders read-modify-write the destination pixel even when no item touches the tile (sparse UI). The fused kernel correctly amortizes its single load/store.

Fix

Defer imageLoad to the first surviving blend (a loaded flag) and skip imageStore unless touched. Standalone Dispatch* path only.

Found by an adversarially-verified performance audit (confirmed real after a skeptic pass). **Location:** `shaders/ui-quads.comp.glsl:32-35` **Severity:** low · **Effort:** trivial · **Category:** gpu ### Problem The standalone per-category shaders read-modify-write the destination pixel even when no item touches the tile (sparse UI). The fused kernel correctly amortizes its single load/store. ### Fix Defer `imageLoad` to the first surviving blend (a `loaded` flag) and skip `imageStore` unless `touched`. Standalone `Dispatch*` path only.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Catcrafts/Crafter.Graphics#127
No description provided.