Merge branch 'master' of https://github.com/SaschaWillems/Vulkan
This commit is contained in:
commit
e75f2ae739
3 changed files with 57 additions and 54 deletions
|
|
@ -219,7 +219,8 @@ public:
|
||||||
for (uint32_t i = 0; i < texture.mipLevels; i++) {
|
for (uint32_t i = 0; i < texture.mipLevels; i++) {
|
||||||
// Calculate offset into staging buffer for the current mip level
|
// Calculate offset into staging buffer for the current mip level
|
||||||
ktx_size_t offset;
|
ktx_size_t offset;
|
||||||
assert(ktxTexture_GetImageOffset(ktxTexture, i, 0, 0, &offset) == KTX_SUCCESS);
|
KTX_error_code ret = ktxTexture_GetImageOffset(ktxTexture, i, 0, 0, &offset);
|
||||||
|
assert(ret == KTX_SUCCESS);
|
||||||
// Setup a buffer image copy structure for the current mip level
|
// Setup a buffer image copy structure for the current mip level
|
||||||
VkBufferImageCopy bufferCopyRegion = {};
|
VkBufferImageCopy bufferCopyRegion = {};
|
||||||
bufferCopyRegion.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
bufferCopyRegion.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||||
|
|
@ -279,8 +280,8 @@ public:
|
||||||
imageMemoryBarrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
|
imageMemoryBarrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
|
||||||
|
|
||||||
// Insert a memory dependency at the proper pipeline stages that will execute the image layout transition
|
// Insert a memory dependency at the proper pipeline stages that will execute the image layout transition
|
||||||
// Source pipeline stage is host write/read exection (VK_PIPELINE_STAGE_HOST_BIT)
|
// Source pipeline stage is host write/read execution (VK_PIPELINE_STAGE_HOST_BIT)
|
||||||
// Destination pipeline stage is copy command exection (VK_PIPELINE_STAGE_TRANSFER_BIT)
|
// Destination pipeline stage is copy command execution (VK_PIPELINE_STAGE_TRANSFER_BIT)
|
||||||
vkCmdPipelineBarrier(
|
vkCmdPipelineBarrier(
|
||||||
copyCmd,
|
copyCmd,
|
||||||
VK_PIPELINE_STAGE_HOST_BIT,
|
VK_PIPELINE_STAGE_HOST_BIT,
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,8 @@ public:
|
||||||
{
|
{
|
||||||
// Calculate offset into staging buffer for the current array layer
|
// Calculate offset into staging buffer for the current array layer
|
||||||
ktx_size_t offset;
|
ktx_size_t offset;
|
||||||
assert(ktxTexture_GetImageOffset(ktxTexture, 0, layer, 0, &offset) == KTX_SUCCESS);
|
KTX_error_code ret = ktxTexture_GetImageOffset(ktxTexture, 0, layer, 0, &offset);
|
||||||
|
assert(ret == KTX_SUCCESS);
|
||||||
// Setup a buffer image copy structure for the current array layer
|
// Setup a buffer image copy structure for the current array layer
|
||||||
VkBufferImageCopy bufferCopyRegion = {};
|
VkBufferImageCopy bufferCopyRegion = {};
|
||||||
bufferCopyRegion.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
bufferCopyRegion.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,8 @@ public:
|
||||||
{
|
{
|
||||||
// Calculate offset into staging buffer for the current mip level and face
|
// Calculate offset into staging buffer for the current mip level and face
|
||||||
ktx_size_t offset;
|
ktx_size_t offset;
|
||||||
assert(ktxTexture_GetImageOffset(ktxTexture, level, 0, face, &offset) == KTX_SUCCESS);
|
KTX_error_code ret = ktxTexture_GetImageOffset(ktxTexture, level, 0, face, &offset);
|
||||||
|
assert(ret == KTX_SUCCESS);
|
||||||
VkBufferImageCopy bufferCopyRegion = {};
|
VkBufferImageCopy bufferCopyRegion = {};
|
||||||
bufferCopyRegion.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
bufferCopyRegion.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||||
bufferCopyRegion.imageSubresource.mipLevel = level;
|
bufferCopyRegion.imageSubresource.mipLevel = level;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue