|
|
|
@ -197,6 +197,25 @@ VkResult render_thread(GLFWwindow* window, RenderContext* render_context) {
|
|
|
|
|
|
|
|
|
|
vmaUnmapMemory(render_context->allocator, text_memory);
|
|
|
|
|
|
|
|
|
|
VkBuffer draw_buffer;
|
|
|
|
|
VmaAllocation draw_memory;
|
|
|
|
|
|
|
|
|
|
VkBufferCreateInfo draw_buffer_info = {
|
|
|
|
|
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
|
|
|
|
.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT,
|
|
|
|
|
.size = sizeof(DrawCommand),
|
|
|
|
|
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
VmaAllocationCreateInfo draw_memory_info = {
|
|
|
|
|
.usage = VMA_MEMORY_USAGE_GPU_ONLY,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
result = vmaCreateBuffer(render_context->allocator, &draw_buffer_info, &draw_memory_info, &draw_buffer, &draw_memory, NULL);
|
|
|
|
|
if(result != VK_SUCCESS) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VkBuffer text_pointer_buffer;
|
|
|
|
|
VmaAllocation text_pointer_memory;
|
|
|
|
|
|
|
|
|
@ -227,6 +246,11 @@ VkResult render_thread(GLFWwindow* window, RenderContext* render_context) {
|
|
|
|
|
.buffer = text_buffer,
|
|
|
|
|
};
|
|
|
|
|
pointers->characters = vkGetBufferDeviceAddress(render_context->device, &test_address_info);
|
|
|
|
|
VkBufferDeviceAddressInfo draw_address_info = {
|
|
|
|
|
.sType = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO,
|
|
|
|
|
.buffer = draw_buffer,
|
|
|
|
|
};
|
|
|
|
|
pointers->draw = vkGetBufferDeviceAddress(render_context->device, &draw_address_info);
|
|
|
|
|
vmaUnmapMemory(render_context->allocator, text_pointer_memory);
|
|
|
|
|
|
|
|
|
|
VkBufferDeviceAddressInfo pointers_address_info = {
|
|
|
|
|