Vulkan: Remove parameters/members of single-instance classes

There's not a lot of point in passing these around or storing them
(texture cache/state tracker mainly) as there will only ever be a single
instance of the class.

Also adds downcast helpers such as Vulkan::Renderer::GetInstance().
This commit is contained in:
Stenzek
2016-10-22 20:50:36 +10:00
parent ab9f539233
commit b066d51dfa
21 changed files with 336 additions and 303 deletions

View File

@ -18,7 +18,6 @@ class BoundingBox;
class FramebufferManager;
class SwapChain;
class StagingTexture2D;
class StateTracker;
class Texture2D;
class RasterFont;
@ -28,10 +27,11 @@ public:
Renderer(std::unique_ptr<SwapChain> swap_chain);
~Renderer();
static Renderer* GetInstance();
SwapChain* GetSwapChain() const { return m_swap_chain.get(); }
StateTracker* GetStateTracker() const { return m_state_tracker.get(); }
BoundingBox* GetBoundingBox() const { return m_bounding_box.get(); }
bool Initialize(FramebufferManager* framebuffer_mgr);
bool Initialize();
void RenderText(const std::string& pstr, int left, int top, u32 color) override;
u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override;
@ -94,13 +94,11 @@ private:
const TargetRectangle& src_rect, const Texture2D* src_tex, bool linear_filter);
bool ResizeScreenshotBuffer(u32 new_width, u32 new_height);
void DestroyScreenshotResources();
FramebufferManager* m_framebuffer_mgr = nullptr;
VkSemaphore m_image_available_semaphore = VK_NULL_HANDLE;
VkSemaphore m_rendering_finished_semaphore = VK_NULL_HANDLE;
std::unique_ptr<SwapChain> m_swap_chain;
std::unique_ptr<StateTracker> m_state_tracker;
std::unique_ptr<BoundingBox> m_bounding_box;
std::unique_ptr<RasterFont> m_raster_font;