image: Do not set storage usage for block-encoded formats. (#3572)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions

This commit is contained in:
squidbus 2025-09-11 00:47:01 -07:00 committed by GitHub
parent c13502d618
commit d4d179610d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,18 +18,20 @@ static vk::ImageUsageFlags ImageUsageFlags(const ImageInfo& info) {
vk::ImageUsageFlags usage = vk::ImageUsageFlagBits::eTransferSrc |
vk::ImageUsageFlagBits::eTransferDst |
vk::ImageUsageFlagBits::eSampled;
if (info.props.is_depth) {
usage |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
} else {
if (!info.props.is_block) {
if (!info.props.is_block) {
if (info.props.is_depth) {
usage |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
} else {
usage |= vk::ImageUsageFlagBits::eColorAttachment;
// In cases where an image is created as a render/depth target and cleared with compute,
// we cannot predict whether it will be used as a storage image. A proper solution would
// involve re-creating the resource with a new configuration and copying previous
// content into it. However, for now, we will set storage usage for all images (if the
// format allows), sacrificing a bit of performance. Note use of ExtendedUsage flag set
// by default.
usage |= vk::ImageUsageFlagBits::eStorage;
}
// In cases where an image is created as a render/depth target and cleared with compute,
// we cannot predict whether it will be used as a storage image. A proper solution would
// involve re-creating the resource with a new configuration and copying previous content
// into it. However, for now, we will set storage usage for all images (if the format
// allows), sacrificing a bit of performance. Note use of ExtendedUsage flag set by default.
usage |= vk::ImageUsageFlagBits::eStorage;
}
return usage;