summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/FramebufferManager.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/FramebufferManager.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/FramebufferManager.h')
-rw-r--r--Source/Core/VideoBackends/Vulkan/FramebufferManager.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/FramebufferManager.h b/Source/Core/VideoBackends/Vulkan/FramebufferManager.h
index a8c5f0fc64..00fd335f49 100644
--- a/Source/Core/VideoBackends/Vulkan/FramebufferManager.h
+++ b/Source/Core/VideoBackends/Vulkan/FramebufferManager.h
@@ -30,6 +30,8 @@ public:
FramebufferManager();
~FramebufferManager();
+ static FramebufferManager* GetInstance();
+
bool Initialize();
VkRenderPass GetEFBLoadRenderPass() const { return m_efb_load_render_pass; }
@@ -69,18 +71,18 @@ public:
// This render pass can be used for other readback operations.
VkRenderPass GetColorCopyForReadbackRenderPass() const { return m_copy_color_render_pass; }
// Resolve color/depth textures to a non-msaa texture, and return it.
- Texture2D* ResolveEFBColorTexture(StateTracker* state_tracker, const VkRect2D& region);
- Texture2D* ResolveEFBDepthTexture(StateTracker* state_tracker, const VkRect2D& region);
+ Texture2D* ResolveEFBColorTexture(const VkRect2D& region);
+ Texture2D* ResolveEFBDepthTexture(const VkRect2D& region);
// Reads a framebuffer value back from the GPU. This may block if the cache is not current.
- u32 PeekEFBColor(StateTracker* state_tracker, u32 x, u32 y);
- float PeekEFBDepth(StateTracker* state_tracker, u32 x, u32 y);
+ u32 PeekEFBColor(u32 x, u32 y);
+ float PeekEFBDepth(u32 x, u32 y);
void InvalidatePeekCache();
// Writes a value to the framebuffer. This will never block, and writes will be batched.
- void PokeEFBColor(StateTracker* state_tracker, u32 x, u32 y, u32 color);
- void PokeEFBDepth(StateTracker* state_tracker, u32 x, u32 y, float depth);
- void FlushEFBPokes(StateTracker* state_tracker);
+ void PokeEFBColor(u32 x, u32 y, u32 color);
+ void PokeEFBDepth(u32 x, u32 y, float depth);
+ void FlushEFBPokes();
private:
struct EFBPokeVertex
@@ -112,14 +114,14 @@ private:
bool CompilePokeShaders();
void DestroyPokeShaders();
- bool PopulateColorReadbackTexture(StateTracker* state_tracker);
- bool PopulateDepthReadbackTexture(StateTracker* state_tracker);
+ bool PopulateColorReadbackTexture();
+ bool PopulateDepthReadbackTexture();
void CreatePokeVertices(std::vector<EFBPokeVertex>* destination_list, u32 x, u32 y, float z,
u32 color);
- void DrawPokeVertices(StateTracker* state_tracker, const EFBPokeVertex* vertices,
- size_t vertex_count, bool write_color, bool write_depth);
+ void DrawPokeVertices(const EFBPokeVertex* vertices, size_t vertex_count, bool write_color,
+ bool write_depth);
VkRenderPass m_efb_load_render_pass = VK_NULL_HANDLE;
VkRenderPass m_efb_clear_render_pass = VK_NULL_HANDLE;