diff options
| -rw-r--r-- | assets/shaders/glyph.frag | 1 | ||||
| -rw-r--r-- | src/font.cpp | 16 | ||||
| -rw-r--r-- | src/window.cpp | 5 |
3 files changed, 14 insertions, 8 deletions
diff --git a/assets/shaders/glyph.frag b/assets/shaders/glyph.frag index 5387f4e..867c58c 100644 --- a/assets/shaders/glyph.frag +++ b/assets/shaders/glyph.frag @@ -19,5 +19,4 @@ void main() { float screenPxDistance = in_width * (sd - 0.5); float opacity = clamp(screenPxDistance + 0.5, 0.0, 1.0); out_color = mix(in_bg_color, in_fg_color, opacity); - out_color = msd; } diff --git a/src/font.cpp b/src/font.cpp index c966636..2365897 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -25,14 +25,20 @@ struct FontTypeData { } ftd; struct FontInstanceBufferItem { - glm::vec4 bg_color; glm::vec4 fg_color; + glm::vec4 bg_color; glm::vec2 sprite_region_min; glm::vec2 sprite_region_max; float width; }; -const VkDeviceSize instance_buffer_item_size = (sizeof(glm::vec4) * 2) + (sizeof(glm::vec2) * 2) + sizeof(float); +const VkDeviceSize instance_buffer_item_size = 0 + + sizeof(glm::vec4) + + sizeof(glm::vec4) + + sizeof(glm::vec2) + + sizeof(glm::vec2) + + sizeof(float) + + 0; // BucketContainer<FontType, TextRenderHandle, 2> bktFont; @@ -967,8 +973,10 @@ FontRender FontType_AddStringRender(FontTypeIndex idx_ft, pk_cstr cstr) { submitInfo.pCommandBuffers = &tmpBufferDetails.cmdBuffer; submitInfo.signalSemaphoreCount = 0; submitInfo.pSignalSemaphores = nullptr; - vkQueueSubmit(tmpBufferDetails.queue, 1, &submitInfo, nullptr); - vkQueueWaitIdle(tmpBufferDetails.queue); + vkResult = vkQueueSubmit(tmpBufferDetails.queue, 1, &submitInfo, nullptr); + assert(vkResult == VK_SUCCESS); + vkResult = vkQueueWaitIdle(tmpBufferDetails.queue); + assert(vkResult == VK_SUCCESS); } PKVK_EndBuffer(tmpBufferDetails); diff --git a/src/window.cpp b/src/window.cpp index ecaea14..5a3e2cb 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1806,14 +1806,13 @@ void CreateGraphicsPipelines() { // vertex - in_atlas_size vertAttrDesc_glyph[index].binding = 2; vertAttrDesc_glyph[index].format = VK_FORMAT_R32G32_SFLOAT; - vertAttrDesc_glyph[index].offset = offset; - offset += sizeof(glm::vec2); + vertAttrDesc_glyph[index].offset = 0; index += 1; // instance - in_fg_color vertAttrDesc_glyph[index].binding = 3; vertAttrDesc_glyph[index].format = VK_FORMAT_R32G32B32A32_SFLOAT; - vertAttrDesc_glyph[index].offset = 0; + vertAttrDesc_glyph[index].offset = offset; offset += sizeof(glm::vec4); index += 1; |
