Irradiance works
This commit is contained in:
1 parent
aa1f037cb5
commit
f21606379c
28 files changed
+524
-401
No files matched your search
@@ -31,7 +31,7 @@ VkImageAspectFlags getAspectFromFormat(Gfx::SeFormat format) {
|
||||
TextureHandle::TextureHandle(PGraphics graphics, VkImageViewType viewType, const TextureCreateInfo& createInfo, VkImage existingImage)
|
||||
: CommandBoundResource(graphics, createInfo.name), image(existingImage), imageView(VK_NULL_HANDLE), allocation(nullptr),
|
||||
owner(createInfo.sourceData.owner), width(createInfo.width), height(createInfo.height), depth(createInfo.depth),
|
||||
arrayCount(createInfo.elements), layerCount(createInfo.layers), mipLevels(1), samples(createInfo.samples), format(createInfo.format),
|
||||
layerCount(createInfo.elements), mipLevels(1), samples(createInfo.samples), format(createInfo.format),
|
||||
usage(createInfo.usage), layout(Gfx::SE_IMAGE_LAYOUT_UNDEFINED), aspect(getAspectFromFormat(createInfo.format)), ownsImage(false) {
|
||||
if (createInfo.useMip) {
|
||||
mipLevels = static_cast<uint32_t>(std::floor(std::log2(std::max(width, height)))) + 1;
|
||||
@@ -55,7 +55,7 @@ TextureHandle::TextureHandle(PGraphics graphics, VkImageViewType viewType, const
|
||||
case VK_IMAGE_VIEW_TYPE_CUBE_ARRAY:
|
||||
type = VK_IMAGE_TYPE_2D;
|
||||
flags = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
|
||||
layerCount = 6 * arrayCount;
|
||||
layerCount = 6 * layerCount;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -76,7 +76,7 @@ TextureHandle::TextureHandle(PGraphics graphics, VkImageViewType viewType, const
|
||||
.depth = depth,
|
||||
},
|
||||
.mipLevels = mipLevels,
|
||||
.arrayLayers = arrayCount * layerCount,
|
||||
.arrayLayers = layerCount,
|
||||
.samples = (VkSampleCountFlagBits)samples,
|
||||
.tiling = VK_IMAGE_TILING_OPTIMAL,
|
||||
.usage = usage,
|
||||
@@ -129,7 +129,7 @@ TextureHandle::TextureHandle(PGraphics graphics, VkImageViewType viewType, const
|
||||
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
.mipLevel = 0,
|
||||
.baseArrayLayer = 0,
|
||||
.layerCount = arrayCount * layerCount,
|
||||
.layerCount = layerCount,
|
||||
},
|
||||
.imageOffset =
|
||||
{
|
||||
@@ -163,7 +163,7 @@ TextureHandle::TextureHandle(PGraphics graphics, VkImageViewType viewType, const
|
||||
{
|
||||
.aspectMask = aspect,
|
||||
.levelCount = mipLevels,
|
||||
.layerCount = layerCount * arrayCount,
|
||||
.layerCount = layerCount,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -195,7 +195,7 @@ void TextureHandle::pipelineBarrier(VkAccessFlags srcAccess, VkPipelineStageFlag
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = mipLevels,
|
||||
.baseArrayLayer = 0,
|
||||
.layerCount = layerCount * arrayCount,
|
||||
.layerCount = layerCount,
|
||||
},
|
||||
};
|
||||
PCommand command = graphics->getQueueCommands(owner)->getCommands();
|
||||
@@ -223,7 +223,7 @@ void TextureHandle::transferOwnership(Gfx::QueueType newOwner) {
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = mipLevels,
|
||||
.baseArrayLayer = 0,
|
||||
.layerCount = arrayCount,
|
||||
.layerCount = layerCount,
|
||||
},
|
||||
};
|
||||
PCommandPool sourcePool = graphics->getQueueCommands(owner);
|
||||
|
||||
Reference in new issue
Block a user