mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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:
@ -23,7 +23,9 @@ public:
|
||||
TextureCache();
|
||||
~TextureCache();
|
||||
|
||||
bool Initialize(StateTracker* state_tracker);
|
||||
static TextureCache* GetInstance();
|
||||
|
||||
bool Initialize();
|
||||
|
||||
bool CompileShaders() override;
|
||||
void DeleteShaders() override;
|
||||
@ -37,8 +39,8 @@ public:
|
||||
private:
|
||||
struct TCacheEntry : TCacheEntryBase
|
||||
{
|
||||
TCacheEntry(const TCacheEntryConfig& config_, TextureCache* parent,
|
||||
std::unique_ptr<Texture2D> texture, VkFramebuffer framebuffer);
|
||||
TCacheEntry(const TCacheEntryConfig& config_, std::unique_ptr<Texture2D> texture,
|
||||
VkFramebuffer framebuffer);
|
||||
~TCacheEntry();
|
||||
|
||||
Texture2D* GetTexture() const { return m_texture.get(); }
|
||||
@ -55,7 +57,6 @@ private:
|
||||
bool Save(const std::string& filename, unsigned int level) override;
|
||||
|
||||
private:
|
||||
TextureCache* m_parent;
|
||||
std::unique_ptr<Texture2D> m_texture;
|
||||
|
||||
// If we're an EFB copy, framebuffer for drawing into.
|
||||
@ -68,8 +69,6 @@ private:
|
||||
|
||||
VkRenderPass GetRenderPassForTextureUpdate(const Texture2D* texture) const;
|
||||
|
||||
StateTracker* m_state_tracker = nullptr;
|
||||
|
||||
VkRenderPass m_initialize_render_pass = VK_NULL_HANDLE;
|
||||
VkRenderPass m_update_render_pass = VK_NULL_HANDLE;
|
||||
|
||||
|
Reference in New Issue
Block a user