int Vulkan_Render(float color)
{
VkResult res;
//vkDeviceWaitIdle(_VkSystem.device);
vkWaitForFences(_VkSystem.device, 1, &_VkSystem.fence, 1, -1);
vkResetFences(_VkSystem.device, 1, &_VkSystem.fence);
res = vkAcquireNextImageKHR(_VkSystem.device, _VkSystem.swapchainKHR, -1, _VkSystem.semaphoreNextImage, VK_NULL_HANDLE, &_VkSystem.imageIndex);
VkCommandBufferBeginInfo beginInfo = {};
beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
// Begin CommandBuffer Recording
vkBeginCommandBuffer(_VkSystem.commandBuffer, &beginInfo);
// Begin RenderPass
BeginRenderPass(_VkSystem.renderPass, _VkSystem.frameBuffers[_VkSystem.imageIndex].frameBuffer,
_VkSystem.commandBuffer, color, color, color);
//VkGraphicsPipelineCreateInfo pipelineInfo = {};
//pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
//pipelineInfo.renderPass = _VkSystem.renderPass;
//pipelineInfo.
//vkCreateGraphicsPipelines(device,0,1,)
// End RenderPass
vkCmdEndRenderPass(_VkSystem.commandBuffer);
// End CommandBuffer Recording
res = vkEndCommandBuffer(_VkSystem.commandBuffer);
if (res != VK_SUCCESS)
return 1;
if (SubmitToQueue(_VkSystem.queue.queue, _VkSystem.commandBuffer, _VkSystem.fence,
_VkSystem.semaphoreNextImage, _VkSystem.queue.semaphoreSubmit) != VK_SUCCESS)
return 1;
VkPresentInfoKHR presentInfo = {};
presentInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
presentInfo.pSwapchains = &_VkSystem.swapchainKHR;
presentInfo.swapchainCount = 1;
presentInfo.pWaitSemaphores = &_VkSystem.queue.semaphoreSubmit;
presentInfo.waitSemaphoreCount = 1;
presentInfo.pImageIndices = &_VkSystem.imageIndex;
res = vkQueuePresentKHR(_VkSystem.queue.queue, &presentInfo);
if (res != VK_SUCCESS)
return 1;
//vkDestroySemaphore(_VkSystem.device, semaphore, 0);
}