Resolve some Vulkan validation errors (#6915)
* Fix some validation errors * Whitespace correction * Resolve some runtime validation errors. * Whitespace * Properly fix usage realted validation error by setting Extended Usage image creation flag. * Only if supported * Remove checking extension for features that are core functionality of Vulkan 1.2
This commit is contained in:
parent
bd3335c143
commit
1a0a351a15
4 changed files with 28 additions and 8 deletions
|
@ -100,7 +100,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
unsafe Auto<DisposableImageView> CreateImageView(ComponentMapping cm, ImageSubresourceRange sr, ImageViewType viewType, ImageUsageFlags usageFlags)
|
||||
{
|
||||
var usage = new ImageViewUsageCreateInfo
|
||||
var imageViewUsage = new ImageViewUsageCreateInfo
|
||||
{
|
||||
SType = StructureType.ImageViewUsageCreateInfo,
|
||||
Usage = usageFlags,
|
||||
|
@ -114,7 +114,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
Format = format,
|
||||
Components = cm,
|
||||
SubresourceRange = sr,
|
||||
PNext = &usage,
|
||||
PNext = &imageViewUsage,
|
||||
};
|
||||
|
||||
gd.Api.CreateImageView(device, imageCreateInfo, null, out var imageView).ThrowOnError();
|
||||
|
@ -123,7 +123,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
ImageUsageFlags shaderUsage = ImageUsageFlags.SampledBit;
|
||||
|
||||
if (info.Format.IsImageCompatible())
|
||||
if (info.Format.IsImageCompatible() && (_gd.Capabilities.SupportsShaderStorageImageMultisample || !info.Target.IsMultisample()))
|
||||
{
|
||||
shaderUsage |= ImageUsageFlags.StorageBit;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
else
|
||||
{
|
||||
subresourceRange = new ImageSubresourceRange(aspectFlags, (uint)firstLevel, levels, (uint)firstLayer, (uint)info.Depth);
|
||||
subresourceRange = new ImageSubresourceRange(aspectFlags, (uint)firstLevel, 1, (uint)firstLayer, (uint)info.Depth);
|
||||
|
||||
_imageView2dArray = CreateImageView(identityComponentMapping, subresourceRange, ImageViewType.Type2DArray, usage);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue