src/ktx/libktx/vkloader.c
/**
 * @internal
 * @~English
 * @brief Callback for linear tiled textures with no source row padding.
 *
 * Copy the image data into the mapped Vulkan image.
 */
@internal
@~English
@brief Callback for linear tiled textures with no source row padding.

Copy the image data into the mapped Vulkan image.
@internal @~English @brief Callback for linear tiled textures with no source row padding . Copy the image data into the mapped Vulkan image .
KTX_error_code
linearTilingCallback(int miplevel, int face,
                      int width, int height, int depth,
                      ktx_uint64_t faceLodSize,
                      void* pixels, void* userdata)
{
    user_cbdata_linear* ud = (user_cbdata_linear*)userdata;
    VkSubresourceLayout subResLayout;
    VkImageSubresource subRes = {
      .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
      .mipLevel = miplevel,
      .arrayLayer = face
    };
    vkGetImageSubresourceLayout(ud->device, ud->destImage, &subRes,
                                &subResLayout);
    memcpy(ud->dest + subResLayout.offset, pixels, faceLodSize);
    return KTX_SUCCESS;
}
KTX_error_code linearTilingCallback ( int miplevel , int face , int width , int height , int depth , ktx_uint64_t faceLodSize , void * pixels , void * userdata ) { user_cbdata_linear * ud = ( user_cbdata_linear * ) userdata ; VkSubresourceLayout subResLayout ; VkImageSubresource subRes = { . aspectMask = VK_IMAGE_ASPECT_COLOR_BIT , . mipLevel = miplevel , . arrayLayer = face } ; vkGetImageSubresourceLayout ( ud -> device , ud -> destImage , & subRes , & subResLayout ) ; memcpy ( ud -> dest + subResLayout . offset , pixels , faceLodSize ) ; return KTX_SUCCESS ; }
@internal
 @~English
 @brief Callback for linear tiled textures with no source row padding.
@internal @~English @brief Callback for linear tiled textures with no source row padding .
// Get sub resources layout. Includes row pitch, size, // offsets, etc. // Copies all images of the miplevel (for array & 3d) or a single face.