Specify image view usage flags on Vulkan (#4283)
* Specify image view usage flags on Vulkan * PR feedback
This commit is contained in:
parent
139a930407
commit
065c4e520d
2 changed files with 28 additions and 20 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue