vk: implement DrawPicScaledCol for crosshair colouring - #64
Conversation
|
@devnexen could you please review? It's looks as duplication of your change yquake2/yquake2remaster#126 |
| { | ||
| vk_drawTintedTexQuadPipeline[i].depthTestEnable = VK_FALSE; | ||
| QVk_CreatePipeline(samplerUboDsLayouts, 2, &vertInfoRG_RG, &vk_drawTintedTexQuadPipeline[i], &vk_renderpasses[i], shaders, 2); | ||
| QVk_DebugSetObjectName((uint64_t)vk_drawTintedTexQuadPipeline[i].layout, VK_OBJECT_TYPE_PIPELINE_LAYOUT, |
There was a problem hiding this comment.
QVk_DrawColoredTexRect pushes 24 bytes at offset 68 (gamma + 8 pad + vec3), whereas QVk_DrawTexRect only pushes 4 at the same offset. if QVk_CreatePipeline sizes the
fragment push range from a fixed value rather than reflecting the SPIR-V, this layout is too small and the later vkCmdPushConstants either fails validation or hits UB
on drivers that enforce ranges. can you confirm the range covers [68, 92) here, ideally with VK_LAYER_KHRONOS_validation on while cycling crosshair_color_r/g/b?
There was a problem hiding this comment.
the range is fine. QVk_CreatePipeline declares the fragment range as offset=68, size=11*sizeof(float)=44, covering [68, 112), which is a strict superset of the [68, 92) that QVk_DrawColoredTexRect
writes (24 bytes: 4 gamma + 8 pad + 12 vec3). Validation won't fire on the range check
| vkCmdPushConstants(vk_activeCmdbuffer, vk_drawTintedTexQuadPipeline[vk_state.current_renderpass].layout, | ||
| VK_SHADER_STAGE_FRAGMENT_BIT, VK_BASIC_FRAG_PC_OFFSET, sizeof(fragPC), &fragPC); | ||
|
|
||
| vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, |
There was a problem hiding this comment.
this is the call that depends on the tinted pipeline's fragment push range covering [68, 92) — see comment on the pipeline creation site.
|
@devnexen Could you please approve and I will merge if no objection? |
|
Thank you, merged! |
Related to yquake2/yquake2#1255