summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/TextureCache.h
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2016-10-22 20:50:36 +1000
committerStenzek <stenzek@gmail.com>2016-11-03 22:01:54 +1000
commitb066d51dfa03b960028fc6f88c8de133eb6db1da (patch)
treef35267e1877f00694e726e6939a14311f7df35d0 /Source/Core/VideoBackends/Vulkan/TextureCache.h
parentab9f539233172b9266745ec266d345966e8c6207 (diff)
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().
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/TextureCache.h')
-rw-r--r--Source/Core/VideoBackends/Vulkan/TextureCache.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/TextureCache.h b/Source/Core/VideoBackends/Vulkan/TextureCache.h
index 18c8bd6020..1de1bbfc10 100644
--- a/Source/Core/VideoBackends/Vulkan/TextureCache.h
+++ b/Source/Core/VideoBackends/Vulkan/TextureCache.h
@@ -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;