|
|
@@ -1,16 +1,27 @@
|
|
|
//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
|
|
|
//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
|
|
|
#include "BsVulkanTexture.h"
|
|
|
+#include "BsVulkanDevice.h"
|
|
|
#include "BsCoreThread.h"
|
|
|
#include "BsException.h"
|
|
|
-#include "BsAsyncOp.h"
|
|
|
#include "BsRenderStats.h"
|
|
|
|
|
|
namespace BansheeEngine
|
|
|
{
|
|
|
+ VulkanImage::VulkanImage(VulkanResourceManager* owner, VkImage image, VkImageLayout layout)
|
|
|
+ :VulkanResource(owner, false, VulkanResourceType::Image), mImage(image), mLayout(layout)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ VulkanImage::~VulkanImage()
|
|
|
+ {
|
|
|
+ vkDestroyImage(mOwner->getDevice().getLogical(), mImage, gVulkanAllocator);
|
|
|
+ }
|
|
|
+
|
|
|
VulkanTextureCore::VulkanTextureCore(const TEXTURE_DESC& desc, const SPtr<PixelData>& initialData,
|
|
|
GpuDeviceFlags deviceMask)
|
|
|
- : TextureCore(desc, initialData, deviceMask)
|
|
|
+ : TextureCore(desc, initialData, deviceMask), mImages()
|
|
|
{
|
|
|
|
|
|
}
|
|
|
@@ -28,6 +39,26 @@ namespace BansheeEngine
|
|
|
TextureCore::initialize();
|
|
|
}
|
|
|
|
|
|
+ VkImageView VulkanTextureCore::getView(UINT32 deviceIdx)
|
|
|
+ {
|
|
|
+ // TODO
|
|
|
+ // - If device idx doesn't match the mask, return VK_NULL_HANDLE
|
|
|
+ // - Otherwise return the default image view (created by default in initialize())
|
|
|
+ // - Free the view in destructor
|
|
|
+ }
|
|
|
+
|
|
|
+ VkImageView VulkanTextureCore::getView(UINT32 deviceIdx, const TextureSurface& surface)
|
|
|
+ {
|
|
|
+ // TODO
|
|
|
+ // - If device idx doesn't match the mask, return VK_NULL_HANDLE
|
|
|
+ // - Otherwise
|
|
|
+ // - Scan the mTextureViews array for an existing view matching the surface
|
|
|
+ // - If view isn't found create a new one and add it to mTextureViews array
|
|
|
+ // - Resize the mTextureViews array as needed
|
|
|
+ // - By default mTextureViews is nullptr, so allocate it during first call
|
|
|
+ // - Free the views in destructor (if any were allocated)
|
|
|
+ }
|
|
|
+
|
|
|
void VulkanTextureCore::copyImpl(UINT32 srcFace, UINT32 srcMipLevel, UINT32 destFace, UINT32 destMipLevel, const SPtr<TextureCore>& target)
|
|
|
{
|
|
|
|