PipelineCache.h 824 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <AnKi/Gr/Vulkan/Common.h>
  7. namespace anki {
  8. // Forward
  9. class ConfigSet;
  10. /// @addtogroup vulkan
  11. /// @{
  12. /// On disk pipeline cache.
  13. class PipelineCache
  14. {
  15. public:
  16. VkPipelineCache m_cacheHandle = VK_NULL_HANDLE;
  17. ANKI_USE_RESULT Error init(VkDevice dev, VkPhysicalDevice pdev, CString cacheDir, const ConfigSet& cfg,
  18. GrAllocator<U8> alloc);
  19. void destroy(VkDevice dev, VkPhysicalDevice pdev, GrAllocator<U8> alloc);
  20. private:
  21. String m_dumpFilename;
  22. PtrSize m_dumpSize = 0;
  23. ANKI_USE_RESULT Error destroyInternal(VkDevice dev, VkPhysicalDevice pdev, GrAllocator<U8> alloc);
  24. };
  25. /// @}
  26. } // end namespace anki