diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-06-12 08:51:08 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-06-12 08:51:08 -0400 |
| commit | 61d024686403b7be8d6cbd3cd9c5aeaf39b445af (patch) | |
| tree | 0c3a6e55e3ea44202df56c482a5cecf09da954b4 /src/window.cpp | |
| parent | 0f89d12e747b380b35143815a2c8e87c6ee752d4 (diff) | |
pke: move ui colors to instance buffer
Diffstat (limited to 'src/window.cpp')
| -rw-r--r-- | src/window.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/window.cpp b/src/window.cpp index 1211476..69b06ab 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -253,7 +253,7 @@ void PKVK_BeginBuffer(unsigned int family_index, VkDeviceSize requestedMemorySiz if (requestedMemorySize == 0) return; - VkBufferCreateInfo transferBufferCI; + VkBufferCreateInfo transferBufferCI{}; transferBufferCI.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; transferBufferCI.pNext = nullptr; transferBufferCI.flags = 0; @@ -305,7 +305,7 @@ void pkvk_buffer_create(pkvk_buffer_create_data *data, pkvk_buffer_create_data_o * buffer setup */ VkBuffer tmpBuffer; - VkBufferCreateInfo bufferCI; + VkBufferCreateInfo bufferCI{}; bufferCI.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; bufferCI.pNext = nullptr; bufferCI.flags = {}; @@ -2107,7 +2107,7 @@ void CreateGraphicsPipelines() { offset = 0; const long vertexBindingCount_ui_base = 3; VkVertexInputBindingDescription vertInputBD_ui_base[vertexBindingCount_ui_base]; - const long vertexAttrDescCount_ui_base = 8; + const long vertexAttrDescCount_ui_base = 10; VkVertexInputAttributeDescription vertAttrDesc_ui_base[vertexAttrDescCount_ui_base]; VkPipelineVertexInputStateCreateInfo vkPipelineVertexInputStateCreateInfo_ui_base{vkPipelineVertexInputStateCreateInfo_txtr}; { @@ -2127,6 +2127,8 @@ void CreateGraphicsPipelines() { vertInputBD_ui_base[index].binding = index; vertInputBD_ui_base[index].stride = 0 + sizeof(glm::mat4) // pos_scale + + sizeof(glm::vec4) // in_border_color + + sizeof(glm::vec4) // in_background_color + sizeof(glm::vec2) // px_scale + sizeof(float) // depth + (sizeof(float) * 1) // padding @@ -2160,6 +2162,20 @@ void CreateGraphicsPipelines() { index += 1; } + // instance - in_border_color + vertAttrDesc_ui_base[index].binding = 2; + vertAttrDesc_ui_base[index].format = VK_FORMAT_R32G32B32A32_SFLOAT; + vertAttrDesc_ui_base[index].offset = offset; + offset += sizeof(glm::vec4); + index += 1; + + // instance - in_background_color + vertAttrDesc_ui_base[index].binding = 2; + vertAttrDesc_ui_base[index].format = VK_FORMAT_R32G32B32A32_SFLOAT; + vertAttrDesc_ui_base[index].offset = offset; + offset += sizeof(glm::vec4); + index += 1; + // instance - in_sprite_region_min vertAttrDesc_ui_base[index].binding = 2; vertAttrDesc_ui_base[index].format = VK_FORMAT_R32G32_SFLOAT; |
