Skip to content

Commit b9630a5

Browse files
committed
VULKAN: Fix SDR font pipeline topology (fixes HDR font artifacts)
The SDR font pipeline introduced in 8fa8418 was created with VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP instead of TRIANGLE_LIST. The font and alpha_blend pipelines require TRIANGLE_LIST topology for indexed quad rendering (indices [0,1,2,2,1,3] per quad). The initial topology is set to TRIANGLE_LIST at line 3321, and the original font pipeline at line 3451 inherits it correctly. However, the SDR pipeline creation block runs after the menu shader loop (lines 3514-3646), which sets input_assembly.topology to TRIANGLE_STRIP in its last iteration (i=11, topology = i&1 = STRIP). The SDR font pipeline at line 3678 inherited this stale STRIP topology. With TRIANGLE_STRIP, the indexed [0,1,2,2,1,3] pattern produces degenerate triangles and incorrect winding, causing subtle glyph positioning artifacts visible as ~1px character shifts in the Ozone menu under Vulkan HDR. The effect was most noticeable on characters with vertical strokes ('l', 'n', 'd') and punctuation. Fix: reset input_assembly.topology to VK_PRIMITIVE_TOPOLOGY_ TRIANGLE_LIST before creating the SDR font and alpha_blend pipelines. Only affects HDR builds with VK_CTX_FLAG_HDR_SUPPORT set. Non-HDR path is unchanged.
1 parent 9efc73f commit b9630a5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

gfx/drivers/vulkan.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,6 +3656,11 @@ static void vulkan_init_pipelines(vk_t *vk)
36563656
{
36573657
pipe.renderPass = vk->sdr_render_pass;
36583658

3659+
/* Reset topology to TRIANGLE_LIST for the font and
3660+
* alpha_blend pipelines. The preceding menu shader loop
3661+
* leaves it at TRIANGLE_STRIP. */
3662+
input_assembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
3663+
36593664
/* SDR font pipeline */
36603665
module_info.codeSize = sizeof(alpha_blend_vert);
36613666
module_info.pCode = alpha_blend_vert;

0 commit comments

Comments
 (0)