BsVulkanTextureManager.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsVulkanPrerequisites.h"
  5. #include "BsTextureManager.h"
  6. namespace bs
  7. {
  8. /** @addtogroup Vulkan
  9. * @{
  10. */
  11. /** Handles creation of Vulkan textures. */
  12. class VulkanTextureManager : public TextureManager
  13. {
  14. public:
  15. /** @copydoc TextureManager::getNativeFormat */
  16. PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma) override;
  17. protected:
  18. /** @copydoc TextureManager::createRenderTextureImpl */
  19. SPtr<RenderTexture> createRenderTextureImpl(const RENDER_TEXTURE_DESC& desc) override;
  20. };
  21. namespace ct
  22. {
  23. /** Handles creation of Vulkan textures. */
  24. class VulkanTextureManager : public TextureManager
  25. {
  26. public:
  27. /** @copydoc TextureManager::onStartUp */
  28. void onStartUp() override;
  29. /** Returns a image view that can be used for shader read operations when no other image is bound. */
  30. VkImageView getDummyReadImageView(UINT32 deviceIdx) const;
  31. /** Returns a image view that can be used for shader storage operations when no other image is bound. */
  32. VkImageView getDummyStorageImageView(UINT32 deviceIdx) const;
  33. protected:
  34. /** @copydoc TextureManager::createTextureInternal */
  35. SPtr<Texture> createTextureInternal(const TEXTURE_DESC& desc,
  36. const SPtr<PixelData>& initialData = nullptr, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
  37. /** @copydoc TextureManager::createRenderTextureInternal */
  38. SPtr<RenderTexture> createRenderTextureInternal(const RENDER_TEXTURE_DESC& desc,
  39. UINT32 deviceIdx = 0) override;
  40. SPtr<VulkanTexture> mDummyReadTexture;
  41. SPtr<VulkanTexture> mDummyStorageTexture;
  42. };
  43. }
  44. /** @} */
  45. }