Move most backend functionality to VideoCommon

This commit is contained in:
Stenzek
2019-02-15 11:59:50 +10:00
parent 933f3ba008
commit f039149198
182 changed files with 8334 additions and 15917 deletions

View File

@ -10,13 +10,14 @@
#include "Common/CommonTypes.h"
#include "Common/WindowSystemInfo.h"
#include "VideoBackends/Vulkan/Constants.h"
#include "VideoBackends/Vulkan/Texture2D.h"
#include "VideoCommon/TextureConfig.h"
namespace Vulkan
{
class CommandBufferManager;
class ObjectCache;
class VKTexture;
class VKFramebuffer;
class SwapChain
{
@ -44,19 +45,14 @@ public:
{
return m_swap_chain_images[m_current_swap_chain_image_index].image;
}
Texture2D* GetCurrentTexture() const
VKTexture* GetCurrentTexture() const
{
return m_swap_chain_images[m_current_swap_chain_image_index].texture.get();
}
VkFramebuffer GetCurrentFramebuffer() const
VKFramebuffer* GetCurrentFramebuffer() const
{
return m_swap_chain_images[m_current_swap_chain_image_index].framebuffer;
return m_swap_chain_images[m_current_swap_chain_image_index].framebuffer.get();
}
VkRenderPass GetLoadRenderPass() const { return m_render_pass; }
VkRenderPass GetClearRenderPass() const { return m_clear_render_pass; }
VkSemaphore GetImageAvailableSemaphore() const { return m_image_available_semaphore; }
VkSemaphore GetRenderingFinishedSemaphore() const { return m_rendering_finished_semaphore; }
VkResult AcquireNextImage();
bool RecreateSurface(void* native_handle);
@ -67,9 +63,6 @@ public:
bool SetVSync(bool enabled);
private:
bool CreateSemaphores();
void DestroySemaphores();
bool SelectSurfaceFormat();
bool SelectPresentMode();
@ -84,8 +77,8 @@ private:
struct SwapChainImage
{
VkImage image;
std::unique_ptr<Texture2D> texture;
VkFramebuffer framebuffer;
std::unique_ptr<VKTexture> texture;
std::unique_ptr<VKFramebuffer> framebuffer;
};
WindowSystemInfo m_wsi;
@ -99,12 +92,6 @@ private:
std::vector<SwapChainImage> m_swap_chain_images;
u32 m_current_swap_chain_image_index = 0;
VkSemaphore m_image_available_semaphore = VK_NULL_HANDLE;
VkSemaphore m_rendering_finished_semaphore = VK_NULL_HANDLE;
VkRenderPass m_render_pass = VK_NULL_HANDLE;
VkRenderPass m_clear_render_pass = VK_NULL_HANDLE;
u32 m_width = 0;
u32 m_height = 0;
u32 m_layers = 0;