Fix uninitialized variable used in vkCmdCopyBufferToImage().
This commit is contained in:
parent
8668606a14
commit
2843f4f03b
3 changed files with 57 additions and 54 deletions
|
|
@ -219,7 +219,8 @@ public:
|
|||
for (uint32_t i = 0; i < texture.mipLevels; i++) {
|
||||
// Calculate offset into staging buffer for the current mip level
|
||||
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
|
||||
VkBufferImageCopy bufferCopyRegion = {};
|
||||
bufferCopyRegion.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
|
|
@ -279,8 +280,8 @@ public:
|
|||
imageMemoryBarrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
|
||||
|
||||
// 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)
|
||||
// Destination pipeline stage is copy command exection (VK_PIPELINE_STAGE_TRANSFER_BIT)
|
||||
// Source pipeline stage is host write/read execution (VK_PIPELINE_STAGE_HOST_BIT)
|
||||
// Destination pipeline stage is copy command execution (VK_PIPELINE_STAGE_TRANSFER_BIT)
|
||||
vkCmdPipelineBarrier(
|
||||
copyCmd,
|
||||
VK_PIPELINE_STAGE_HOST_BIT,
|
||||
|
|
|
|||
|
|
@ -178,7 +178,8 @@ public:
|
|||
{
|
||||
// Calculate offset into staging buffer for the current array layer
|
||||
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
|
||||
VkBufferImageCopy bufferCopyRegion = {};
|
||||
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
|
||||
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 = {};
|
||||
bufferCopyRegion.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
bufferCopyRegion.imageSubresource.mipLevel = level;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue