diff options
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/ObjectCache.h')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/ObjectCache.h | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/ObjectCache.h b/Source/Core/VideoBackends/Vulkan/ObjectCache.h index 76ed886ecd..546d1439a5 100644 --- a/Source/Core/VideoBackends/Vulkan/ObjectCache.h +++ b/Source/Core/VideoBackends/Vulkan/ObjectCache.h @@ -62,30 +62,15 @@ 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. - // - Texture Conversion - // - Same as push constant, plus a single texel buffer accessible from PS. - // - // 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_LAYOUT 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]; } - 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; } - VkPipelineLayout GetTextureConversionPipelineLayout() const + // Pipeline layout accessor. Used to fill in required field in PipelineInfo. + VkPipelineLayout GetPipelineLayout(PIPELINE_LAYOUT layout) const { - return m_texture_conversion_pipeline_layout; + return m_pipeline_layouts[layout]; } // Shared utility shader resources VertexFormat* GetUtilityShaderVertexFormat() const @@ -164,11 +149,7 @@ private: void DestroySamplers(); std::array<VkDescriptorSetLayout, NUM_DESCRIPTOR_SET_LAYOUTS> 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; - VkPipelineLayout m_texture_conversion_pipeline_layout = VK_NULL_HANDLE; + 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; |
