aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Vulkan/TextureStorage.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/TextureStorage.cs')
-rw-r--r--Ryujinx.Graphics.Vulkan/TextureStorage.cs37
1 files changed, 22 insertions, 15 deletions
diff --git a/Ryujinx.Graphics.Vulkan/TextureStorage.cs b/Ryujinx.Graphics.Vulkan/TextureStorage.cs
index 28fabb4f..92209997 100644
--- a/Ryujinx.Graphics.Vulkan/TextureStorage.cs
+++ b/Ryujinx.Graphics.Vulkan/TextureStorage.cs
@@ -79,21 +79,7 @@ namespace Ryujinx.Graphics.Vulkan
var sampleCountFlags = ConvertToSampleCountFlags(gd.Capabilities.SupportedSampleCounts, (uint)info.Samples);
- var usage = DefaultUsageFlags;
-
- if (info.Format.IsDepthOrStencil())
- {
- usage |= ImageUsageFlags.DepthStencilAttachmentBit;
- }
- else if (info.Format.IsRtColorCompatible())
- {
- usage |= ImageUsageFlags.ColorAttachmentBit;
- }
-
- if (info.Format.IsImageCompatible())
- {
- usage |= ImageUsageFlags.StorageBit;
- }
+ var usage = GetImageUsageFromFormat(info.Format);
var flags = ImageCreateFlags.CreateMutableFormatBit;
@@ -306,6 +292,27 @@ namespace Ryujinx.Graphics.Vulkan
}
}
+ public static ImageUsageFlags GetImageUsageFromFormat(GAL.Format format)
+ {
+ var usage = DefaultUsageFlags;
+
+ if (format.IsDepthOrStencil())
+ {
+ usage |= ImageUsageFlags.DepthStencilAttachmentBit;
+ }
+ else if (format.IsRtColorCompatible())
+ {
+ usage |= ImageUsageFlags.ColorAttachmentBit;
+ }
+
+ if (format.IsImageCompatible())
+ {
+ usage |= ImageUsageFlags.StorageBit;
+ }
+
+ return usage;
+ }
+
public static SampleCountFlags ConvertToSampleCountFlags(SampleCountFlags supportedSampleCounts, uint samples)
{
if (samples == 0 || samples > (uint)SampleCountFlags.Count64Bit)