#10472·filament

Vulkan: vkCmdBlitImage from linear staging image without checking BLIT_SRC

Author: jwinarskeCreated Sep 24, 2026Updated Sep 24, 2026

VulkanTexture::updateImage picks the blit path on format mismatch alone:

cpp
// If format conversion is both required and supported, use vkCmdBlitImage.
const VkFormat hostFormat = fvkutils::getVkFormat(hostData->format, hostData->type);
const VkFormat deviceFormat = fvkutils::getVkFormatLinear(mState->mVkFormat);
if (hostFormat != deviceFormat && hostFormat != VK_FORMAT_UNDEFINED) {
    updateImageWithBlit(...);
    return;
}

The comment says "required and supported"; the condition only checks required.

The blit source is a VulkanStagePool image, created with VK_IMAGE_TILING_LINEAR (VulkanStagePool.cpp:190). On hardware where that format+tiling lacks BLIT_SRC, the blit is invalid.

Seen on V3D 7.1 (Raspberry Pi 5, V3DV / Mesa 25.0.7) with an RGBA32F texture — linear-tiling features are COLOR_ATTACHMENT|BLIT_DST|TRANSFER_SRC|TRANSFER_DST, no BLIT_SRC:

VUID-vkCmdBlitImage-srcImage-01999: vkCmdBlitImage(): srcImage was created with
format VK_FORMAT_R32G32B32A32_SFLOAT and tiling VK_IMAGE_TILING_LINEAR which have
VkFormatFeatureFlags2 (VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT|
VK_FORMAT_FEATURE_2_BLIT_DST_BIT|VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT|
VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT) which in turn is missing the required
feature VK_FORMAT_FEATURE_2_BLIT_SRC_BIT.

Fires twice at startup. The upload appears to work, so the practical impact is a validation error rather than visible corruption.

Repro: Vulkan backend on V3D, upload an RGBA32F texture (Texture::InternalFormat::RGBA32F) via setImage with a host format that differs from the device format, validation layers enabled.

Versions: reproduced on 1.75.0, and the code is unchanged on main at 9bf96999e (rc/1.75.1-cut-197) — VulkanTexture.cpp:566-571 and VulkanStagePool.cpp:190 are identical there, and no BLIT_SRC format-feature check exists on this path.

Suggested fix: query vkGetPhysicalDeviceFormatProperties for the staging format and require VK_FORMAT_FEATURE_BLIT_SRC_BIT on linearTilingFeatures before choosing updateImageWithBlit; otherwise fall back to the existing vkCmdCopyBufferToImage path.