Add support for rendering into 3d textures on Vulkan

#136
This commit is contained in:
Wojtek Figat
2021-05-18 11:40:38 +02:00
parent 5a7efe9019
commit 9cba6bad6d
10 changed files with 89 additions and 102 deletions

View File

@@ -237,13 +237,14 @@ public:
bool WriteDepth;
PixelFormat DepthFormat;
PixelFormat RTVsFormats[GPU_MAX_RT_BINDED];
VkExtent3D Extent;
VkExtent2D Extent;
uint32 Layers;
public:
bool operator==(const RenderTargetLayoutVulkan& other) const
{
return Platform::MemoryCompare((void*)this, &other, sizeof(RenderTargetLayoutVulkan)) == 0;
return Platform::MemoryCompare(this, &other, sizeof(RenderTargetLayoutVulkan)) == 0;
}
};
@@ -263,7 +264,7 @@ public:
bool operator==(const Key& other) const
{
return Platform::MemoryCompare((void*)this, &other, sizeof(Key)) == 0;
return Platform::MemoryCompare(this, &other, sizeof(Key)) == 0;
}
};
@@ -274,13 +275,13 @@ private:
public:
FramebufferVulkan(GPUDeviceVulkan* device, Key& key, VkExtent3D& extent, uint32 layers);
FramebufferVulkan(GPUDeviceVulkan* device, Key& key, VkExtent2D& extent, uint32 layers);
~FramebufferVulkan();
public:
VkImageView Attachments[GPU_MAX_RT_BINDED + 1];
VkExtent3D Extent;
VkExtent2D Extent;
uint32 Layers;
public:
@@ -498,8 +499,6 @@ private:
public:
// Create new graphics device (returns Vulkan if failed)
// @returns Created device or Vulkan
static GPUDevice* Create();
/// <summary>
@@ -685,7 +684,7 @@ public:
}
RenderPassVulkan* GetOrCreateRenderPass(RenderTargetLayoutVulkan& layout);
FramebufferVulkan* GetOrCreateFramebuffer(FramebufferVulkan::Key& key, VkExtent3D& extent, uint32 layers);
FramebufferVulkan* GetOrCreateFramebuffer(FramebufferVulkan::Key& key, VkExtent2D& extent, uint32 layers);
PipelineLayoutVulkan* GetOrCreateLayout(DescriptorSetLayoutInfoVulkan& key);
void OnImageViewDestroy(VkImageView imageView);