libretro: Vulkan renderer support

This commit is contained in:
Connor McLaughlin
2020-07-04 20:06:04 +10:00
parent 218f6721d3
commit b9ffca1ddf
16 changed files with 431 additions and 36 deletions

View File

@ -266,6 +266,11 @@ bool VulkanHostDisplay::HasRenderSurface() const
return static_cast<bool>(m_swap_chain);
}
VkRenderPass VulkanHostDisplay::GetRenderPassForDisplay() const
{
return m_swap_chain->GetClearRenderPass();
}
bool VulkanHostDisplay::CreateResources()
{
static constexpr char fullscreen_quad_vertex_shader[] = R"(
@ -348,7 +353,7 @@ void main()
gpbuilder.SetNoBlendingState();
gpbuilder.SetDynamicViewportAndScissorState();
gpbuilder.SetPipelineLayout(m_pipeline_layout);
gpbuilder.SetRenderPass(m_swap_chain->GetClearRenderPass(), 0);
gpbuilder.SetRenderPass(GetRenderPassForDisplay(), 0);
m_display_pipeline = gpbuilder.Create(device, pipeline_cache, false);
if (m_display_pipeline == VK_NULL_HANDLE)

View File

@ -60,6 +60,9 @@ protected:
float src_rect_height;
};
// Can be overridden by frontends.
virtual VkRenderPass GetRenderPassForDisplay() const;
virtual bool CreateResources();
virtual void DestroyResources();