diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-04-08 17:29:25 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-04-08 17:29:25 -0400 |
| commit | 63ce7559ce34505eec576fcf43c7cb62a814f31a (patch) | |
| tree | ddca93af438f4336fa72eac1c60cc2f9252a75ef /src/window.cpp | |
| parent | 8c0dbef6b21a0331916ae96ea5cd3b5613e50b6b (diff) | |
pke: add bounding region to glyphs for ui overdraw
Diffstat (limited to 'src/window.cpp')
| -rw-r--r-- | src/window.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/window.cpp b/src/window.cpp index 85ea8d3..4132577 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2147,7 +2147,7 @@ void CreateGraphicsPipelines() { long offset = 0; const long vertexBindingCount_glyph = 4; VkVertexInputBindingDescription vertInputBD_glyph[vertexBindingCount_glyph]; - const long vertexAttrDescCount_glyph = 12; + const long vertexAttrDescCount_glyph = 14; VkVertexInputAttributeDescription vertAttrDesc_glyph[vertexAttrDescCount_glyph]; VkPipelineVertexInputStateCreateInfo vkPipelineVertexInputStateCreateInfo_glyph{vkPipelineVertexInputStateCreateInfo_txtr}; { @@ -2172,12 +2172,14 @@ void CreateGraphicsPipelines() { // instance - total vertInputBD_glyph[index].binding = index; vertInputBD_glyph[index].stride = 0 - + sizeof(glm::mat4) - + sizeof(glm::vec4) - + sizeof(glm::vec4) - + sizeof(glm::vec2) - + sizeof(glm::vec2) - + sizeof(float) + + sizeof(glm::vec4) * 4 // mat4 pos_scale + + sizeof(glm::vec4) // in_fg_color + + sizeof(glm::vec4) // in_bg_color + + sizeof(glm::vec2) // in_sprite_region_min + + sizeof(glm::vec2) // in_sprite_region_max + + sizeof(glm::vec2) // in_bounding_region_min + + sizeof(glm::vec2) // in_bounding_region_max + + sizeof(float) // in_width + (sizeof(float) * 3) // padding + 0; vertInputBD_glyph[index].inputRate = VK_VERTEX_INPUT_RATE_INSTANCE; @@ -2243,6 +2245,20 @@ void CreateGraphicsPipelines() { offset += sizeof(glm::vec2); index += 1; + // instance - in_bounding_region_min + vertAttrDesc_glyph[index].binding = 3; + vertAttrDesc_glyph[index].format = VK_FORMAT_R32G32_SFLOAT; + vertAttrDesc_glyph[index].offset = offset; + offset += sizeof(glm::vec2); + index += 1; + + // instance - in_bounding_region_max + vertAttrDesc_glyph[index].binding = 3; + vertAttrDesc_glyph[index].format = VK_FORMAT_R32G32_SFLOAT; + vertAttrDesc_glyph[index].offset = offset; + offset += sizeof(glm::vec2); + index += 1; + // instance - in_width vertAttrDesc_glyph[index].binding = 3; vertAttrDesc_glyph[index].format = VK_FORMAT_R32_SFLOAT; |
