[perf][LOW] uiResolveScreenPixel runs clip-rect compares even when unclipped #50
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Subsystem: UI GLSL shaders
Location:
shaders/ui-shared.glsl:121-129Impact: LOW · Effort: Small
Problem
uiResolveScreenPixelruns four float compares againsthdr.clipRectPxper thread per dispatch even though the default clip is{0,0,1e9,1e9}(the overwhelmingly common case).Proposed fix
Gate the compares behind a "clip enabled" bit in
hdr.flags(set byFillHeaderwhen clipRect != full surface).flagsalready exists and is currently always 0; the branch is push-constant-uniform (no divergence).Note
Runs once per pixel (not per item); negligible next to the inner item loop's SDF math.