mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
image: Do not set storage usage for block-encoded formats. (#3572)
This commit is contained in:
@@ -18,19 +18,21 @@ static vk::ImageUsageFlags ImageUsageFlags(const ImageInfo& info) {
|
|||||||
vk::ImageUsageFlags usage = vk::ImageUsageFlagBits::eTransferSrc |
|
vk::ImageUsageFlags usage = vk::ImageUsageFlagBits::eTransferSrc |
|
||||||
vk::ImageUsageFlagBits::eTransferDst |
|
vk::ImageUsageFlagBits::eTransferDst |
|
||||||
vk::ImageUsageFlagBits::eSampled;
|
vk::ImageUsageFlagBits::eSampled;
|
||||||
|
if (!info.props.is_block) {
|
||||||
if (info.props.is_depth) {
|
if (info.props.is_depth) {
|
||||||
usage |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
|
usage |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
|
||||||
} else {
|
} else {
|
||||||
if (!info.props.is_block) {
|
|
||||||
usage |= vk::ImageUsageFlagBits::eColorAttachment;
|
usage |= vk::ImageUsageFlagBits::eColorAttachment;
|
||||||
}
|
|
||||||
// In cases where an image is created as a render/depth target and cleared with compute,
|
// 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
|
// 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
|
// involve re-creating the resource with a new configuration and copying previous
|
||||||
// into it. However, for now, we will set storage usage for all images (if the format
|
// content into it. However, for now, we will set storage usage for all images (if the
|
||||||
// allows), sacrificing a bit of performance. Note use of ExtendedUsage flag set by default.
|
// format allows), sacrificing a bit of performance. Note use of ExtendedUsage flag set
|
||||||
|
// by default.
|
||||||
usage |= vk::ImageUsageFlagBits::eStorage;
|
usage |= vk::ImageUsageFlagBits::eStorage;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return usage;
|
return usage;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user