diff options
| author | Stenzek <stenzek@users.noreply.github.com> | 2016-12-05 12:15:38 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-05 12:15:38 +1000 |
| commit | 15e2133ce706fe8cd5613c81a8866abe03960e3b (patch) | |
| tree | 56d578484881f78ec684f50804c7348f00bec1bb /Source/Core/VideoBackends/Vulkan/ObjectCache.h | |
| parent | d1c89db8c809a89d5576dc9ea524629cfc4d29a6 (diff) | |
| parent | 9736198c3b2552e51dd98445c0439dff759e08af (diff) | |
Merge pull request #4462 from stenzek/vulkan-faster-xfb
Vulkan: Cleanup/refactoring, faster RealXFB
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/ObjectCache.h')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/ObjectCache.h | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/ObjectCache.h b/Source/Core/VideoBackends/Vulkan/ObjectCache.h index 26593d139d..546d1439a5 100644 --- a/Source/Core/VideoBackends/Vulkan/ObjectCache.h +++ b/Source/Core/VideoBackends/Vulkan/ObjectCache.h @@ -62,25 +62,16 @@ public: ObjectCache(); ~ObjectCache(); - // We have four shared pipeline layouts: - // - Standard - // - Per-stage UBO (VS/GS/PS, VS constants accessible from PS) - // - 8 combined image samplers (accessible from PS) - // - BBox Enabled - // - Same as standard, plus a single SSBO accessible from PS - // - Push Constant - // - Same as standard, plus 128 bytes of push constants, accessible from all stages. - // - // All three pipeline layouts use the same descriptor set layouts, but the final descriptor set - // (SSBO) is only required when using the BBox Enabled pipeline layout. - // - VkDescriptorSetLayout GetDescriptorSetLayout(DESCRIPTOR_SET set) const + // Descriptor set layout accessor. Used for allocating descriptor sets. + VkDescriptorSetLayout GetDescriptorSetLayout(DESCRIPTOR_SET_LAYOUT layout) const { - return m_descriptor_set_layouts[set]; + return m_descriptor_set_layouts[layout]; + } + // Pipeline layout accessor. Used to fill in required field in PipelineInfo. + VkPipelineLayout GetPipelineLayout(PIPELINE_LAYOUT layout) const + { + return m_pipeline_layouts[layout]; } - VkPipelineLayout GetStandardPipelineLayout() const { return m_standard_pipeline_layout; } - VkPipelineLayout GetBBoxPipelineLayout() const { return m_bbox_pipeline_layout; } - VkPipelineLayout GetPushConstantPipelineLayout() const { return m_push_constant_pipeline_layout; } // Shared utility shader resources VertexFormat* GetUtilityShaderVertexFormat() const { @@ -157,11 +148,8 @@ private: void DestroySharedShaders(); void DestroySamplers(); - std::array<VkDescriptorSetLayout, NUM_DESCRIPTOR_SETS> m_descriptor_set_layouts = {}; - - VkPipelineLayout m_standard_pipeline_layout = VK_NULL_HANDLE; - VkPipelineLayout m_bbox_pipeline_layout = VK_NULL_HANDLE; - VkPipelineLayout m_push_constant_pipeline_layout = VK_NULL_HANDLE; + std::array<VkDescriptorSetLayout, NUM_DESCRIPTOR_SET_LAYOUTS> m_descriptor_set_layouts = {}; + std::array<VkPipelineLayout, NUM_PIPELINE_LAYOUTS> m_pipeline_layouts = {}; std::unique_ptr<VertexFormat> m_utility_shader_vertex_format; std::unique_ptr<StreamBuffer> m_utility_shader_vertex_buffer; |
