|
|
@ -294,6 +294,10 @@ VkResult create_ui_text_pipeline(VkDevice device, VkRenderPass render_pass, VkDe
|
|
|
|
if(frag_shader == VK_NULL_HANDLE) {
|
|
|
|
if(frag_shader == VK_NULL_HANDLE) {
|
|
|
|
return VK_ERROR_UNKNOWN;
|
|
|
|
return VK_ERROR_UNKNOWN;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: add a compute stage before the shader stages that sets up the draw buffer and commands for the characters based off of strings + positions
|
|
|
|
|
|
|
|
// 1. Reserve a buffer for array of draw command params + CharStruct on the GPU
|
|
|
|
|
|
|
|
// 2. Reserve a buffer for StringStruct
|
|
|
|
VkPipelineShaderStageCreateInfo shader_stages[] = {
|
|
|
|
VkPipelineShaderStageCreateInfo shader_stages[] = {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
|
|
|
|
.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
|
|
|
@ -317,7 +321,7 @@ VkResult create_ui_text_pipeline(VkDevice device, VkRenderPass render_pass, VkDe
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.binding = 1,
|
|
|
|
.binding = 1,
|
|
|
|
.stride = sizeof(Text),
|
|
|
|
.stride = sizeof(Char),
|
|
|
|
.inputRate = VK_VERTEX_INPUT_RATE_INSTANCE,
|
|
|
|
.inputRate = VK_VERTEX_INPUT_RATE_INSTANCE,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -332,25 +336,25 @@ VkResult create_ui_text_pipeline(VkDevice device, VkRenderPass render_pass, VkDe
|
|
|
|
.binding = 1,
|
|
|
|
.binding = 1,
|
|
|
|
.location = 1,
|
|
|
|
.location = 1,
|
|
|
|
.format = VK_FORMAT_R32G32B32_SFLOAT,
|
|
|
|
.format = VK_FORMAT_R32G32B32_SFLOAT,
|
|
|
|
.offset = offsetof(Text, pos),
|
|
|
|
.offset = offsetof(Char, pos),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.binding = 1,
|
|
|
|
.binding = 1,
|
|
|
|
.location = 2,
|
|
|
|
.location = 2,
|
|
|
|
.format = VK_FORMAT_R32G32_SFLOAT,
|
|
|
|
.format = VK_FORMAT_R32G32_SFLOAT,
|
|
|
|
.offset = offsetof(Text, size),
|
|
|
|
.offset = offsetof(Char, size),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.binding = 1,
|
|
|
|
.binding = 1,
|
|
|
|
.location = 3,
|
|
|
|
.location = 3,
|
|
|
|
.format = VK_FORMAT_R32G32B32A32_SFLOAT,
|
|
|
|
.format = VK_FORMAT_R32G32B32A32_SFLOAT,
|
|
|
|
.offset = offsetof(Text, color),
|
|
|
|
.offset = offsetof(Char, color),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.binding = 1,
|
|
|
|
.binding = 1,
|
|
|
|
.location = 4,
|
|
|
|
.location = 4,
|
|
|
|
.format = VK_FORMAT_R32_UINT,
|
|
|
|
.format = VK_FORMAT_R32_UINT,
|
|
|
|
.offset = offsetof(Text, code),
|
|
|
|
.offset = offsetof(Char, code),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|