diff options
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/ObjectCache.h')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/ObjectCache.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/ObjectCache.h b/Source/Core/VideoBackends/Vulkan/ObjectCache.h index b991b8a3b8..26593d139d 100644 --- a/Source/Core/VideoBackends/Vulkan/ObjectCache.h +++ b/Source/Core/VideoBackends/Vulkan/ObjectCache.h @@ -111,12 +111,17 @@ public: // Perform at startup, create descriptor layouts, compiles all static shaders. bool Initialize(); - // Find a pipeline by the specified description, if not found, attempts to create it + // Creates a pipeline for the specified description. The resulting pipeline, if successful + // is not stored anywhere, this is left up to the caller. + VkPipeline CreatePipeline(const PipelineInfo& info); + + // Find a pipeline by the specified description, if not found, attempts to create it. VkPipeline GetPipeline(const PipelineInfo& info); - // Wipes out the pipeline cache, use when MSAA modes change, for example - // Also destroys the data that would be stored in the disk cache. - void ClearPipelineCache(); + // Find a pipeline by the specified description, if not found, attempts to create it. If this + // resulted in a pipeline being created, the second field of the return value will be false, + // otherwise for a cache hit it will be true. + std::pair<VkPipeline, bool> GetPipelineWithCacheResult(const PipelineInfo& info); // Saves the pipeline cache to disk. Call when shutting down. void SavePipelineCache(); @@ -133,8 +138,12 @@ public: VkShaderModule GetPassthroughVertexShader() const { return m_passthrough_vertex_shader; } VkShaderModule GetScreenQuadGeometryShader() const { return m_screen_quad_geometry_shader; } VkShaderModule GetPassthroughGeometryShader() const { return m_passthrough_geometry_shader; } + // Gets the filename of the specified type of cache object (e.g. vertex shader, pipeline). + std::string GetDiskCacheFileName(const char* type); + private: bool CreatePipelineCache(bool load_from_disk); + bool ValidatePipelineCache(const u8* data, size_t data_length); void DestroyPipelineCache(); void LoadShaderCaches(); void DestroyShaderCaches(); @@ -148,8 +157,6 @@ private: void DestroySharedShaders(); void DestroySamplers(); - std::string GetDiskCacheFileName(const char* type); - std::array<VkDescriptorSetLayout, NUM_DESCRIPTOR_SETS> m_descriptor_set_layouts = {}; VkPipelineLayout m_standard_pipeline_layout = VK_NULL_HANDLE; |
