chore: Update Silk.NET to 2.16.0 (#3953)

This commit is contained in:
Mary-nyan 2022-12-01 19:11:56 +01:00 committed by GitHub
parent 456fc04007
commit ce92e8cd04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 293 additions and 293 deletions

View File

@ -33,9 +33,9 @@
<PackageReference Include="OpenTK.Core" Version="4.7.5" />
<PackageReference Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
<PackageReference Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.1-build10" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
<PackageReference Include="Silk.NET.Vulkan" Version="2.10.1" />
<PackageReference Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.10.1" />
<PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.10.1" />
<PackageReference Include="Silk.NET.Vulkan" Version="2.16.0" />
<PackageReference Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" />
<PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" />
<PackageReference Include="SPB" Version="0.0.4-build28" />
<PackageReference Include="SharpZipLib" Version="1.4.1" />
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />

View File

@ -12,12 +12,12 @@ namespace Ryujinx.Graphics.Vulkan
private const int MaxUpdateBufferSize = 0x10000;
public const AccessFlags DefaultAccessFlags =
AccessFlags.AccessIndirectCommandReadBit |
AccessFlags.AccessShaderReadBit |
AccessFlags.AccessShaderWriteBit |
AccessFlags.AccessTransferReadBit |
AccessFlags.AccessTransferWriteBit |
AccessFlags.AccessUniformReadBit;
AccessFlags.IndirectCommandReadBit |
AccessFlags.ShaderReadBit |
AccessFlags.ShaderWriteBit |
AccessFlags.TransferReadBit |
AccessFlags.TransferWriteBit |
AccessFlags.UniformReadBit;
private readonly VulkanRenderer _gd;
private readonly Device _device;
@ -87,9 +87,9 @@ namespace Ryujinx.Graphics.Vulkan
_gd.Api.CmdPipelineBarrier(
commandBuffer,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
DependencyFlags.DependencyDeviceGroupBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.AllCommandsBit,
DependencyFlags.DeviceGroupBit,
1,
memoryBarrier,
0,
@ -273,9 +273,9 @@ namespace Ryujinx.Graphics.Vulkan
cbs.CommandBuffer,
dstBuffer,
BufferHolder.DefaultAccessFlags,
AccessFlags.AccessTransferWriteBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferWriteBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.TransferBit,
dstOffset,
data.Length);
@ -293,10 +293,10 @@ namespace Ryujinx.Graphics.Vulkan
_gd,
cbs.CommandBuffer,
dstBuffer,
AccessFlags.AccessTransferWriteBit,
AccessFlags.TransferWriteBit,
BufferHolder.DefaultAccessFlags,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.AllCommandsBit,
dstOffset,
data.Length);
@ -320,9 +320,9 @@ namespace Ryujinx.Graphics.Vulkan
cbs.CommandBuffer,
dstBuffer,
BufferHolder.DefaultAccessFlags,
AccessFlags.AccessTransferWriteBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferWriteBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.TransferBit,
dstOffset,
size);
@ -334,10 +334,10 @@ namespace Ryujinx.Graphics.Vulkan
gd,
cbs.CommandBuffer,
dstBuffer,
AccessFlags.AccessTransferWriteBit,
AccessFlags.TransferWriteBit,
BufferHolder.DefaultAccessFlags,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.AllCommandsBit,
dstOffset,
size);
}

View File

@ -10,28 +10,28 @@ namespace Ryujinx.Graphics.Vulkan
class BufferManager : IDisposable
{
private const MemoryPropertyFlags DefaultBufferMemoryFlags =
MemoryPropertyFlags.MemoryPropertyHostVisibleBit |
MemoryPropertyFlags.MemoryPropertyHostCoherentBit |
MemoryPropertyFlags.MemoryPropertyHostCachedBit;
MemoryPropertyFlags.HostVisibleBit |
MemoryPropertyFlags.HostCoherentBit |
MemoryPropertyFlags.HostCachedBit;
private const MemoryPropertyFlags DeviceLocalBufferMemoryFlags =
MemoryPropertyFlags.MemoryPropertyDeviceLocalBit;
MemoryPropertyFlags.DeviceLocalBit;
private const MemoryPropertyFlags FlushableDeviceLocalBufferMemoryFlags =
MemoryPropertyFlags.MemoryPropertyHostVisibleBit |
MemoryPropertyFlags.MemoryPropertyHostCoherentBit |
MemoryPropertyFlags.MemoryPropertyDeviceLocalBit;
MemoryPropertyFlags.HostVisibleBit |
MemoryPropertyFlags.HostCoherentBit |
MemoryPropertyFlags.DeviceLocalBit;
private const BufferUsageFlags DefaultBufferUsageFlags =
BufferUsageFlags.BufferUsageTransferSrcBit |
BufferUsageFlags.BufferUsageTransferDstBit |
BufferUsageFlags.BufferUsageUniformTexelBufferBit |
BufferUsageFlags.BufferUsageStorageTexelBufferBit |
BufferUsageFlags.BufferUsageUniformBufferBit |
BufferUsageFlags.BufferUsageStorageBufferBit |
BufferUsageFlags.BufferUsageIndexBufferBit |
BufferUsageFlags.BufferUsageVertexBufferBit |
BufferUsageFlags.BufferUsageTransformFeedbackBufferBitExt;
BufferUsageFlags.TransferSrcBit |
BufferUsageFlags.TransferDstBit |
BufferUsageFlags.UniformTexelBufferBit |
BufferUsageFlags.StorageTexelBufferBit |
BufferUsageFlags.UniformBufferBit |
BufferUsageFlags.StorageBufferBit |
BufferUsageFlags.IndexBufferBit |
BufferUsageFlags.VertexBufferBit |
BufferUsageFlags.TransformFeedbackBufferBitExt;
private readonly PhysicalDevice _physicalDevice;
private readonly Device _device;
@ -76,11 +76,11 @@ namespace Ryujinx.Graphics.Vulkan
if (forConditionalRendering && gd.Capabilities.SupportsConditionalRendering)
{
usage |= BufferUsageFlags.BufferUsageConditionalRenderingBitExt;
usage |= BufferUsageFlags.ConditionalRenderingBitExt;
}
else if (gd.Capabilities.SupportsIndirectParameters)
{
usage |= BufferUsageFlags.BufferUsageIndirectBufferBit;
usage |= BufferUsageFlags.IndirectBufferBit;
}
var bufferCreateInfo = new BufferCreateInfo()

View File

@ -71,8 +71,8 @@ namespace Ryujinx.Graphics.Vulkan
{
SType = StructureType.CommandPoolCreateInfo,
QueueFamilyIndex = queueFamilyIndex,
Flags = CommandPoolCreateFlags.CommandPoolCreateTransientBit |
CommandPoolCreateFlags.CommandPoolCreateResetCommandBufferBit
Flags = CommandPoolCreateFlags.TransientBit |
CommandPoolCreateFlags.ResetCommandBufferBit
};
api.CreateCommandPool(device, commandPoolCreateInfo, null, out _pool).ThrowOnError();

View File

@ -229,7 +229,7 @@ namespace Ryujinx.Graphics.Vulkan
}
else if (texture is TextureView view)
{
view.Storage.InsertBarrier(cbs, AccessFlags.AccessShaderReadBit, stage.ConvertToPipelineStageFlags());
view.Storage.InsertBarrier(cbs, AccessFlags.ShaderReadBit, stage.ConvertToPipelineStageFlags());
_textureRefs[binding] = view.GetImageView();
_samplerRefs[binding] = ((SamplerHolder)sampler)?.GetSampler();

View File

@ -12,12 +12,12 @@ namespace Ryujinx.Graphics.Vulkan
{
return stage switch
{
ShaderStage.Vertex => ShaderStageFlags.ShaderStageVertexBit,
ShaderStage.Geometry => ShaderStageFlags.ShaderStageGeometryBit,
ShaderStage.TessellationControl => ShaderStageFlags.ShaderStageTessellationControlBit,
ShaderStage.TessellationEvaluation => ShaderStageFlags.ShaderStageTessellationEvaluationBit,
ShaderStage.Fragment => ShaderStageFlags.ShaderStageFragmentBit,
ShaderStage.Compute => ShaderStageFlags.ShaderStageComputeBit,
ShaderStage.Vertex => ShaderStageFlags.VertexBit,
ShaderStage.Geometry => ShaderStageFlags.GeometryBit,
ShaderStage.TessellationControl => ShaderStageFlags.TessellationControlBit,
ShaderStage.TessellationEvaluation => ShaderStageFlags.TessellationEvaluationBit,
ShaderStage.Fragment => ShaderStageFlags.FragmentBit,
ShaderStage.Compute => ShaderStageFlags.ComputeBit,
_ => LogInvalidAndReturn(stage, nameof(ShaderStage), (ShaderStageFlags)0)
};
}
@ -26,12 +26,12 @@ namespace Ryujinx.Graphics.Vulkan
{
return stage switch
{
ShaderStage.Vertex => PipelineStageFlags.PipelineStageVertexShaderBit,
ShaderStage.Geometry => PipelineStageFlags.PipelineStageGeometryShaderBit,
ShaderStage.TessellationControl => PipelineStageFlags.PipelineStageTessellationControlShaderBit,
ShaderStage.TessellationEvaluation => PipelineStageFlags.PipelineStageTessellationEvaluationShaderBit,
ShaderStage.Fragment => PipelineStageFlags.PipelineStageFragmentShaderBit,
ShaderStage.Compute => PipelineStageFlags.PipelineStageComputeShaderBit,
ShaderStage.Vertex => PipelineStageFlags.VertexShaderBit,
ShaderStage.Geometry => PipelineStageFlags.GeometryShaderBit,
ShaderStage.TessellationControl => PipelineStageFlags.TessellationControlShaderBit,
ShaderStage.TessellationEvaluation => PipelineStageFlags.TessellationEvaluationShaderBit,
ShaderStage.Fragment => PipelineStageFlags.FragmentShaderBit,
ShaderStage.Compute => PipelineStageFlags.ComputeShaderBit,
_ => LogInvalidAndReturn(stage, nameof(ShaderStage), (PipelineStageFlags)0)
};
}
@ -112,10 +112,10 @@ namespace Ryujinx.Graphics.Vulkan
{
return face switch
{
Face.Back => CullModeFlags.CullModeBackBit,
Face.Front => CullModeFlags.CullModeFrontBit,
Face.FrontAndBack => CullModeFlags.CullModeFrontAndBack,
_ => LogInvalidAndReturn(face, nameof(Face), CullModeFlags.CullModeBackBit)
Face.Back => CullModeFlags.BackBit,
Face.Front => CullModeFlags.FrontBit,
Face.FrontAndBack => CullModeFlags.FrontAndBack,
_ => LogInvalidAndReturn(face, nameof(Face), CullModeFlags.BackBit)
};
}
@ -223,14 +223,14 @@ namespace Ryujinx.Graphics.Vulkan
{
Target.Texture1D or
Target.Texture1DArray or
Target.TextureBuffer => ImageType.ImageType1D,
Target.TextureBuffer => ImageType.Type1D,
Target.Texture2D or
Target.Texture2DArray or
Target.Texture2DMultisample or
Target.Cubemap or
Target.CubemapArray => ImageType.ImageType2D,
Target.Texture3D => ImageType.ImageType3D,
_ => LogInvalidAndReturn(target, nameof(Target), ImageType.ImageType2D)
Target.CubemapArray => ImageType.Type2D,
Target.Texture3D => ImageType.Type3D,
_ => LogInvalidAndReturn(target, nameof(Target), ImageType.Type2D)
};
}
@ -238,14 +238,14 @@ namespace Ryujinx.Graphics.Vulkan
{
return target switch
{
Target.Texture1D => ImageViewType.ImageViewType1D,
Target.Texture2D or Target.Texture2DMultisample => ImageViewType.ImageViewType2D,
Target.Texture3D => ImageViewType.ImageViewType3D,
Target.Texture1DArray => ImageViewType.ImageViewType1DArray,
Target.Texture2DArray => ImageViewType.ImageViewType2DArray,
Target.Cubemap => ImageViewType.Cube,
Target.CubemapArray => ImageViewType.CubeArray,
_ => LogInvalidAndReturn(target, nameof(Target), ImageViewType.ImageViewType2D)
Target.Texture1D => ImageViewType.Type1D,
Target.Texture2D or Target.Texture2DMultisample => ImageViewType.Type2D,
Target.Texture3D => ImageViewType.Type3D,
Target.Texture1DArray => ImageViewType.Type1DArray,
Target.Texture2DArray => ImageViewType.Type2DArray,
Target.Cubemap => ImageViewType.TypeCube,
Target.CubemapArray => ImageViewType.TypeCubeArray,
_ => LogInvalidAndReturn(target, nameof(Target), ImageViewType.Type2D)
};
}
@ -253,12 +253,12 @@ namespace Ryujinx.Graphics.Vulkan
{
return format switch
{
GAL.Format.D16Unorm or GAL.Format.D32Float => ImageAspectFlags.ImageAspectDepthBit,
GAL.Format.S8Uint => ImageAspectFlags.ImageAspectStencilBit,
GAL.Format.D16Unorm or GAL.Format.D32Float => ImageAspectFlags.DepthBit,
GAL.Format.S8Uint => ImageAspectFlags.StencilBit,
GAL.Format.D24UnormS8Uint or
GAL.Format.D32FloatS8Uint or
GAL.Format.S8UintD24Unorm => ImageAspectFlags.ImageAspectDepthBit | ImageAspectFlags.ImageAspectStencilBit,
_ => ImageAspectFlags.ImageAspectColorBit
GAL.Format.S8UintD24Unorm => ImageAspectFlags.DepthBit | ImageAspectFlags.StencilBit,
_ => ImageAspectFlags.ColorBit
};
}
@ -266,12 +266,12 @@ namespace Ryujinx.Graphics.Vulkan
{
return format switch
{
GAL.Format.D16Unorm or GAL.Format.D32Float => ImageAspectFlags.ImageAspectDepthBit,
GAL.Format.S8Uint => ImageAspectFlags.ImageAspectStencilBit,
GAL.Format.D16Unorm or GAL.Format.D32Float => ImageAspectFlags.DepthBit,
GAL.Format.S8Uint => ImageAspectFlags.StencilBit,
GAL.Format.D24UnormS8Uint or
GAL.Format.D32FloatS8Uint or
GAL.Format.S8UintD24Unorm => depthStencilMode == DepthStencilMode.Stencil ? ImageAspectFlags.ImageAspectStencilBit : ImageAspectFlags.ImageAspectDepthBit,
_ => ImageAspectFlags.ImageAspectColorBit
GAL.Format.S8UintD24Unorm => depthStencilMode == DepthStencilMode.Stencil ? ImageAspectFlags.StencilBit : ImageAspectFlags.DepthBit,
_ => ImageAspectFlags.ColorBit
};
}

View File

@ -83,22 +83,22 @@ namespace Ryujinx.Graphics.Vulkan
{
var format = FormatTable.GetFormat(srcFormat);
var requiredFeatures = FormatFeatureFlags.FormatFeatureSampledImageBit |
FormatFeatureFlags.FormatFeatureTransferSrcBit |
FormatFeatureFlags.FormatFeatureTransferDstBit;
var requiredFeatures = FormatFeatureFlags.SampledImageBit |
FormatFeatureFlags.TransferSrcBit |
FormatFeatureFlags.TransferDstBit;
if (srcFormat.IsDepthOrStencil())
{
requiredFeatures |= FormatFeatureFlags.FormatFeatureDepthStencilAttachmentBit;
requiredFeatures |= FormatFeatureFlags.DepthStencilAttachmentBit;
}
else if (srcFormat.IsRtColorCompatible())
{
requiredFeatures |= FormatFeatureFlags.FormatFeatureColorAttachmentBit;
requiredFeatures |= FormatFeatureFlags.ColorAttachmentBit;
}
if (srcFormat.IsImageCompatible())
{
requiredFeatures |= FormatFeatureFlags.FormatFeatureStorageImageBit;
requiredFeatures |= FormatFeatureFlags.StorageImageBit;
}
if (!OptimalFormatSupports(requiredFeatures, srcFormat) || (IsD24S8(srcFormat) && VulkanConfiguration.ForceD24S8Unsupported))
@ -125,7 +125,7 @@ namespace Ryujinx.Graphics.Vulkan
{
var format = FormatTable.GetFormat(srcFormat);
if (!BufferFormatSupports(FormatFeatureFlags.FormatFeatureVertexBufferBit, srcFormat) ||
if (!BufferFormatSupports(FormatFeatureFlags.VertexBufferBit, srcFormat) ||
(IsRGB16IntFloat(srcFormat) && VulkanConfiguration.ForceRGB16IntFloatUnsupported))
{
// The format is not supported. Can we convert it to an alternative format?

View File

@ -190,14 +190,14 @@ namespace Ryujinx.Graphics.Vulkan
for (int index = 0; index < _colors.Length; index++)
{
_colors[index].Storage.SetModification(
AccessFlags.AccessColorAttachmentWriteBit,
PipelineStageFlags.PipelineStageColorAttachmentOutputBit);
AccessFlags.ColorAttachmentWriteBit,
PipelineStageFlags.ColorAttachmentOutputBit);
}
}
_depthStencil?.Storage.SetModification(
AccessFlags.AccessDepthStencilAttachmentWriteBit,
PipelineStageFlags.PipelineStageColorAttachmentOutputBit);
AccessFlags.DepthStencilAttachmentWriteBit,
PipelineStageFlags.ColorAttachmentOutputBit);
}
}
}

View File

@ -349,8 +349,8 @@ namespace Ryujinx.Graphics.Vulkan
var srcBuffer = srcBufferAuto.Get(cbs, srcOffset, size).Value;
var dstBuffer = dstBufferAuto.Get(cbs, 0, newSize).Value;
var access = supportsUint8 ? AccessFlags.AccessShaderWriteBit : AccessFlags.AccessTransferWriteBit;
var stage = supportsUint8 ? PipelineStageFlags.PipelineStageComputeShaderBit : PipelineStageFlags.PipelineStageTransferBit;
var access = supportsUint8 ? AccessFlags.ShaderWriteBit : AccessFlags.TransferWriteBit;
var stage = supportsUint8 ? PipelineStageFlags.ComputeShaderBit : PipelineStageFlags.TransferBit;
BufferHolder.InsertBufferBarrier(
gd,
@ -358,7 +358,7 @@ namespace Ryujinx.Graphics.Vulkan
dstBuffer,
BufferHolder.DefaultAccessFlags,
access,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.AllCommandsBit,
stage,
0,
newSize);
@ -420,7 +420,7 @@ namespace Ryujinx.Graphics.Vulkan
access,
BufferHolder.DefaultAccessFlags,
stage,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.AllCommandsBit,
0,
newSize);
}
@ -484,9 +484,9 @@ namespace Ryujinx.Graphics.Vulkan
cbs.CommandBuffer,
dstBuffer,
BufferHolder.DefaultAccessFlags,
AccessFlags.AccessTransferWriteBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferWriteBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.TransferBit,
0,
convertedCount * outputIndexSize);
@ -499,10 +499,10 @@ namespace Ryujinx.Graphics.Vulkan
gd,
cbs.CommandBuffer,
dstBuffer,
AccessFlags.AccessTransferWriteBit,
AccessFlags.TransferWriteBit,
BufferHolder.DefaultAccessFlags,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.AllCommandsBit,
0,
convertedCount * outputIndexSize);
}
@ -548,10 +548,10 @@ namespace Ryujinx.Graphics.Vulkan
cbs.CommandBuffer,
src.GetImage().Get(cbs).Value,
TextureStorage.DefaultAccessMask,
AccessFlags.AccessShaderReadBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageComputeShaderBit,
ImageAspectFlags.ImageAspectColorBit,
AccessFlags.ShaderReadBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.ComputeShaderBit,
ImageAspectFlags.ColorBit,
src.FirstLayer + srcLayer,
src.FirstLevel,
depth,
@ -610,11 +610,11 @@ namespace Ryujinx.Graphics.Vulkan
gd.Api,
cbs.CommandBuffer,
dst.GetImage().Get(cbs).Value,
AccessFlags.AccessShaderWriteBit,
AccessFlags.ShaderWriteBit,
TextureStorage.DefaultAccessMask,
PipelineStageFlags.PipelineStageComputeShaderBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
ImageAspectFlags.ImageAspectColorBit,
PipelineStageFlags.ComputeShaderBit,
PipelineStageFlags.AllCommandsBit,
ImageAspectFlags.ColorBit,
dst.FirstLayer + dstLayer,
dst.FirstLevel,
depth,
@ -770,9 +770,9 @@ namespace Ryujinx.Graphics.Vulkan
cbs.CommandBuffer,
srcIndirectBuffer.GetBuffer().Get(cbs, srcIndirectBufferOffset, indirectDataSize).Value,
BufferHolder.DefaultAccessFlags,
AccessFlags.AccessShaderReadBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageComputeShaderBit,
AccessFlags.ShaderReadBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.ComputeShaderBit,
srcIndirectBufferOffset,
indirectDataSize);
@ -786,10 +786,10 @@ namespace Ryujinx.Graphics.Vulkan
gd,
cbs.CommandBuffer,
patternBufferAuto.Get(cbs, ParamsIndirectDispatchOffset, ParamsIndirectDispatchSize).Value,
AccessFlags.AccessShaderWriteBit,
AccessFlags.AccessIndirectCommandReadBit,
PipelineStageFlags.PipelineStageComputeShaderBit,
PipelineStageFlags.PipelineStageDrawIndirectBit,
AccessFlags.ShaderWriteBit,
AccessFlags.IndirectCommandReadBit,
PipelineStageFlags.ComputeShaderBit,
PipelineStageFlags.DrawIndirectBit,
ParamsIndirectDispatchOffset,
ParamsIndirectDispatchSize);
@ -798,9 +798,9 @@ namespace Ryujinx.Graphics.Vulkan
cbs.CommandBuffer,
dstBuffer,
BufferHolder.DefaultAccessFlags,
AccessFlags.AccessTransferWriteBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferWriteBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.TransferBit,
0,
convertedCount * outputIndexSize);
@ -814,10 +814,10 @@ namespace Ryujinx.Graphics.Vulkan
gd,
cbs.CommandBuffer,
dstBuffer,
AccessFlags.AccessTransferWriteBit,
AccessFlags.TransferWriteBit,
BufferHolder.DefaultAccessFlags,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.AllCommandsBit,
0,
convertedCount * outputIndexSize);

View File

@ -33,7 +33,7 @@ namespace Ryujinx.Graphics.Vulkan
return default;
}
bool map = flags.HasFlag(MemoryPropertyFlags.MemoryPropertyHostVisibleBit);
bool map = flags.HasFlag(MemoryPropertyFlags.HostVisibleBit);
return Allocate(memoryTypeIndex, requirements.Size, requirements.Alignment, map);
}

View File

@ -128,14 +128,14 @@ namespace Ryujinx.Graphics.Vulkan
MemoryBarrier memoryBarrier = new MemoryBarrier()
{
SType = StructureType.MemoryBarrier,
SrcAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit,
DstAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit
SrcAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit,
DstAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit
};
Gd.Api.CmdPipelineBarrier(
CommandBuffer,
PipelineStageFlags.PipelineStageFragmentShaderBit,
PipelineStageFlags.PipelineStageFragmentShaderBit,
PipelineStageFlags.FragmentShaderBit,
PipelineStageFlags.FragmentShaderBit,
0,
1,
memoryBarrier,
@ -161,9 +161,9 @@ namespace Ryujinx.Graphics.Vulkan
Cbs.CommandBuffer,
dst,
BufferHolder.DefaultAccessFlags,
AccessFlags.AccessTransferWriteBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferWriteBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.TransferBit,
offset,
size);
@ -173,10 +173,10 @@ namespace Ryujinx.Graphics.Vulkan
Gd,
Cbs.CommandBuffer,
dst,
AccessFlags.AccessTransferWriteBit,
AccessFlags.TransferWriteBit,
BufferHolder.DefaultAccessFlags,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.AllCommandsBit,
offset,
size);
}
@ -196,7 +196,7 @@ namespace Ryujinx.Graphics.Vulkan
BeginRenderPass();
var clearValue = new ClearValue(new ClearColorValue(color.Red, color.Green, color.Blue, color.Alpha));
var attachment = new ClearAttachment(ImageAspectFlags.ImageAspectColorBit, (uint)index, clearValue);
var attachment = new ClearAttachment(ImageAspectFlags.ColorBit, (uint)index, clearValue);
var clearRect = FramebufferParams.GetClearRect(ClearScissor, layer, layerCount);
Gd.Api.CmdClearAttachments(CommandBuffer, 1, &attachment, 1, &clearRect);
@ -219,11 +219,11 @@ namespace Ryujinx.Graphics.Vulkan
BeginRenderPass();
var clearValue = new ClearValue(null, new ClearDepthStencilValue(depthValue, (uint)stencilValue));
var flags = depthMask ? ImageAspectFlags.ImageAspectDepthBit : 0;
var flags = depthMask ? ImageAspectFlags.DepthBit : 0;
if (stencilMask != 0)
{
flags |= ImageAspectFlags.ImageAspectStencilBit;
flags |= ImageAspectFlags.StencilBit;
}
var attachment = new ClearAttachment(flags, 0, clearValue);
@ -238,13 +238,13 @@ namespace Ryujinx.Graphics.Vulkan
{
SType = StructureType.MemoryBarrier,
SrcAccessMask = BufferHolder.DefaultAccessFlags,
DstAccessMask = AccessFlags.AccessIndirectCommandReadBit
DstAccessMask = AccessFlags.IndirectCommandReadBit
};
Gd.Api.CmdPipelineBarrier(
CommandBuffer,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageDrawIndirectBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.DrawIndirectBit,
0,
1,
memoryBarrier,
@ -624,7 +624,7 @@ namespace Ryujinx.Graphics.Vulkan
var oldViewports = DynamicState.Viewports;
var oldViewportsCount = _newState.ViewportsCount;
_newState.CullMode = CullModeFlags.CullModeNone;
_newState.CullMode = CullModeFlags.None;
_newState.StencilTestEnable = false;
_newState.DepthTestEnable = false;
_newState.DepthWriteEnable = false;
@ -737,7 +737,7 @@ namespace Ryujinx.Graphics.Vulkan
public void SetFaceCulling(bool enable, Face face)
{
_newState.CullMode = enable ? face.Convert() : CullModeFlags.CullModeNone;
_newState.CullMode = enable ? face.Convert() : CullModeFlags.None;
SignalStateChange();
}
@ -1200,14 +1200,14 @@ namespace Ryujinx.Graphics.Vulkan
MemoryBarrier memoryBarrier = new MemoryBarrier()
{
SType = StructureType.MemoryBarrier,
SrcAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit,
DstAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit
SrcAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit,
DstAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit
};
Gd.Api.CmdPipelineBarrier(
CommandBuffer,
PipelineStageFlags.PipelineStageFragmentShaderBit,
PipelineStageFlags.PipelineStageFragmentShaderBit,
PipelineStageFlags.FragmentShaderBit,
PipelineStageFlags.FragmentShaderBit,
0,
1,
memoryBarrier,

View File

@ -6,8 +6,8 @@ namespace Ryujinx.Graphics.Vulkan
{
static class PipelineConverter
{
private const AccessFlags SubpassSrcAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessColorAttachmentWriteBit;
private const AccessFlags SubpassDstAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessShaderReadBit;
private const AccessFlags SubpassSrcAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit | AccessFlags.ColorAttachmentWriteBit;
private const AccessFlags SubpassDstAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit | AccessFlags.ShaderReadBit;
public static unsafe DisposableRenderPass ToRenderPass(this ProgramPipelineState state, VulkanRenderer gd, Device device)
{
@ -129,8 +129,8 @@ namespace Ryujinx.Graphics.Vulkan
return new SubpassDependency(
0,
0,
PipelineStageFlags.PipelineStageAllGraphicsBit,
PipelineStageFlags.PipelineStageAllGraphicsBit,
PipelineStageFlags.AllGraphicsBit,
PipelineStageFlags.AllGraphicsBit,
SubpassSrcAccessMask,
SubpassDstAccessMask,
0);
@ -143,8 +143,8 @@ namespace Ryujinx.Graphics.Vulkan
null,
0,
0,
PipelineStageFlags.PipelineStageAllGraphicsBit,
PipelineStageFlags.PipelineStageAllGraphicsBit,
PipelineStageFlags.AllGraphicsBit,
PipelineStageFlags.AllGraphicsBit,
SubpassSrcAccessMask,
SubpassDstAccessMask,
0);
@ -157,7 +157,7 @@ namespace Ryujinx.Graphics.Vulkan
// It is assumed that Dynamic State is enabled when this conversion is used.
pipeline.CullMode = state.CullEnable ? state.CullMode.Convert() : CullModeFlags.CullModeNone;
pipeline.CullMode = state.CullEnable ? state.CullMode.Convert() : CullModeFlags.None;
pipeline.DepthBoundsTestEnable = false; // Not implemented.

View File

@ -145,12 +145,12 @@ namespace Ryujinx.Graphics.Vulkan
private void RecordStencilMasks(Vk api, CommandBuffer commandBuffer)
{
api.CmdSetStencilCompareMask(commandBuffer, StencilFaceFlags.StencilFaceBackBit, _backCompareMask);
api.CmdSetStencilWriteMask(commandBuffer, StencilFaceFlags.StencilFaceBackBit, _backWriteMask);
api.CmdSetStencilReference(commandBuffer, StencilFaceFlags.StencilFaceBackBit, _backReference);
api.CmdSetStencilCompareMask(commandBuffer, StencilFaceFlags.StencilFaceFrontBit, _frontCompareMask);
api.CmdSetStencilWriteMask(commandBuffer, StencilFaceFlags.StencilFaceFrontBit, _frontWriteMask);
api.CmdSetStencilReference(commandBuffer, StencilFaceFlags.StencilFaceFrontBit, _frontReference);
api.CmdSetStencilCompareMask(commandBuffer, StencilFaceFlags.FaceBackBit, _backCompareMask);
api.CmdSetStencilWriteMask(commandBuffer, StencilFaceFlags.FaceBackBit, _backWriteMask);
api.CmdSetStencilReference(commandBuffer, StencilFaceFlags.FaceBackBit, _backReference);
api.CmdSetStencilCompareMask(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontCompareMask);
api.CmdSetStencilWriteMask(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontWriteMask);
api.CmdSetStencilReference(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontReference);
}
private void RecordViewport(Vk api, CommandBuffer commandBuffer)

View File

@ -125,7 +125,7 @@ namespace Ryujinx.Graphics.Vulkan
if (Gd.Capabilities.SupportsConditionalRendering)
{
var buffer = evt.GetBuffer().Get(Cbs, 0, sizeof(long)).Value;
var flags = isEqual ? ConditionalRenderingFlagsEXT.ConditionalRenderingInvertedBitExt : 0;
var flags = isEqual ? ConditionalRenderingFlagsEXT.InvertedBitExt : 0;
var conditionalRenderingBeginInfo = new ConditionalRenderingBeginInfoEXT()
{

View File

@ -8,9 +8,9 @@ namespace Ryujinx.Graphics.Vulkan
static class PipelineLayoutFactory
{
private const ShaderStageFlags SupportBufferStages =
ShaderStageFlags.ShaderStageVertexBit |
ShaderStageFlags.ShaderStageFragmentBit |
ShaderStageFlags.ShaderStageComputeBit;
ShaderStageFlags.VertexBit |
ShaderStageFlags.FragmentBit |
ShaderStageFlags.ComputeBit;
public static unsafe DescriptorSetLayout[] Create(VulkanRenderer gd, Device device, uint stages, bool usePd, out PipelineLayout layout)
{
@ -42,11 +42,11 @@ namespace Ryujinx.Graphics.Vulkan
var stageFlags = stage switch
{
1 => ShaderStageFlags.ShaderStageFragmentBit,
2 => ShaderStageFlags.ShaderStageGeometryBit,
3 => ShaderStageFlags.ShaderStageTessellationControlBit,
4 => ShaderStageFlags.ShaderStageTessellationEvaluationBit,
_ => ShaderStageFlags.ShaderStageVertexBit | ShaderStageFlags.ShaderStageComputeBit
1 => ShaderStageFlags.FragmentBit,
2 => ShaderStageFlags.GeometryBit,
3 => ShaderStageFlags.TessellationControlBit,
4 => ShaderStageFlags.TessellationEvaluationBit,
_ => ShaderStageFlags.VertexBit | ShaderStageFlags.ComputeBit
};
void Set(DescriptorSetLayoutBinding* bindings, int maxPerStage, DescriptorType type, int start, int skip)
@ -93,7 +93,7 @@ namespace Ryujinx.Graphics.Vulkan
SType = StructureType.DescriptorSetLayoutCreateInfo,
PBindings = uLayoutBindings,
BindingCount = (uint)uCount,
Flags = usePd ? DescriptorSetLayoutCreateFlags.DescriptorSetLayoutCreatePushDescriptorBitKhr : 0
Flags = usePd ? DescriptorSetLayoutCreateFlags.PushDescriptorBitKhr : 0
};
var sDescriptorSetLayoutCreateInfo = new DescriptorSetLayoutCreateInfo()

View File

@ -41,7 +41,7 @@ namespace Ryujinx.Graphics.Vulkan.Queries
if (_isSupported)
{
QueryPipelineStatisticFlags flags = type == CounterType.PrimitivesGenerated ?
QueryPipelineStatisticFlags.QueryPipelineStatisticGeometryShaderPrimitivesBit : 0;
QueryPipelineStatisticFlags.GeometryShaderPrimitivesBit : 0;
var queryPoolCreateInfo = new QueryPoolCreateInfo()
{
@ -175,11 +175,11 @@ namespace Ryujinx.Graphics.Vulkan.Queries
{
var buffer = _buffer.GetBuffer(cbs.CommandBuffer, true).Get(cbs, 0, sizeof(long)).Value;
QueryResultFlags flags = QueryResultFlags.QueryResultWaitBit;
QueryResultFlags flags = QueryResultFlags.ResultWaitBit;
if (!_result32Bit)
{
flags |= QueryResultFlags.QueryResult64Bit;
flags |= QueryResultFlags.Result64Bit;
}
_api.CmdCopyQueryPoolResults(

View File

@ -15,9 +15,9 @@
<ItemGroup>
<PackageReference Include="OpenTK.Windowing.GraphicsLibraryFramework" Version="4.7.5" />
<PackageReference Include="shaderc.net" Version="0.1.0" />
<PackageReference Include="Silk.NET.Vulkan" Version="2.10.1" />
<PackageReference Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.10.1" />
<PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.10.1" />
<PackageReference Include="Silk.NET.Vulkan" Version="2.16.0" />
<PackageReference Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" />
<PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Threading.ThreadPool" Version="4.3.0" />

View File

@ -82,14 +82,14 @@ namespace Ryujinx.Graphics.Vulkan
stages |= 1u << shader.StageFlags switch
{
ShaderStageFlags.ShaderStageFragmentBit => 1,
ShaderStageFlags.ShaderStageGeometryBit => 2,
ShaderStageFlags.ShaderStageTessellationControlBit => 3,
ShaderStageFlags.ShaderStageTessellationEvaluationBit => 4,
ShaderStageFlags.FragmentBit => 1,
ShaderStageFlags.GeometryBit => 2,
ShaderStageFlags.TessellationControlBit => 3,
ShaderStageFlags.TessellationEvaluationBit => 4,
_ => 0
};
if (shader.StageFlags == ShaderStageFlags.ShaderStageComputeBit)
if (shader.StageFlags == ShaderStageFlags.ComputeBit)
{
IsCompute = true;
}

View File

@ -60,9 +60,9 @@ namespace Ryujinx.Graphics.Vulkan
commandBuffer,
srcImage,
TextureStorage.DefaultAccessMask,
AccessFlags.AccessTransferReadBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferReadBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.TransferBit,
srcAspectFlags,
srcLayer,
srcLevel,
@ -103,10 +103,10 @@ namespace Ryujinx.Graphics.Vulkan
api,
commandBuffer,
dstImage,
AccessFlags.AccessTransferWriteBit,
AccessFlags.TransferWriteBit,
TextureStorage.DefaultAccessMask,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.AllCommandsBit,
dstAspectFlags,
dstLayer,
dstLevel,
@ -285,9 +285,9 @@ namespace Ryujinx.Graphics.Vulkan
commandBuffer,
srcImage,
TextureStorage.DefaultAccessMask,
AccessFlags.AccessTransferReadBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferReadBit,
PipelineStageFlags.AllCommandsBit,
PipelineStageFlags.TransferBit,
srcAspect,
srcViewLayer + srcLayer,
srcViewLevel + srcLevel,
@ -345,10 +345,10 @@ namespace Ryujinx.Graphics.Vulkan
api,
commandBuffer,
dstImage,
AccessFlags.AccessTransferWriteBit,
AccessFlags.TransferWriteBit,
TextureStorage.DefaultAccessMask,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.AllCommandsBit,
dstAspect,
dstViewLayer + dstLayer,
dstViewLevel + dstLevel,
@ -370,8 +370,8 @@ namespace Ryujinx.Graphics.Vulkan
{
SType = StructureType.SubpassDescriptionDepthStencilResolve,
PDepthStencilResolveAttachment = &dsResolveAttachmentReference,
DepthResolveMode = ResolveModeFlags.ResolveModeSampleZeroBit,
StencilResolveMode = ResolveModeFlags.ResolveModeSampleZeroBit
DepthResolveMode = ResolveModeFlags.SampleZeroBit,
StencilResolveMode = ResolveModeFlags.SampleZeroBit
};
var subpass = new SubpassDescription2()

View File

@ -12,22 +12,22 @@ namespace Ryujinx.Graphics.Vulkan
class TextureStorage : IDisposable
{
private const MemoryPropertyFlags DefaultImageMemoryFlags =
MemoryPropertyFlags.MemoryPropertyDeviceLocalBit;
MemoryPropertyFlags.DeviceLocalBit;
private const ImageUsageFlags DefaultUsageFlags =
ImageUsageFlags.ImageUsageSampledBit |
ImageUsageFlags.ImageUsageTransferSrcBit |
ImageUsageFlags.ImageUsageTransferDstBit;
ImageUsageFlags.SampledBit |
ImageUsageFlags.TransferSrcBit |
ImageUsageFlags.TransferDstBit;
public const AccessFlags DefaultAccessMask =
AccessFlags.AccessShaderReadBit |
AccessFlags.AccessShaderWriteBit |
AccessFlags.AccessColorAttachmentReadBit |
AccessFlags.AccessColorAttachmentWriteBit |
AccessFlags.AccessDepthStencilAttachmentReadBit |
AccessFlags.AccessDepthStencilAttachmentWriteBit |
AccessFlags.AccessTransferReadBit |
AccessFlags.AccessTransferWriteBit;
AccessFlags.ShaderReadBit |
AccessFlags.ShaderWriteBit |
AccessFlags.ColorAttachmentReadBit |
AccessFlags.ColorAttachmentWriteBit |
AccessFlags.DepthStencilAttachmentReadBit |
AccessFlags.DepthStencilAttachmentWriteBit |
AccessFlags.TransferReadBit |
AccessFlags.TransferWriteBit;
private readonly VulkanRenderer _gd;
@ -83,32 +83,32 @@ namespace Ryujinx.Graphics.Vulkan
if (info.Format.IsDepthOrStencil())
{
usage |= ImageUsageFlags.ImageUsageDepthStencilAttachmentBit;
usage |= ImageUsageFlags.DepthStencilAttachmentBit;
}
else if (info.Format.IsRtColorCompatible())
{
usage |= ImageUsageFlags.ImageUsageColorAttachmentBit;
usage |= ImageUsageFlags.ColorAttachmentBit;
}
if (info.Format.IsImageCompatible())
{
usage |= ImageUsageFlags.ImageUsageStorageBit;
usage |= ImageUsageFlags.StorageBit;
}
var flags = ImageCreateFlags.ImageCreateMutableFormatBit;
var flags = ImageCreateFlags.CreateMutableFormatBit;
// This flag causes mipmapped texture arrays to break on AMD GCN, so for that copy dependencies are forced for aliasing as cube.
bool isCube = info.Target == Target.Cubemap || info.Target == Target.CubemapArray;
bool cubeCompatible = gd.IsAmdGcn ? isCube : (info.Width == info.Height && layers >= 6);
if (type == ImageType.ImageType2D && cubeCompatible)
if (type == ImageType.Type2D && cubeCompatible)
{
flags |= ImageCreateFlags.ImageCreateCubeCompatibleBit;
flags |= ImageCreateFlags.CreateCubeCompatibleBit;
}
if (type == ImageType.ImageType3D)
if (type == ImageType.Type3D)
{
flags |= ImageCreateFlags.ImageCreate2DArrayCompatibleBit;
flags |= ImageCreateFlags.Create2DArrayCompatibleBit;
}
var imageCreateInfo = new ImageCreateInfo()
@ -290,8 +290,8 @@ namespace Ryujinx.Graphics.Vulkan
_gd.Api.CmdPipelineBarrier(
cbs.CommandBuffer,
PipelineStageFlags.PipelineStageTopOfPipeBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.TopOfPipeBit,
PipelineStageFlags.AllCommandsBit,
0,
0,
null,
@ -308,9 +308,9 @@ namespace Ryujinx.Graphics.Vulkan
public static SampleCountFlags ConvertToSampleCountFlags(uint samples)
{
if (samples == 0 || samples > (uint)SampleCountFlags.SampleCount64Bit)
if (samples == 0 || samples > (uint)SampleCountFlags.Count64Bit)
{
return SampleCountFlags.SampleCount1Bit;
return SampleCountFlags.Count1Bit;
}
// Round up to the nearest power of two.
@ -428,7 +428,7 @@ namespace Ryujinx.Graphics.Vulkan
public void InsertBarrier(CommandBufferScoped cbs, AccessFlags dstAccessFlags, PipelineStageFlags dstStageFlags)
{
if (_lastModificationAccess != AccessFlags.AccessNoneKhr)
if (_lastModificationAccess != AccessFlags.NoneKhr)
{
ImageAspectFlags aspectFlags;
@ -436,20 +436,20 @@ namespace Ryujinx.Graphics.Vulkan
{
if (_info.Format == GAL.Format.S8Uint)
{
aspectFlags = ImageAspectFlags.ImageAspectStencilBit;
aspectFlags = ImageAspectFlags.StencilBit;
}
else if (_info.Format == GAL.Format.D16Unorm || _info.Format == GAL.Format.D32Float)
{
aspectFlags = ImageAspectFlags.ImageAspectDepthBit;
aspectFlags = ImageAspectFlags.DepthBit;
}
else
{
aspectFlags = ImageAspectFlags.ImageAspectDepthBit | ImageAspectFlags.ImageAspectStencilBit;
aspectFlags = ImageAspectFlags.DepthBit | ImageAspectFlags.StencilBit;
}
}
else
{
aspectFlags = ImageAspectFlags.ImageAspectColorBit;
aspectFlags = ImageAspectFlags.ColorBit;
}
TextureView.InsertImageBarrier(
@ -466,7 +466,7 @@ namespace Ryujinx.Graphics.Vulkan
_info.GetLayers(),
_info.Levels);
_lastModificationAccess = AccessFlags.AccessNoneKhr;
_lastModificationAccess = AccessFlags.NoneKhr;
}
}

View File

@ -126,7 +126,7 @@ namespace Ryujinx.Graphics.Vulkan
{
subresourceRange = new ImageSubresourceRange(aspectFlags, (uint)firstLevel, levels, (uint)firstLayer, (uint)info.Depth);
_imageView2dArray = CreateImageView(identityComponentMapping, subresourceRange, ImageViewType.ImageViewType2DArray);
_imageView2dArray = CreateImageView(identityComponentMapping, subresourceRange, ImageViewType.Type2DArray);
}
Valid = true;
@ -322,8 +322,8 @@ namespace Ryujinx.Graphics.Vulkan
return;
}
else if (_gd.FormatCapabilities.OptimalFormatSupports(FormatFeatureFlags.FormatFeatureBlitSrcBit, srcFormat) &&
_gd.FormatCapabilities.OptimalFormatSupports(FormatFeatureFlags.FormatFeatureBlitDstBit, dstFormat))
else if (_gd.FormatCapabilities.OptimalFormatSupports(FormatFeatureFlags.BlitSrcBit, srcFormat) &&
_gd.FormatCapabilities.OptimalFormatSupports(FormatFeatureFlags.BlitDstBit, dstFormat))
{
TextureCopy.Blit(
_gd.Api,
@ -402,8 +402,8 @@ namespace Ryujinx.Graphics.Vulkan
layers,
levels,
linearFilter,
ImageAspectFlags.ImageAspectColorBit,
ImageAspectFlags.ImageAspectColorBit);
ImageAspectFlags.ColorBit,
ImageAspectFlags.ColorBit);
}
private static void BlitDepthStencilWithBuffer(
@ -471,10 +471,10 @@ namespace Ryujinx.Graphics.Vulkan
gd,
cbs.CommandBuffer,
srcTempBuffer.GetBuffer().Get(cbs, 0, srcSize).Value,
AccessFlags.AccessTransferWriteBit,
AccessFlags.AccessTransferReadBit,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferWriteBit,
AccessFlags.TransferReadBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.TransferBit,
0,
srcSize);
@ -498,10 +498,10 @@ namespace Ryujinx.Graphics.Vulkan
gd.Api,
cbs.CommandBuffer,
srcTemp.GetImage().Get(cbs).Value,
AccessFlags.AccessTransferWriteBit,
AccessFlags.AccessTransferReadBit,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferWriteBit,
AccessFlags.TransferReadBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.TransferBit,
aspectFlags,
0,
0,
@ -531,10 +531,10 @@ namespace Ryujinx.Graphics.Vulkan
gd.Api,
cbs.CommandBuffer,
dstTemp.GetImage().Get(cbs).Value,
AccessFlags.AccessTransferWriteBit,
AccessFlags.AccessTransferReadBit,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferWriteBit,
AccessFlags.TransferReadBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.TransferBit,
aspectFlags,
0,
0,
@ -561,10 +561,10 @@ namespace Ryujinx.Graphics.Vulkan
gd,
cbs.CommandBuffer,
dstTempBuffer.GetBuffer().Get(cbs, 0, dstSize).Value,
AccessFlags.AccessTransferWriteBit,
AccessFlags.AccessTransferReadBit,
PipelineStageFlags.PipelineStageTransferBit,
PipelineStageFlags.PipelineStageTransferBit,
AccessFlags.TransferWriteBit,
AccessFlags.TransferReadBit,
PipelineStageFlags.TransferBit,
PipelineStageFlags.TransferBit,
0,
dstSize);
@ -585,8 +585,8 @@ namespace Ryujinx.Graphics.Vulkan
false);
}
SlowBlit(d32SrcStorage, d32DstStorage, ImageAspectFlags.ImageAspectDepthBit);
SlowBlit(s8SrcStorage, s8DstStorage, ImageAspectFlags.ImageAspectStencilBit);
SlowBlit(d32SrcStorage, d32DstStorage, ImageAspectFlags.DepthBit);
SlowBlit(s8SrcStorage, s8DstStorage, ImageAspectFlags.StencilBit);
}
public static unsafe void InsertImageBarrier(
@ -631,7 +631,7 @@ namespace Ryujinx.Graphics.Vulkan
private bool SupportsBlitFromD32FS8ToD32FAndS8()
{
var formatFeatureFlags = FormatFeatureFlags.FormatFeatureBlitSrcBit | FormatFeatureFlags.FormatFeatureBlitDstBit;
var formatFeatureFlags = FormatFeatureFlags.BlitSrcBit | FormatFeatureFlags.BlitDstBit;
return _gd.FormatCapabilities.OptimalFormatSupports(formatFeatureFlags, GAL.Format.D32Float) &&
_gd.FormatCapabilities.OptimalFormatSupports(formatFeatureFlags, GAL.Format.S8Uint);
}
@ -903,9 +903,9 @@ namespace Ryujinx.Graphics.Vulkan
var aspectFlags = Info.Format.ConvertAspectFlags();
if (aspectFlags == (ImageAspectFlags.ImageAspectDepthBit | ImageAspectFlags.ImageAspectStencilBit))
if (aspectFlags == (ImageAspectFlags.DepthBit | ImageAspectFlags.StencilBit))
{
aspectFlags = ImageAspectFlags.ImageAspectDepthBit;
aspectFlags = ImageAspectFlags.DepthBit;
}
var sl = new ImageSubresourceLayers(
@ -962,9 +962,9 @@ namespace Ryujinx.Graphics.Vulkan
{
var aspectFlags = Info.Format.ConvertAspectFlags();
if (aspectFlags == (ImageAspectFlags.ImageAspectDepthBit | ImageAspectFlags.ImageAspectStencilBit))
if (aspectFlags == (ImageAspectFlags.DepthBit | ImageAspectFlags.StencilBit))
{
aspectFlags = ImageAspectFlags.ImageAspectDepthBit;
aspectFlags = ImageAspectFlags.DepthBit;
}
var sl = new ImageSubresourceLayers(aspectFlags, (uint)(FirstLevel + dstLevel), (uint)(FirstLayer + dstLayer), 1);

View File

@ -159,20 +159,20 @@ namespace Ryujinx.Graphics.Vulkan
}
}
if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt))
if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.ErrorBitExt))
{
Logger.Error?.Print(LogClass.Gpu, msg);
//throw new Exception(msg);
}
else if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityWarningBitExt))
else if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.WarningBitExt))
{
Logger.Warning?.Print(LogClass.Gpu, msg);
}
else if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityInfoBitExt))
else if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.InfoBitExt))
{
Logger.Info?.Print(LogClass.Gpu, msg);
}
else // if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityVerboseBitExt))
else // if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.VerboseBitExt))
{
Logger.Debug?.Print(LogClass.Gpu, msg);
}
@ -317,7 +317,7 @@ namespace Ryujinx.Graphics.Vulkan
internal static uint FindSuitableQueueFamily(Vk api, PhysicalDevice physicalDevice, SurfaceKHR surface, out uint queueCount)
{
const QueueFlags RequiredFlags = QueueFlags.QueueGraphicsBit | QueueFlags.QueueComputeBit;
const QueueFlags RequiredFlags = QueueFlags.GraphicsBit | QueueFlags.ComputeBit;
var khrSurface = new KhrSurface(api.Context);
@ -561,24 +561,24 @@ namespace Ryujinx.Graphics.Vulkan
var filterLogType = logLevel switch
{
GraphicsDebugLevel.Error => DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeValidationBitExt,
GraphicsDebugLevel.Slowdowns => DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeValidationBitExt |
DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypePerformanceBitExt,
GraphicsDebugLevel.All => DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeGeneralBitExt |
DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeValidationBitExt |
DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypePerformanceBitExt,
GraphicsDebugLevel.Error => DebugUtilsMessageTypeFlagsEXT.ValidationBitExt,
GraphicsDebugLevel.Slowdowns => DebugUtilsMessageTypeFlagsEXT.ValidationBitExt |
DebugUtilsMessageTypeFlagsEXT.PerformanceBitExt,
GraphicsDebugLevel.All => DebugUtilsMessageTypeFlagsEXT.GeneralBitExt |
DebugUtilsMessageTypeFlagsEXT.ValidationBitExt |
DebugUtilsMessageTypeFlagsEXT.PerformanceBitExt,
_ => throw new ArgumentException($"Invalid log level \"{logLevel}\".")
};
var filterLogSeverity = logLevel switch
{
GraphicsDebugLevel.Error => DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt,
GraphicsDebugLevel.Slowdowns => DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt |
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityWarningBitExt,
GraphicsDebugLevel.All => DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityInfoBitExt |
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityWarningBitExt |
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityVerboseBitExt |
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt,
GraphicsDebugLevel.Error => DebugUtilsMessageSeverityFlagsEXT.ErrorBitExt,
GraphicsDebugLevel.Slowdowns => DebugUtilsMessageSeverityFlagsEXT.ErrorBitExt |
DebugUtilsMessageSeverityFlagsEXT.WarningBitExt,
GraphicsDebugLevel.All => DebugUtilsMessageSeverityFlagsEXT.InfoBitExt |
DebugUtilsMessageSeverityFlagsEXT.WarningBitExt |
DebugUtilsMessageSeverityFlagsEXT.VerboseBitExt |
DebugUtilsMessageSeverityFlagsEXT.ErrorBitExt,
_ => throw new ArgumentException($"Invalid log level \"{logLevel}\".")
};

View File

@ -341,11 +341,11 @@ namespace Ryujinx.Graphics.Vulkan
public unsafe Capabilities GetCapabilities()
{
FormatFeatureFlags compressedFormatFeatureFlags =
FormatFeatureFlags.FormatFeatureSampledImageBit |
FormatFeatureFlags.FormatFeatureSampledImageFilterLinearBit |
FormatFeatureFlags.FormatFeatureBlitSrcBit |
FormatFeatureFlags.FormatFeatureTransferSrcBit |
FormatFeatureFlags.FormatFeatureTransferDstBit;
FormatFeatureFlags.SampledImageBit |
FormatFeatureFlags.SampledImageFilterLinearBit |
FormatFeatureFlags.BlitSrcBit |
FormatFeatureFlags.TransferSrcBit |
FormatFeatureFlags.TransferDstBit;
bool supportsBc123CompressionFormat = FormatCapabilities.OptimalFormatsSupport(compressedFormatFeatureFlags,
GAL.Format.Bc1RgbaSrgb,

View File

@ -109,11 +109,11 @@ namespace Ryujinx.Graphics.Vulkan
ImageFormat = surfaceFormat.Format,
ImageColorSpace = surfaceFormat.ColorSpace,
ImageExtent = extent,
ImageUsage = ImageUsageFlags.ImageUsageColorAttachmentBit | ImageUsageFlags.ImageUsageTransferDstBit,
ImageUsage = ImageUsageFlags.ColorAttachmentBit | ImageUsageFlags.TransferDstBit,
ImageSharingMode = SharingMode.Exclusive,
ImageArrayLayers = 1,
PreTransform = capabilities.CurrentTransform,
CompositeAlpha = CompositeAlphaFlagsKHR.CompositeAlphaOpaqueBitKhr,
CompositeAlpha = CompositeAlphaFlagsKHR.OpaqueBitKhr,
PresentMode = ChooseSwapPresentMode(presentModes, _vsyncEnabled),
Clipped = true,
OldSwapchain = oldSwapchain
@ -146,7 +146,7 @@ namespace Ryujinx.Graphics.Vulkan
ComponentSwizzle.B,
ComponentSwizzle.A);
var aspectFlags = ImageAspectFlags.ImageAspectColorBit;
var aspectFlags = ImageAspectFlags.ColorBit;
var subresourceRange = new ImageSubresourceRange(aspectFlags, 0, 1, 0, 1);
@ -154,7 +154,7 @@ namespace Ryujinx.Graphics.Vulkan
{
SType = StructureType.ImageViewCreateInfo,
Image = swapchainImage,
ViewType = ImageViewType.ImageViewType2D,
ViewType = ImageViewType.Type2D,
Format = format,
Components = componentMapping,
SubresourceRange = subresourceRange
@ -168,12 +168,12 @@ namespace Ryujinx.Graphics.Vulkan
{
if (availableFormats.Length == 1 && availableFormats[0].Format == VkFormat.Undefined)
{
return new SurfaceFormatKHR(VkFormat.B8G8R8A8Unorm, ColorSpaceKHR.ColorspaceSrgbNonlinearKhr);
return new SurfaceFormatKHR(VkFormat.B8G8R8A8Unorm, ColorSpaceKHR.PaceSrgbNonlinearKhr);
}
foreach (var format in availableFormats)
{
if (format.Format == VkFormat.B8G8R8A8Unorm && format.ColorSpace == ColorSpaceKHR.ColorspaceSrgbNonlinearKhr)
if (format.Format == VkFormat.B8G8R8A8Unorm && format.ColorSpace == ColorSpaceKHR.PaceSrgbNonlinearKhr)
{
return format;
}
@ -184,21 +184,21 @@ namespace Ryujinx.Graphics.Vulkan
private static PresentModeKHR ChooseSwapPresentMode(PresentModeKHR[] availablePresentModes, bool vsyncEnabled)
{
if (!vsyncEnabled && availablePresentModes.Contains(PresentModeKHR.PresentModeImmediateKhr))
if (!vsyncEnabled && availablePresentModes.Contains(PresentModeKHR.ImmediateKhr))
{
return PresentModeKHR.PresentModeImmediateKhr;
return PresentModeKHR.ImmediateKhr;
}
else if (availablePresentModes.Contains(PresentModeKHR.PresentModeMailboxKhr))
else if (availablePresentModes.Contains(PresentModeKHR.MailboxKhr))
{
return PresentModeKHR.PresentModeMailboxKhr;
return PresentModeKHR.MailboxKhr;
}
else if (availablePresentModes.Contains(PresentModeKHR.PresentModeFifoKhr))
else if (availablePresentModes.Contains(PresentModeKHR.FifoKhr))
{
return PresentModeKHR.PresentModeFifoKhr;
return PresentModeKHR.FifoKhr;
}
else
{
return PresentModeKHR.PresentModeFifoKhr;
return PresentModeKHR.FifoKhr;
}
}
@ -254,7 +254,7 @@ namespace Ryujinx.Graphics.Vulkan
cbs.CommandBuffer,
swapchainImage,
0,
AccessFlags.AccessTransferWriteBit,
AccessFlags.TransferWriteBit,
ImageLayout.Undefined,
ImageLayout.General);
@ -339,7 +339,7 @@ namespace Ryujinx.Graphics.Vulkan
_gd.CommandBufferPool.Return(
cbs,
stackalloc[] { _imageAvailableSemaphore },
stackalloc[] { PipelineStageFlags.PipelineStageColorAttachmentOutputBit },
stackalloc[] { PipelineStageFlags.ColorAttachmentOutputBit },
stackalloc[] { _renderFinishedSemaphore });
// TODO: Present queue.
@ -373,7 +373,7 @@ namespace Ryujinx.Graphics.Vulkan
ImageLayout srcLayout,
ImageLayout dstLayout)
{
var subresourceRange = new ImageSubresourceRange(ImageAspectFlags.ImageAspectColorBit, 0, 1, 0, 1);
var subresourceRange = new ImageSubresourceRange(ImageAspectFlags.ColorBit, 0, 1, 0, 1);
var barrier = new ImageMemoryBarrier()
{
@ -390,8 +390,8 @@ namespace Ryujinx.Graphics.Vulkan
_gd.Api.CmdPipelineBarrier(
commandBuffer,
PipelineStageFlags.PipelineStageTopOfPipeBit,
PipelineStageFlags.PipelineStageAllCommandsBit,
PipelineStageFlags.TopOfPipeBit,
PipelineStageFlags.AllCommandsBit,
0,
0,
null,