Renderer: Add support for cubemaps

This commit is contained in:
Jérôme Leclercq
2021-06-01 12:30:37 +02:00
parent c243217dd8
commit 465837ff12
14 changed files with 201 additions and 41 deletions

View File

@@ -57,6 +57,7 @@ namespace Nz
inline void CopyBuffer(VkBuffer source, VkBuffer target, UInt64 size, UInt64 sourceOffset = 0, UInt64 targetOffset = 0);
inline void CopyBufferToImage(VkBuffer source, VkImage target, VkImageLayout targetLayout, UInt32 width, UInt32 height, UInt32 depth = 1);
inline void CopyBufferToImage(VkBuffer source, VkImage target, VkImageLayout targetLayout, const VkImageSubresourceLayers& subresourceLayers, UInt32 width, UInt32 height, UInt32 depth = 1);
inline void Draw(UInt32 vertexCount, UInt32 instanceCount = 1, UInt32 firstVertex = 0, UInt32 firstInstance = 0);
inline void DrawIndexed(UInt32 indexCount, UInt32 instanceCount = 1, UInt32 firstVertex = 0, Int32 vertexOffset = 0, UInt32 firstInstance = 0);

View File

@@ -225,17 +225,24 @@ namespace Nz
}
inline void CommandBuffer::CopyBufferToImage(VkBuffer source, VkImage target, VkImageLayout targetLayout, UInt32 width, UInt32 height, UInt32 depth)
{
VkImageSubresourceLayers subresourceLayers = {
VK_IMAGE_ASPECT_COLOR_BIT, //< aspectMask
0,
0,
1
};
return CopyBufferToImage(source, target, targetLayout, subresourceLayers, width, height, depth);
}
inline void CommandBuffer::CopyBufferToImage(VkBuffer source, VkImage target, VkImageLayout targetLayout, const VkImageSubresourceLayers& subresourceLayers, UInt32 width, UInt32 height, UInt32 depth)
{
VkBufferImageCopy region = {
0,
0,
0,
{ // imageSubresource
VK_IMAGE_ASPECT_COLOR_BIT, //< aspectMask
0,
0,
1
},
subresourceLayers,
{ // imageOffset
0, 0, 0
},