BsVulkanTexture.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "BsVulkanTexture.h"
  4. #include "BsCoreThread.h"
  5. #include "BsException.h"
  6. #include "BsAsyncOp.h"
  7. #include "BsRenderStats.h"
  8. namespace BansheeEngine
  9. {
  10. VulkanTextureCore::VulkanTextureCore(const TEXTURE_DESC& desc, const SPtr<PixelData>& initialData,
  11. GpuDeviceFlags deviceMask)
  12. : TextureCore(desc, initialData, deviceMask)
  13. {
  14. }
  15. VulkanTextureCore::~VulkanTextureCore()
  16. {
  17. BS_INC_RENDER_STAT_CAT(ResDestroyed, RenderStatObject_Texture);
  18. }
  19. void VulkanTextureCore::initialize()
  20. {
  21. THROW_IF_NOT_CORE_THREAD;
  22. BS_INC_RENDER_STAT_CAT(ResCreated, RenderStatObject_Texture);
  23. TextureCore::initialize();
  24. }
  25. void VulkanTextureCore::copyImpl(UINT32 srcFace, UINT32 srcMipLevel, UINT32 destFace, UINT32 destMipLevel, const SPtr<TextureCore>& target)
  26. {
  27. }
  28. PixelData VulkanTextureCore::lockImpl(GpuLockOptions options, UINT32 mipLevel, UINT32 face)
  29. {
  30. PixelData lockedArea(1, 1, 1, mProperties.getFormat());
  31. // TODO - Increment read/write stat (do this for other buffers as well)
  32. return lockedArea;
  33. }
  34. void VulkanTextureCore::unlockImpl()
  35. {
  36. }
  37. void VulkanTextureCore::readData(PixelData& dest, UINT32 mipLevel, UINT32 face)
  38. {
  39. BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_GpuBuffer);
  40. }
  41. void VulkanTextureCore::writeData(const PixelData& src, UINT32 mipLevel, UINT32 face, bool discardWholeBuffer)
  42. {
  43. BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_Texture);
  44. }
  45. }