[perf][MEDIUM] TransitionImageLayout hardcodes RAY_TRACING stage for all shader reads #54

Closed
opened 2026-06-16 16:51:32 +02:00 by jorijnvdgraaf · 0 comments

Subsystem: Image pipeline (consumed by Font atlas)
Location: interfaces/Crafter.Graphics-ImageVulkan.cppm:102-109
Impact: MEDIUM · Effort: Small · Not hot path (one-time/dirty-gated)

Problem

Every sampled-image shader-read transition uses VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR. The UI font atlas is consumed by compute (VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT), so the upload barrier's dst scope does not even cover the real consumer — arguably a correctness gap, not just lost overlap, unless another barrier/submit boundary covers it.

Proposed fix

Parameterize the consuming stage/access per image; pass the true stage (COMPUTE for the atlas, FRAGMENT or RT for others).

Correctness caveat

Narrowing/correcting the scope changes no layouts or lifetimes. This is the strongest of the image-pipeline findings — it fixes a real scope mismatch, not just a micro-opt.

**Subsystem:** Image pipeline (consumed by Font atlas) **Location:** `interfaces/Crafter.Graphics-ImageVulkan.cppm:102-109` **Impact:** MEDIUM · **Effort:** Small · Not hot path (one-time/dirty-gated) ### Problem Every sampled-image shader-read transition uses `VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR`. The UI font atlas is consumed by **compute** (`VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT`), so the upload barrier's dst scope does not even cover the real consumer — arguably a correctness gap, not just lost overlap, unless another barrier/submit boundary covers it. ### Proposed fix Parameterize the consuming stage/access per image; pass the true stage (COMPUTE for the atlas, FRAGMENT or RT for others). ### Correctness caveat Narrowing/correcting the scope changes no layouts or lifetimes. This is the strongest of the image-pipeline findings — it fixes a real scope mismatch, not just a micro-opt.
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#54
No description provided.