forked from Mirror/Ryujinx
chore: Update Silk.NET to 2.16.0 (#3953)
This commit is contained in:
parent
456fc04007
commit
ce92e8cd04
24 changed files with 293 additions and 293 deletions
|
@ -33,9 +33,9 @@
|
||||||
<PackageReference Include="OpenTK.Core" Version="4.7.5" />
|
<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.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="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" Version="2.16.0" />
|
||||||
<PackageReference Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.10.1" />
|
<PackageReference Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" />
|
||||||
<PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.10.1" />
|
<PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" />
|
||||||
<PackageReference Include="SPB" Version="0.0.4-build28" />
|
<PackageReference Include="SPB" Version="0.0.4-build28" />
|
||||||
<PackageReference Include="SharpZipLib" Version="1.4.1" />
|
<PackageReference Include="SharpZipLib" Version="1.4.1" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
|
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
|
||||||
|
|
|
@ -12,12 +12,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
private const int MaxUpdateBufferSize = 0x10000;
|
private const int MaxUpdateBufferSize = 0x10000;
|
||||||
|
|
||||||
public const AccessFlags DefaultAccessFlags =
|
public const AccessFlags DefaultAccessFlags =
|
||||||
AccessFlags.AccessIndirectCommandReadBit |
|
AccessFlags.IndirectCommandReadBit |
|
||||||
AccessFlags.AccessShaderReadBit |
|
AccessFlags.ShaderReadBit |
|
||||||
AccessFlags.AccessShaderWriteBit |
|
AccessFlags.ShaderWriteBit |
|
||||||
AccessFlags.AccessTransferReadBit |
|
AccessFlags.TransferReadBit |
|
||||||
AccessFlags.AccessTransferWriteBit |
|
AccessFlags.TransferWriteBit |
|
||||||
AccessFlags.AccessUniformReadBit;
|
AccessFlags.UniformReadBit;
|
||||||
|
|
||||||
private readonly VulkanRenderer _gd;
|
private readonly VulkanRenderer _gd;
|
||||||
private readonly Device _device;
|
private readonly Device _device;
|
||||||
|
@ -87,9 +87,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
_gd.Api.CmdPipelineBarrier(
|
_gd.Api.CmdPipelineBarrier(
|
||||||
commandBuffer,
|
commandBuffer,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
DependencyFlags.DependencyDeviceGroupBit,
|
DependencyFlags.DeviceGroupBit,
|
||||||
1,
|
1,
|
||||||
memoryBarrier,
|
memoryBarrier,
|
||||||
0,
|
0,
|
||||||
|
@ -273,9 +273,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dstBuffer,
|
dstBuffer,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
dstOffset,
|
dstOffset,
|
||||||
data.Length);
|
data.Length);
|
||||||
|
|
||||||
|
@ -293,10 +293,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
_gd,
|
_gd,
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dstBuffer,
|
dstBuffer,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
dstOffset,
|
dstOffset,
|
||||||
data.Length);
|
data.Length);
|
||||||
|
|
||||||
|
@ -320,9 +320,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dstBuffer,
|
dstBuffer,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
dstOffset,
|
dstOffset,
|
||||||
size);
|
size);
|
||||||
|
|
||||||
|
@ -334,10 +334,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
gd,
|
gd,
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dstBuffer,
|
dstBuffer,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
dstOffset,
|
dstOffset,
|
||||||
size);
|
size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,28 +10,28 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
class BufferManager : IDisposable
|
class BufferManager : IDisposable
|
||||||
{
|
{
|
||||||
private const MemoryPropertyFlags DefaultBufferMemoryFlags =
|
private const MemoryPropertyFlags DefaultBufferMemoryFlags =
|
||||||
MemoryPropertyFlags.MemoryPropertyHostVisibleBit |
|
MemoryPropertyFlags.HostVisibleBit |
|
||||||
MemoryPropertyFlags.MemoryPropertyHostCoherentBit |
|
MemoryPropertyFlags.HostCoherentBit |
|
||||||
MemoryPropertyFlags.MemoryPropertyHostCachedBit;
|
MemoryPropertyFlags.HostCachedBit;
|
||||||
|
|
||||||
private const MemoryPropertyFlags DeviceLocalBufferMemoryFlags =
|
private const MemoryPropertyFlags DeviceLocalBufferMemoryFlags =
|
||||||
MemoryPropertyFlags.MemoryPropertyDeviceLocalBit;
|
MemoryPropertyFlags.DeviceLocalBit;
|
||||||
|
|
||||||
private const MemoryPropertyFlags FlushableDeviceLocalBufferMemoryFlags =
|
private const MemoryPropertyFlags FlushableDeviceLocalBufferMemoryFlags =
|
||||||
MemoryPropertyFlags.MemoryPropertyHostVisibleBit |
|
MemoryPropertyFlags.HostVisibleBit |
|
||||||
MemoryPropertyFlags.MemoryPropertyHostCoherentBit |
|
MemoryPropertyFlags.HostCoherentBit |
|
||||||
MemoryPropertyFlags.MemoryPropertyDeviceLocalBit;
|
MemoryPropertyFlags.DeviceLocalBit;
|
||||||
|
|
||||||
private const BufferUsageFlags DefaultBufferUsageFlags =
|
private const BufferUsageFlags DefaultBufferUsageFlags =
|
||||||
BufferUsageFlags.BufferUsageTransferSrcBit |
|
BufferUsageFlags.TransferSrcBit |
|
||||||
BufferUsageFlags.BufferUsageTransferDstBit |
|
BufferUsageFlags.TransferDstBit |
|
||||||
BufferUsageFlags.BufferUsageUniformTexelBufferBit |
|
BufferUsageFlags.UniformTexelBufferBit |
|
||||||
BufferUsageFlags.BufferUsageStorageTexelBufferBit |
|
BufferUsageFlags.StorageTexelBufferBit |
|
||||||
BufferUsageFlags.BufferUsageUniformBufferBit |
|
BufferUsageFlags.UniformBufferBit |
|
||||||
BufferUsageFlags.BufferUsageStorageBufferBit |
|
BufferUsageFlags.StorageBufferBit |
|
||||||
BufferUsageFlags.BufferUsageIndexBufferBit |
|
BufferUsageFlags.IndexBufferBit |
|
||||||
BufferUsageFlags.BufferUsageVertexBufferBit |
|
BufferUsageFlags.VertexBufferBit |
|
||||||
BufferUsageFlags.BufferUsageTransformFeedbackBufferBitExt;
|
BufferUsageFlags.TransformFeedbackBufferBitExt;
|
||||||
|
|
||||||
private readonly PhysicalDevice _physicalDevice;
|
private readonly PhysicalDevice _physicalDevice;
|
||||||
private readonly Device _device;
|
private readonly Device _device;
|
||||||
|
@ -76,11 +76,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
if (forConditionalRendering && gd.Capabilities.SupportsConditionalRendering)
|
if (forConditionalRendering && gd.Capabilities.SupportsConditionalRendering)
|
||||||
{
|
{
|
||||||
usage |= BufferUsageFlags.BufferUsageConditionalRenderingBitExt;
|
usage |= BufferUsageFlags.ConditionalRenderingBitExt;
|
||||||
}
|
}
|
||||||
else if (gd.Capabilities.SupportsIndirectParameters)
|
else if (gd.Capabilities.SupportsIndirectParameters)
|
||||||
{
|
{
|
||||||
usage |= BufferUsageFlags.BufferUsageIndirectBufferBit;
|
usage |= BufferUsageFlags.IndirectBufferBit;
|
||||||
}
|
}
|
||||||
|
|
||||||
var bufferCreateInfo = new BufferCreateInfo()
|
var bufferCreateInfo = new BufferCreateInfo()
|
||||||
|
|
|
@ -71,8 +71,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
SType = StructureType.CommandPoolCreateInfo,
|
SType = StructureType.CommandPoolCreateInfo,
|
||||||
QueueFamilyIndex = queueFamilyIndex,
|
QueueFamilyIndex = queueFamilyIndex,
|
||||||
Flags = CommandPoolCreateFlags.CommandPoolCreateTransientBit |
|
Flags = CommandPoolCreateFlags.TransientBit |
|
||||||
CommandPoolCreateFlags.CommandPoolCreateResetCommandBufferBit
|
CommandPoolCreateFlags.ResetCommandBufferBit
|
||||||
};
|
};
|
||||||
|
|
||||||
api.CreateCommandPool(device, commandPoolCreateInfo, null, out _pool).ThrowOnError();
|
api.CreateCommandPool(device, commandPoolCreateInfo, null, out _pool).ThrowOnError();
|
||||||
|
|
|
@ -229,7 +229,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
}
|
}
|
||||||
else if (texture is TextureView view)
|
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();
|
_textureRefs[binding] = view.GetImageView();
|
||||||
_samplerRefs[binding] = ((SamplerHolder)sampler)?.GetSampler();
|
_samplerRefs[binding] = ((SamplerHolder)sampler)?.GetSampler();
|
||||||
|
|
|
@ -12,12 +12,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
return stage switch
|
return stage switch
|
||||||
{
|
{
|
||||||
ShaderStage.Vertex => ShaderStageFlags.ShaderStageVertexBit,
|
ShaderStage.Vertex => ShaderStageFlags.VertexBit,
|
||||||
ShaderStage.Geometry => ShaderStageFlags.ShaderStageGeometryBit,
|
ShaderStage.Geometry => ShaderStageFlags.GeometryBit,
|
||||||
ShaderStage.TessellationControl => ShaderStageFlags.ShaderStageTessellationControlBit,
|
ShaderStage.TessellationControl => ShaderStageFlags.TessellationControlBit,
|
||||||
ShaderStage.TessellationEvaluation => ShaderStageFlags.ShaderStageTessellationEvaluationBit,
|
ShaderStage.TessellationEvaluation => ShaderStageFlags.TessellationEvaluationBit,
|
||||||
ShaderStage.Fragment => ShaderStageFlags.ShaderStageFragmentBit,
|
ShaderStage.Fragment => ShaderStageFlags.FragmentBit,
|
||||||
ShaderStage.Compute => ShaderStageFlags.ShaderStageComputeBit,
|
ShaderStage.Compute => ShaderStageFlags.ComputeBit,
|
||||||
_ => LogInvalidAndReturn(stage, nameof(ShaderStage), (ShaderStageFlags)0)
|
_ => LogInvalidAndReturn(stage, nameof(ShaderStage), (ShaderStageFlags)0)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -26,12 +26,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
return stage switch
|
return stage switch
|
||||||
{
|
{
|
||||||
ShaderStage.Vertex => PipelineStageFlags.PipelineStageVertexShaderBit,
|
ShaderStage.Vertex => PipelineStageFlags.VertexShaderBit,
|
||||||
ShaderStage.Geometry => PipelineStageFlags.PipelineStageGeometryShaderBit,
|
ShaderStage.Geometry => PipelineStageFlags.GeometryShaderBit,
|
||||||
ShaderStage.TessellationControl => PipelineStageFlags.PipelineStageTessellationControlShaderBit,
|
ShaderStage.TessellationControl => PipelineStageFlags.TessellationControlShaderBit,
|
||||||
ShaderStage.TessellationEvaluation => PipelineStageFlags.PipelineStageTessellationEvaluationShaderBit,
|
ShaderStage.TessellationEvaluation => PipelineStageFlags.TessellationEvaluationShaderBit,
|
||||||
ShaderStage.Fragment => PipelineStageFlags.PipelineStageFragmentShaderBit,
|
ShaderStage.Fragment => PipelineStageFlags.FragmentShaderBit,
|
||||||
ShaderStage.Compute => PipelineStageFlags.PipelineStageComputeShaderBit,
|
ShaderStage.Compute => PipelineStageFlags.ComputeShaderBit,
|
||||||
_ => LogInvalidAndReturn(stage, nameof(ShaderStage), (PipelineStageFlags)0)
|
_ => LogInvalidAndReturn(stage, nameof(ShaderStage), (PipelineStageFlags)0)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -112,10 +112,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
return face switch
|
return face switch
|
||||||
{
|
{
|
||||||
Face.Back => CullModeFlags.CullModeBackBit,
|
Face.Back => CullModeFlags.BackBit,
|
||||||
Face.Front => CullModeFlags.CullModeFrontBit,
|
Face.Front => CullModeFlags.FrontBit,
|
||||||
Face.FrontAndBack => CullModeFlags.CullModeFrontAndBack,
|
Face.FrontAndBack => CullModeFlags.FrontAndBack,
|
||||||
_ => LogInvalidAndReturn(face, nameof(Face), CullModeFlags.CullModeBackBit)
|
_ => LogInvalidAndReturn(face, nameof(Face), CullModeFlags.BackBit)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,14 +223,14 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
Target.Texture1D or
|
Target.Texture1D or
|
||||||
Target.Texture1DArray or
|
Target.Texture1DArray or
|
||||||
Target.TextureBuffer => ImageType.ImageType1D,
|
Target.TextureBuffer => ImageType.Type1D,
|
||||||
Target.Texture2D or
|
Target.Texture2D or
|
||||||
Target.Texture2DArray or
|
Target.Texture2DArray or
|
||||||
Target.Texture2DMultisample or
|
Target.Texture2DMultisample or
|
||||||
Target.Cubemap or
|
Target.Cubemap or
|
||||||
Target.CubemapArray => ImageType.ImageType2D,
|
Target.CubemapArray => ImageType.Type2D,
|
||||||
Target.Texture3D => ImageType.ImageType3D,
|
Target.Texture3D => ImageType.Type3D,
|
||||||
_ => LogInvalidAndReturn(target, nameof(Target), ImageType.ImageType2D)
|
_ => LogInvalidAndReturn(target, nameof(Target), ImageType.Type2D)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,14 +238,14 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
return target switch
|
return target switch
|
||||||
{
|
{
|
||||||
Target.Texture1D => ImageViewType.ImageViewType1D,
|
Target.Texture1D => ImageViewType.Type1D,
|
||||||
Target.Texture2D or Target.Texture2DMultisample => ImageViewType.ImageViewType2D,
|
Target.Texture2D or Target.Texture2DMultisample => ImageViewType.Type2D,
|
||||||
Target.Texture3D => ImageViewType.ImageViewType3D,
|
Target.Texture3D => ImageViewType.Type3D,
|
||||||
Target.Texture1DArray => ImageViewType.ImageViewType1DArray,
|
Target.Texture1DArray => ImageViewType.Type1DArray,
|
||||||
Target.Texture2DArray => ImageViewType.ImageViewType2DArray,
|
Target.Texture2DArray => ImageViewType.Type2DArray,
|
||||||
Target.Cubemap => ImageViewType.Cube,
|
Target.Cubemap => ImageViewType.TypeCube,
|
||||||
Target.CubemapArray => ImageViewType.CubeArray,
|
Target.CubemapArray => ImageViewType.TypeCubeArray,
|
||||||
_ => LogInvalidAndReturn(target, nameof(Target), ImageViewType.ImageViewType2D)
|
_ => LogInvalidAndReturn(target, nameof(Target), ImageViewType.Type2D)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,12 +253,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
return format switch
|
return format switch
|
||||||
{
|
{
|
||||||
GAL.Format.D16Unorm or GAL.Format.D32Float => ImageAspectFlags.ImageAspectDepthBit,
|
GAL.Format.D16Unorm or GAL.Format.D32Float => ImageAspectFlags.DepthBit,
|
||||||
GAL.Format.S8Uint => ImageAspectFlags.ImageAspectStencilBit,
|
GAL.Format.S8Uint => ImageAspectFlags.StencilBit,
|
||||||
GAL.Format.D24UnormS8Uint or
|
GAL.Format.D24UnormS8Uint or
|
||||||
GAL.Format.D32FloatS8Uint or
|
GAL.Format.D32FloatS8Uint or
|
||||||
GAL.Format.S8UintD24Unorm => ImageAspectFlags.ImageAspectDepthBit | ImageAspectFlags.ImageAspectStencilBit,
|
GAL.Format.S8UintD24Unorm => ImageAspectFlags.DepthBit | ImageAspectFlags.StencilBit,
|
||||||
_ => ImageAspectFlags.ImageAspectColorBit
|
_ => ImageAspectFlags.ColorBit
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,12 +266,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
return format switch
|
return format switch
|
||||||
{
|
{
|
||||||
GAL.Format.D16Unorm or GAL.Format.D32Float => ImageAspectFlags.ImageAspectDepthBit,
|
GAL.Format.D16Unorm or GAL.Format.D32Float => ImageAspectFlags.DepthBit,
|
||||||
GAL.Format.S8Uint => ImageAspectFlags.ImageAspectStencilBit,
|
GAL.Format.S8Uint => ImageAspectFlags.StencilBit,
|
||||||
GAL.Format.D24UnormS8Uint or
|
GAL.Format.D24UnormS8Uint or
|
||||||
GAL.Format.D32FloatS8Uint or
|
GAL.Format.D32FloatS8Uint or
|
||||||
GAL.Format.S8UintD24Unorm => depthStencilMode == DepthStencilMode.Stencil ? ImageAspectFlags.ImageAspectStencilBit : ImageAspectFlags.ImageAspectDepthBit,
|
GAL.Format.S8UintD24Unorm => depthStencilMode == DepthStencilMode.Stencil ? ImageAspectFlags.StencilBit : ImageAspectFlags.DepthBit,
|
||||||
_ => ImageAspectFlags.ImageAspectColorBit
|
_ => ImageAspectFlags.ColorBit
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,22 +83,22 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
var format = FormatTable.GetFormat(srcFormat);
|
var format = FormatTable.GetFormat(srcFormat);
|
||||||
|
|
||||||
var requiredFeatures = FormatFeatureFlags.FormatFeatureSampledImageBit |
|
var requiredFeatures = FormatFeatureFlags.SampledImageBit |
|
||||||
FormatFeatureFlags.FormatFeatureTransferSrcBit |
|
FormatFeatureFlags.TransferSrcBit |
|
||||||
FormatFeatureFlags.FormatFeatureTransferDstBit;
|
FormatFeatureFlags.TransferDstBit;
|
||||||
|
|
||||||
if (srcFormat.IsDepthOrStencil())
|
if (srcFormat.IsDepthOrStencil())
|
||||||
{
|
{
|
||||||
requiredFeatures |= FormatFeatureFlags.FormatFeatureDepthStencilAttachmentBit;
|
requiredFeatures |= FormatFeatureFlags.DepthStencilAttachmentBit;
|
||||||
}
|
}
|
||||||
else if (srcFormat.IsRtColorCompatible())
|
else if (srcFormat.IsRtColorCompatible())
|
||||||
{
|
{
|
||||||
requiredFeatures |= FormatFeatureFlags.FormatFeatureColorAttachmentBit;
|
requiredFeatures |= FormatFeatureFlags.ColorAttachmentBit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (srcFormat.IsImageCompatible())
|
if (srcFormat.IsImageCompatible())
|
||||||
{
|
{
|
||||||
requiredFeatures |= FormatFeatureFlags.FormatFeatureStorageImageBit;
|
requiredFeatures |= FormatFeatureFlags.StorageImageBit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!OptimalFormatSupports(requiredFeatures, srcFormat) || (IsD24S8(srcFormat) && VulkanConfiguration.ForceD24S8Unsupported))
|
if (!OptimalFormatSupports(requiredFeatures, srcFormat) || (IsD24S8(srcFormat) && VulkanConfiguration.ForceD24S8Unsupported))
|
||||||
|
@ -125,7 +125,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
var format = FormatTable.GetFormat(srcFormat);
|
var format = FormatTable.GetFormat(srcFormat);
|
||||||
|
|
||||||
if (!BufferFormatSupports(FormatFeatureFlags.FormatFeatureVertexBufferBit, srcFormat) ||
|
if (!BufferFormatSupports(FormatFeatureFlags.VertexBufferBit, srcFormat) ||
|
||||||
(IsRGB16IntFloat(srcFormat) && VulkanConfiguration.ForceRGB16IntFloatUnsupported))
|
(IsRGB16IntFloat(srcFormat) && VulkanConfiguration.ForceRGB16IntFloatUnsupported))
|
||||||
{
|
{
|
||||||
// The format is not supported. Can we convert it to an alternative format?
|
// The format is not supported. Can we convert it to an alternative format?
|
||||||
|
|
|
@ -190,14 +190,14 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
for (int index = 0; index < _colors.Length; index++)
|
for (int index = 0; index < _colors.Length; index++)
|
||||||
{
|
{
|
||||||
_colors[index].Storage.SetModification(
|
_colors[index].Storage.SetModification(
|
||||||
AccessFlags.AccessColorAttachmentWriteBit,
|
AccessFlags.ColorAttachmentWriteBit,
|
||||||
PipelineStageFlags.PipelineStageColorAttachmentOutputBit);
|
PipelineStageFlags.ColorAttachmentOutputBit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_depthStencil?.Storage.SetModification(
|
_depthStencil?.Storage.SetModification(
|
||||||
AccessFlags.AccessDepthStencilAttachmentWriteBit,
|
AccessFlags.DepthStencilAttachmentWriteBit,
|
||||||
PipelineStageFlags.PipelineStageColorAttachmentOutputBit);
|
PipelineStageFlags.ColorAttachmentOutputBit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -349,8 +349,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
var srcBuffer = srcBufferAuto.Get(cbs, srcOffset, size).Value;
|
var srcBuffer = srcBufferAuto.Get(cbs, srcOffset, size).Value;
|
||||||
var dstBuffer = dstBufferAuto.Get(cbs, 0, newSize).Value;
|
var dstBuffer = dstBufferAuto.Get(cbs, 0, newSize).Value;
|
||||||
|
|
||||||
var access = supportsUint8 ? AccessFlags.AccessShaderWriteBit : AccessFlags.AccessTransferWriteBit;
|
var access = supportsUint8 ? AccessFlags.ShaderWriteBit : AccessFlags.TransferWriteBit;
|
||||||
var stage = supportsUint8 ? PipelineStageFlags.PipelineStageComputeShaderBit : PipelineStageFlags.PipelineStageTransferBit;
|
var stage = supportsUint8 ? PipelineStageFlags.ComputeShaderBit : PipelineStageFlags.TransferBit;
|
||||||
|
|
||||||
BufferHolder.InsertBufferBarrier(
|
BufferHolder.InsertBufferBarrier(
|
||||||
gd,
|
gd,
|
||||||
|
@ -358,7 +358,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
dstBuffer,
|
dstBuffer,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
access,
|
access,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
stage,
|
stage,
|
||||||
0,
|
0,
|
||||||
newSize);
|
newSize);
|
||||||
|
@ -420,7 +420,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
access,
|
access,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
stage,
|
stage,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
0,
|
0,
|
||||||
newSize);
|
newSize);
|
||||||
}
|
}
|
||||||
|
@ -484,9 +484,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dstBuffer,
|
dstBuffer,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
0,
|
0,
|
||||||
convertedCount * outputIndexSize);
|
convertedCount * outputIndexSize);
|
||||||
|
|
||||||
|
@ -499,10 +499,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
gd,
|
gd,
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dstBuffer,
|
dstBuffer,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
0,
|
0,
|
||||||
convertedCount * outputIndexSize);
|
convertedCount * outputIndexSize);
|
||||||
}
|
}
|
||||||
|
@ -548,10 +548,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
src.GetImage().Get(cbs).Value,
|
src.GetImage().Get(cbs).Value,
|
||||||
TextureStorage.DefaultAccessMask,
|
TextureStorage.DefaultAccessMask,
|
||||||
AccessFlags.AccessShaderReadBit,
|
AccessFlags.ShaderReadBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageComputeShaderBit,
|
PipelineStageFlags.ComputeShaderBit,
|
||||||
ImageAspectFlags.ImageAspectColorBit,
|
ImageAspectFlags.ColorBit,
|
||||||
src.FirstLayer + srcLayer,
|
src.FirstLayer + srcLayer,
|
||||||
src.FirstLevel,
|
src.FirstLevel,
|
||||||
depth,
|
depth,
|
||||||
|
@ -610,11 +610,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
gd.Api,
|
gd.Api,
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dst.GetImage().Get(cbs).Value,
|
dst.GetImage().Get(cbs).Value,
|
||||||
AccessFlags.AccessShaderWriteBit,
|
AccessFlags.ShaderWriteBit,
|
||||||
TextureStorage.DefaultAccessMask,
|
TextureStorage.DefaultAccessMask,
|
||||||
PipelineStageFlags.PipelineStageComputeShaderBit,
|
PipelineStageFlags.ComputeShaderBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
ImageAspectFlags.ImageAspectColorBit,
|
ImageAspectFlags.ColorBit,
|
||||||
dst.FirstLayer + dstLayer,
|
dst.FirstLayer + dstLayer,
|
||||||
dst.FirstLevel,
|
dst.FirstLevel,
|
||||||
depth,
|
depth,
|
||||||
|
@ -770,9 +770,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
srcIndirectBuffer.GetBuffer().Get(cbs, srcIndirectBufferOffset, indirectDataSize).Value,
|
srcIndirectBuffer.GetBuffer().Get(cbs, srcIndirectBufferOffset, indirectDataSize).Value,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
AccessFlags.AccessShaderReadBit,
|
AccessFlags.ShaderReadBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageComputeShaderBit,
|
PipelineStageFlags.ComputeShaderBit,
|
||||||
srcIndirectBufferOffset,
|
srcIndirectBufferOffset,
|
||||||
indirectDataSize);
|
indirectDataSize);
|
||||||
|
|
||||||
|
@ -786,10 +786,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
gd,
|
gd,
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
patternBufferAuto.Get(cbs, ParamsIndirectDispatchOffset, ParamsIndirectDispatchSize).Value,
|
patternBufferAuto.Get(cbs, ParamsIndirectDispatchOffset, ParamsIndirectDispatchSize).Value,
|
||||||
AccessFlags.AccessShaderWriteBit,
|
AccessFlags.ShaderWriteBit,
|
||||||
AccessFlags.AccessIndirectCommandReadBit,
|
AccessFlags.IndirectCommandReadBit,
|
||||||
PipelineStageFlags.PipelineStageComputeShaderBit,
|
PipelineStageFlags.ComputeShaderBit,
|
||||||
PipelineStageFlags.PipelineStageDrawIndirectBit,
|
PipelineStageFlags.DrawIndirectBit,
|
||||||
ParamsIndirectDispatchOffset,
|
ParamsIndirectDispatchOffset,
|
||||||
ParamsIndirectDispatchSize);
|
ParamsIndirectDispatchSize);
|
||||||
|
|
||||||
|
@ -798,9 +798,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dstBuffer,
|
dstBuffer,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
0,
|
0,
|
||||||
convertedCount * outputIndexSize);
|
convertedCount * outputIndexSize);
|
||||||
|
|
||||||
|
@ -814,10 +814,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
gd,
|
gd,
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dstBuffer,
|
dstBuffer,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
0,
|
0,
|
||||||
convertedCount * outputIndexSize);
|
convertedCount * outputIndexSize);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool map = flags.HasFlag(MemoryPropertyFlags.MemoryPropertyHostVisibleBit);
|
bool map = flags.HasFlag(MemoryPropertyFlags.HostVisibleBit);
|
||||||
return Allocate(memoryTypeIndex, requirements.Size, requirements.Alignment, map);
|
return Allocate(memoryTypeIndex, requirements.Size, requirements.Alignment, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,14 +128,14 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
MemoryBarrier memoryBarrier = new MemoryBarrier()
|
MemoryBarrier memoryBarrier = new MemoryBarrier()
|
||||||
{
|
{
|
||||||
SType = StructureType.MemoryBarrier,
|
SType = StructureType.MemoryBarrier,
|
||||||
SrcAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit,
|
SrcAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit,
|
||||||
DstAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit
|
DstAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit
|
||||||
};
|
};
|
||||||
|
|
||||||
Gd.Api.CmdPipelineBarrier(
|
Gd.Api.CmdPipelineBarrier(
|
||||||
CommandBuffer,
|
CommandBuffer,
|
||||||
PipelineStageFlags.PipelineStageFragmentShaderBit,
|
PipelineStageFlags.FragmentShaderBit,
|
||||||
PipelineStageFlags.PipelineStageFragmentShaderBit,
|
PipelineStageFlags.FragmentShaderBit,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
memoryBarrier,
|
memoryBarrier,
|
||||||
|
@ -161,9 +161,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
Cbs.CommandBuffer,
|
Cbs.CommandBuffer,
|
||||||
dst,
|
dst,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
offset,
|
offset,
|
||||||
size);
|
size);
|
||||||
|
|
||||||
|
@ -173,10 +173,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
Gd,
|
Gd,
|
||||||
Cbs.CommandBuffer,
|
Cbs.CommandBuffer,
|
||||||
dst,
|
dst,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
BufferHolder.DefaultAccessFlags,
|
BufferHolder.DefaultAccessFlags,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
offset,
|
offset,
|
||||||
size);
|
size);
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
BeginRenderPass();
|
BeginRenderPass();
|
||||||
|
|
||||||
var clearValue = new ClearValue(new ClearColorValue(color.Red, color.Green, color.Blue, color.Alpha));
|
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);
|
var clearRect = FramebufferParams.GetClearRect(ClearScissor, layer, layerCount);
|
||||||
|
|
||||||
Gd.Api.CmdClearAttachments(CommandBuffer, 1, &attachment, 1, &clearRect);
|
Gd.Api.CmdClearAttachments(CommandBuffer, 1, &attachment, 1, &clearRect);
|
||||||
|
@ -219,11 +219,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
BeginRenderPass();
|
BeginRenderPass();
|
||||||
|
|
||||||
var clearValue = new ClearValue(null, new ClearDepthStencilValue(depthValue, (uint)stencilValue));
|
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)
|
if (stencilMask != 0)
|
||||||
{
|
{
|
||||||
flags |= ImageAspectFlags.ImageAspectStencilBit;
|
flags |= ImageAspectFlags.StencilBit;
|
||||||
}
|
}
|
||||||
|
|
||||||
var attachment = new ClearAttachment(flags, 0, clearValue);
|
var attachment = new ClearAttachment(flags, 0, clearValue);
|
||||||
|
@ -238,13 +238,13 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
SType = StructureType.MemoryBarrier,
|
SType = StructureType.MemoryBarrier,
|
||||||
SrcAccessMask = BufferHolder.DefaultAccessFlags,
|
SrcAccessMask = BufferHolder.DefaultAccessFlags,
|
||||||
DstAccessMask = AccessFlags.AccessIndirectCommandReadBit
|
DstAccessMask = AccessFlags.IndirectCommandReadBit
|
||||||
};
|
};
|
||||||
|
|
||||||
Gd.Api.CmdPipelineBarrier(
|
Gd.Api.CmdPipelineBarrier(
|
||||||
CommandBuffer,
|
CommandBuffer,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageDrawIndirectBit,
|
PipelineStageFlags.DrawIndirectBit,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
memoryBarrier,
|
memoryBarrier,
|
||||||
|
@ -624,7 +624,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
var oldViewports = DynamicState.Viewports;
|
var oldViewports = DynamicState.Viewports;
|
||||||
var oldViewportsCount = _newState.ViewportsCount;
|
var oldViewportsCount = _newState.ViewportsCount;
|
||||||
|
|
||||||
_newState.CullMode = CullModeFlags.CullModeNone;
|
_newState.CullMode = CullModeFlags.None;
|
||||||
_newState.StencilTestEnable = false;
|
_newState.StencilTestEnable = false;
|
||||||
_newState.DepthTestEnable = false;
|
_newState.DepthTestEnable = false;
|
||||||
_newState.DepthWriteEnable = false;
|
_newState.DepthWriteEnable = false;
|
||||||
|
@ -737,7 +737,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
public void SetFaceCulling(bool enable, Face face)
|
public void SetFaceCulling(bool enable, Face face)
|
||||||
{
|
{
|
||||||
_newState.CullMode = enable ? face.Convert() : CullModeFlags.CullModeNone;
|
_newState.CullMode = enable ? face.Convert() : CullModeFlags.None;
|
||||||
SignalStateChange();
|
SignalStateChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1200,14 +1200,14 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
MemoryBarrier memoryBarrier = new MemoryBarrier()
|
MemoryBarrier memoryBarrier = new MemoryBarrier()
|
||||||
{
|
{
|
||||||
SType = StructureType.MemoryBarrier,
|
SType = StructureType.MemoryBarrier,
|
||||||
SrcAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit,
|
SrcAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit,
|
||||||
DstAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit
|
DstAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit
|
||||||
};
|
};
|
||||||
|
|
||||||
Gd.Api.CmdPipelineBarrier(
|
Gd.Api.CmdPipelineBarrier(
|
||||||
CommandBuffer,
|
CommandBuffer,
|
||||||
PipelineStageFlags.PipelineStageFragmentShaderBit,
|
PipelineStageFlags.FragmentShaderBit,
|
||||||
PipelineStageFlags.PipelineStageFragmentShaderBit,
|
PipelineStageFlags.FragmentShaderBit,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
memoryBarrier,
|
memoryBarrier,
|
||||||
|
|
|
@ -6,8 +6,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
static class PipelineConverter
|
static class PipelineConverter
|
||||||
{
|
{
|
||||||
private const AccessFlags SubpassSrcAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessColorAttachmentWriteBit;
|
private const AccessFlags SubpassSrcAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit | AccessFlags.ColorAttachmentWriteBit;
|
||||||
private const AccessFlags SubpassDstAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessShaderReadBit;
|
private const AccessFlags SubpassDstAccessMask = AccessFlags.MemoryReadBit | AccessFlags.MemoryWriteBit | AccessFlags.ShaderReadBit;
|
||||||
|
|
||||||
public static unsafe DisposableRenderPass ToRenderPass(this ProgramPipelineState state, VulkanRenderer gd, Device device)
|
public static unsafe DisposableRenderPass ToRenderPass(this ProgramPipelineState state, VulkanRenderer gd, Device device)
|
||||||
{
|
{
|
||||||
|
@ -129,8 +129,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
return new SubpassDependency(
|
return new SubpassDependency(
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
PipelineStageFlags.AllGraphicsBit,
|
||||||
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
PipelineStageFlags.AllGraphicsBit,
|
||||||
SubpassSrcAccessMask,
|
SubpassSrcAccessMask,
|
||||||
SubpassDstAccessMask,
|
SubpassDstAccessMask,
|
||||||
0);
|
0);
|
||||||
|
@ -143,8 +143,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
null,
|
null,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
PipelineStageFlags.AllGraphicsBit,
|
||||||
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
PipelineStageFlags.AllGraphicsBit,
|
||||||
SubpassSrcAccessMask,
|
SubpassSrcAccessMask,
|
||||||
SubpassDstAccessMask,
|
SubpassDstAccessMask,
|
||||||
0);
|
0);
|
||||||
|
@ -157,7 +157,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
// It is assumed that Dynamic State is enabled when this conversion is used.
|
// 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.
|
pipeline.DepthBoundsTestEnable = false; // Not implemented.
|
||||||
|
|
||||||
|
|
|
@ -145,12 +145,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
private void RecordStencilMasks(Vk api, CommandBuffer commandBuffer)
|
private void RecordStencilMasks(Vk api, CommandBuffer commandBuffer)
|
||||||
{
|
{
|
||||||
api.CmdSetStencilCompareMask(commandBuffer, StencilFaceFlags.StencilFaceBackBit, _backCompareMask);
|
api.CmdSetStencilCompareMask(commandBuffer, StencilFaceFlags.FaceBackBit, _backCompareMask);
|
||||||
api.CmdSetStencilWriteMask(commandBuffer, StencilFaceFlags.StencilFaceBackBit, _backWriteMask);
|
api.CmdSetStencilWriteMask(commandBuffer, StencilFaceFlags.FaceBackBit, _backWriteMask);
|
||||||
api.CmdSetStencilReference(commandBuffer, StencilFaceFlags.StencilFaceBackBit, _backReference);
|
api.CmdSetStencilReference(commandBuffer, StencilFaceFlags.FaceBackBit, _backReference);
|
||||||
api.CmdSetStencilCompareMask(commandBuffer, StencilFaceFlags.StencilFaceFrontBit, _frontCompareMask);
|
api.CmdSetStencilCompareMask(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontCompareMask);
|
||||||
api.CmdSetStencilWriteMask(commandBuffer, StencilFaceFlags.StencilFaceFrontBit, _frontWriteMask);
|
api.CmdSetStencilWriteMask(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontWriteMask);
|
||||||
api.CmdSetStencilReference(commandBuffer, StencilFaceFlags.StencilFaceFrontBit, _frontReference);
|
api.CmdSetStencilReference(commandBuffer, StencilFaceFlags.FaceFrontBit, _frontReference);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RecordViewport(Vk api, CommandBuffer commandBuffer)
|
private void RecordViewport(Vk api, CommandBuffer commandBuffer)
|
||||||
|
|
|
@ -125,7 +125,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
if (Gd.Capabilities.SupportsConditionalRendering)
|
if (Gd.Capabilities.SupportsConditionalRendering)
|
||||||
{
|
{
|
||||||
var buffer = evt.GetBuffer().Get(Cbs, 0, sizeof(long)).Value;
|
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()
|
var conditionalRenderingBeginInfo = new ConditionalRenderingBeginInfoEXT()
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,9 +8,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
static class PipelineLayoutFactory
|
static class PipelineLayoutFactory
|
||||||
{
|
{
|
||||||
private const ShaderStageFlags SupportBufferStages =
|
private const ShaderStageFlags SupportBufferStages =
|
||||||
ShaderStageFlags.ShaderStageVertexBit |
|
ShaderStageFlags.VertexBit |
|
||||||
ShaderStageFlags.ShaderStageFragmentBit |
|
ShaderStageFlags.FragmentBit |
|
||||||
ShaderStageFlags.ShaderStageComputeBit;
|
ShaderStageFlags.ComputeBit;
|
||||||
|
|
||||||
public static unsafe DescriptorSetLayout[] Create(VulkanRenderer gd, Device device, uint stages, bool usePd, out PipelineLayout layout)
|
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
|
var stageFlags = stage switch
|
||||||
{
|
{
|
||||||
1 => ShaderStageFlags.ShaderStageFragmentBit,
|
1 => ShaderStageFlags.FragmentBit,
|
||||||
2 => ShaderStageFlags.ShaderStageGeometryBit,
|
2 => ShaderStageFlags.GeometryBit,
|
||||||
3 => ShaderStageFlags.ShaderStageTessellationControlBit,
|
3 => ShaderStageFlags.TessellationControlBit,
|
||||||
4 => ShaderStageFlags.ShaderStageTessellationEvaluationBit,
|
4 => ShaderStageFlags.TessellationEvaluationBit,
|
||||||
_ => ShaderStageFlags.ShaderStageVertexBit | ShaderStageFlags.ShaderStageComputeBit
|
_ => ShaderStageFlags.VertexBit | ShaderStageFlags.ComputeBit
|
||||||
};
|
};
|
||||||
|
|
||||||
void Set(DescriptorSetLayoutBinding* bindings, int maxPerStage, DescriptorType type, int start, int skip)
|
void Set(DescriptorSetLayoutBinding* bindings, int maxPerStage, DescriptorType type, int start, int skip)
|
||||||
|
@ -93,7 +93,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
SType = StructureType.DescriptorSetLayoutCreateInfo,
|
SType = StructureType.DescriptorSetLayoutCreateInfo,
|
||||||
PBindings = uLayoutBindings,
|
PBindings = uLayoutBindings,
|
||||||
BindingCount = (uint)uCount,
|
BindingCount = (uint)uCount,
|
||||||
Flags = usePd ? DescriptorSetLayoutCreateFlags.DescriptorSetLayoutCreatePushDescriptorBitKhr : 0
|
Flags = usePd ? DescriptorSetLayoutCreateFlags.PushDescriptorBitKhr : 0
|
||||||
};
|
};
|
||||||
|
|
||||||
var sDescriptorSetLayoutCreateInfo = new DescriptorSetLayoutCreateInfo()
|
var sDescriptorSetLayoutCreateInfo = new DescriptorSetLayoutCreateInfo()
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace Ryujinx.Graphics.Vulkan.Queries
|
||||||
if (_isSupported)
|
if (_isSupported)
|
||||||
{
|
{
|
||||||
QueryPipelineStatisticFlags flags = type == CounterType.PrimitivesGenerated ?
|
QueryPipelineStatisticFlags flags = type == CounterType.PrimitivesGenerated ?
|
||||||
QueryPipelineStatisticFlags.QueryPipelineStatisticGeometryShaderPrimitivesBit : 0;
|
QueryPipelineStatisticFlags.GeometryShaderPrimitivesBit : 0;
|
||||||
|
|
||||||
var queryPoolCreateInfo = new QueryPoolCreateInfo()
|
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;
|
var buffer = _buffer.GetBuffer(cbs.CommandBuffer, true).Get(cbs, 0, sizeof(long)).Value;
|
||||||
|
|
||||||
QueryResultFlags flags = QueryResultFlags.QueryResultWaitBit;
|
QueryResultFlags flags = QueryResultFlags.ResultWaitBit;
|
||||||
|
|
||||||
if (!_result32Bit)
|
if (!_result32Bit)
|
||||||
{
|
{
|
||||||
flags |= QueryResultFlags.QueryResult64Bit;
|
flags |= QueryResultFlags.Result64Bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
_api.CmdCopyQueryPoolResults(
|
_api.CmdCopyQueryPoolResults(
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="OpenTK.Windowing.GraphicsLibraryFramework" Version="4.7.5" />
|
<PackageReference Include="OpenTK.Windowing.GraphicsLibraryFramework" Version="4.7.5" />
|
||||||
<PackageReference Include="shaderc.net" Version="0.1.0" />
|
<PackageReference Include="shaderc.net" Version="0.1.0" />
|
||||||
<PackageReference Include="Silk.NET.Vulkan" Version="2.10.1" />
|
<PackageReference Include="Silk.NET.Vulkan" Version="2.16.0" />
|
||||||
<PackageReference Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.10.1" />
|
<PackageReference Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" />
|
||||||
<PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.10.1" />
|
<PackageReference Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" />
|
||||||
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
|
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
|
||||||
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
|
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
|
||||||
<PackageReference Include="System.Threading.ThreadPool" Version="4.3.0" />
|
<PackageReference Include="System.Threading.ThreadPool" Version="4.3.0" />
|
||||||
|
|
|
@ -82,14 +82,14 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
stages |= 1u << shader.StageFlags switch
|
stages |= 1u << shader.StageFlags switch
|
||||||
{
|
{
|
||||||
ShaderStageFlags.ShaderStageFragmentBit => 1,
|
ShaderStageFlags.FragmentBit => 1,
|
||||||
ShaderStageFlags.ShaderStageGeometryBit => 2,
|
ShaderStageFlags.GeometryBit => 2,
|
||||||
ShaderStageFlags.ShaderStageTessellationControlBit => 3,
|
ShaderStageFlags.TessellationControlBit => 3,
|
||||||
ShaderStageFlags.ShaderStageTessellationEvaluationBit => 4,
|
ShaderStageFlags.TessellationEvaluationBit => 4,
|
||||||
_ => 0
|
_ => 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (shader.StageFlags == ShaderStageFlags.ShaderStageComputeBit)
|
if (shader.StageFlags == ShaderStageFlags.ComputeBit)
|
||||||
{
|
{
|
||||||
IsCompute = true;
|
IsCompute = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,9 +60,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
commandBuffer,
|
commandBuffer,
|
||||||
srcImage,
|
srcImage,
|
||||||
TextureStorage.DefaultAccessMask,
|
TextureStorage.DefaultAccessMask,
|
||||||
AccessFlags.AccessTransferReadBit,
|
AccessFlags.TransferReadBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
srcAspectFlags,
|
srcAspectFlags,
|
||||||
srcLayer,
|
srcLayer,
|
||||||
srcLevel,
|
srcLevel,
|
||||||
|
@ -103,10 +103,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
api,
|
api,
|
||||||
commandBuffer,
|
commandBuffer,
|
||||||
dstImage,
|
dstImage,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
TextureStorage.DefaultAccessMask,
|
TextureStorage.DefaultAccessMask,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
dstAspectFlags,
|
dstAspectFlags,
|
||||||
dstLayer,
|
dstLayer,
|
||||||
dstLevel,
|
dstLevel,
|
||||||
|
@ -285,9 +285,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
commandBuffer,
|
commandBuffer,
|
||||||
srcImage,
|
srcImage,
|
||||||
TextureStorage.DefaultAccessMask,
|
TextureStorage.DefaultAccessMask,
|
||||||
AccessFlags.AccessTransferReadBit,
|
AccessFlags.TransferReadBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
srcAspect,
|
srcAspect,
|
||||||
srcViewLayer + srcLayer,
|
srcViewLayer + srcLayer,
|
||||||
srcViewLevel + srcLevel,
|
srcViewLevel + srcLevel,
|
||||||
|
@ -345,10 +345,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
api,
|
api,
|
||||||
commandBuffer,
|
commandBuffer,
|
||||||
dstImage,
|
dstImage,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
TextureStorage.DefaultAccessMask,
|
TextureStorage.DefaultAccessMask,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
dstAspect,
|
dstAspect,
|
||||||
dstViewLayer + dstLayer,
|
dstViewLayer + dstLayer,
|
||||||
dstViewLevel + dstLevel,
|
dstViewLevel + dstLevel,
|
||||||
|
@ -370,8 +370,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
SType = StructureType.SubpassDescriptionDepthStencilResolve,
|
SType = StructureType.SubpassDescriptionDepthStencilResolve,
|
||||||
PDepthStencilResolveAttachment = &dsResolveAttachmentReference,
|
PDepthStencilResolveAttachment = &dsResolveAttachmentReference,
|
||||||
DepthResolveMode = ResolveModeFlags.ResolveModeSampleZeroBit,
|
DepthResolveMode = ResolveModeFlags.SampleZeroBit,
|
||||||
StencilResolveMode = ResolveModeFlags.ResolveModeSampleZeroBit
|
StencilResolveMode = ResolveModeFlags.SampleZeroBit
|
||||||
};
|
};
|
||||||
|
|
||||||
var subpass = new SubpassDescription2()
|
var subpass = new SubpassDescription2()
|
||||||
|
|
|
@ -12,22 +12,22 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
class TextureStorage : IDisposable
|
class TextureStorage : IDisposable
|
||||||
{
|
{
|
||||||
private const MemoryPropertyFlags DefaultImageMemoryFlags =
|
private const MemoryPropertyFlags DefaultImageMemoryFlags =
|
||||||
MemoryPropertyFlags.MemoryPropertyDeviceLocalBit;
|
MemoryPropertyFlags.DeviceLocalBit;
|
||||||
|
|
||||||
private const ImageUsageFlags DefaultUsageFlags =
|
private const ImageUsageFlags DefaultUsageFlags =
|
||||||
ImageUsageFlags.ImageUsageSampledBit |
|
ImageUsageFlags.SampledBit |
|
||||||
ImageUsageFlags.ImageUsageTransferSrcBit |
|
ImageUsageFlags.TransferSrcBit |
|
||||||
ImageUsageFlags.ImageUsageTransferDstBit;
|
ImageUsageFlags.TransferDstBit;
|
||||||
|
|
||||||
public const AccessFlags DefaultAccessMask =
|
public const AccessFlags DefaultAccessMask =
|
||||||
AccessFlags.AccessShaderReadBit |
|
AccessFlags.ShaderReadBit |
|
||||||
AccessFlags.AccessShaderWriteBit |
|
AccessFlags.ShaderWriteBit |
|
||||||
AccessFlags.AccessColorAttachmentReadBit |
|
AccessFlags.ColorAttachmentReadBit |
|
||||||
AccessFlags.AccessColorAttachmentWriteBit |
|
AccessFlags.ColorAttachmentWriteBit |
|
||||||
AccessFlags.AccessDepthStencilAttachmentReadBit |
|
AccessFlags.DepthStencilAttachmentReadBit |
|
||||||
AccessFlags.AccessDepthStencilAttachmentWriteBit |
|
AccessFlags.DepthStencilAttachmentWriteBit |
|
||||||
AccessFlags.AccessTransferReadBit |
|
AccessFlags.TransferReadBit |
|
||||||
AccessFlags.AccessTransferWriteBit;
|
AccessFlags.TransferWriteBit;
|
||||||
|
|
||||||
private readonly VulkanRenderer _gd;
|
private readonly VulkanRenderer _gd;
|
||||||
|
|
||||||
|
@ -83,32 +83,32 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
if (info.Format.IsDepthOrStencil())
|
if (info.Format.IsDepthOrStencil())
|
||||||
{
|
{
|
||||||
usage |= ImageUsageFlags.ImageUsageDepthStencilAttachmentBit;
|
usage |= ImageUsageFlags.DepthStencilAttachmentBit;
|
||||||
}
|
}
|
||||||
else if (info.Format.IsRtColorCompatible())
|
else if (info.Format.IsRtColorCompatible())
|
||||||
{
|
{
|
||||||
usage |= ImageUsageFlags.ImageUsageColorAttachmentBit;
|
usage |= ImageUsageFlags.ColorAttachmentBit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.Format.IsImageCompatible())
|
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.
|
// 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 isCube = info.Target == Target.Cubemap || info.Target == Target.CubemapArray;
|
||||||
bool cubeCompatible = gd.IsAmdGcn ? isCube : (info.Width == info.Height && layers >= 6);
|
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()
|
var imageCreateInfo = new ImageCreateInfo()
|
||||||
|
@ -290,8 +290,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
_gd.Api.CmdPipelineBarrier(
|
_gd.Api.CmdPipelineBarrier(
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
PipelineStageFlags.PipelineStageTopOfPipeBit,
|
PipelineStageFlags.TopOfPipeBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
null,
|
null,
|
||||||
|
@ -308,9 +308,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
public static SampleCountFlags ConvertToSampleCountFlags(uint samples)
|
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.
|
// 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)
|
public void InsertBarrier(CommandBufferScoped cbs, AccessFlags dstAccessFlags, PipelineStageFlags dstStageFlags)
|
||||||
{
|
{
|
||||||
if (_lastModificationAccess != AccessFlags.AccessNoneKhr)
|
if (_lastModificationAccess != AccessFlags.NoneKhr)
|
||||||
{
|
{
|
||||||
ImageAspectFlags aspectFlags;
|
ImageAspectFlags aspectFlags;
|
||||||
|
|
||||||
|
@ -436,20 +436,20 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
if (_info.Format == GAL.Format.S8Uint)
|
if (_info.Format == GAL.Format.S8Uint)
|
||||||
{
|
{
|
||||||
aspectFlags = ImageAspectFlags.ImageAspectStencilBit;
|
aspectFlags = ImageAspectFlags.StencilBit;
|
||||||
}
|
}
|
||||||
else if (_info.Format == GAL.Format.D16Unorm || _info.Format == GAL.Format.D32Float)
|
else if (_info.Format == GAL.Format.D16Unorm || _info.Format == GAL.Format.D32Float)
|
||||||
{
|
{
|
||||||
aspectFlags = ImageAspectFlags.ImageAspectDepthBit;
|
aspectFlags = ImageAspectFlags.DepthBit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aspectFlags = ImageAspectFlags.ImageAspectDepthBit | ImageAspectFlags.ImageAspectStencilBit;
|
aspectFlags = ImageAspectFlags.DepthBit | ImageAspectFlags.StencilBit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aspectFlags = ImageAspectFlags.ImageAspectColorBit;
|
aspectFlags = ImageAspectFlags.ColorBit;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureView.InsertImageBarrier(
|
TextureView.InsertImageBarrier(
|
||||||
|
@ -466,7 +466,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
_info.GetLayers(),
|
_info.GetLayers(),
|
||||||
_info.Levels);
|
_info.Levels);
|
||||||
|
|
||||||
_lastModificationAccess = AccessFlags.AccessNoneKhr;
|
_lastModificationAccess = AccessFlags.NoneKhr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
subresourceRange = new ImageSubresourceRange(aspectFlags, (uint)firstLevel, levels, (uint)firstLayer, (uint)info.Depth);
|
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;
|
Valid = true;
|
||||||
|
@ -322,8 +322,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (_gd.FormatCapabilities.OptimalFormatSupports(FormatFeatureFlags.FormatFeatureBlitSrcBit, srcFormat) &&
|
else if (_gd.FormatCapabilities.OptimalFormatSupports(FormatFeatureFlags.BlitSrcBit, srcFormat) &&
|
||||||
_gd.FormatCapabilities.OptimalFormatSupports(FormatFeatureFlags.FormatFeatureBlitDstBit, dstFormat))
|
_gd.FormatCapabilities.OptimalFormatSupports(FormatFeatureFlags.BlitDstBit, dstFormat))
|
||||||
{
|
{
|
||||||
TextureCopy.Blit(
|
TextureCopy.Blit(
|
||||||
_gd.Api,
|
_gd.Api,
|
||||||
|
@ -402,8 +402,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
layers,
|
layers,
|
||||||
levels,
|
levels,
|
||||||
linearFilter,
|
linearFilter,
|
||||||
ImageAspectFlags.ImageAspectColorBit,
|
ImageAspectFlags.ColorBit,
|
||||||
ImageAspectFlags.ImageAspectColorBit);
|
ImageAspectFlags.ColorBit);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void BlitDepthStencilWithBuffer(
|
private static void BlitDepthStencilWithBuffer(
|
||||||
|
@ -471,10 +471,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
gd,
|
gd,
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
srcTempBuffer.GetBuffer().Get(cbs, 0, srcSize).Value,
|
srcTempBuffer.GetBuffer().Get(cbs, 0, srcSize).Value,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
AccessFlags.AccessTransferReadBit,
|
AccessFlags.TransferReadBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
0,
|
0,
|
||||||
srcSize);
|
srcSize);
|
||||||
|
|
||||||
|
@ -498,10 +498,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
gd.Api,
|
gd.Api,
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
srcTemp.GetImage().Get(cbs).Value,
|
srcTemp.GetImage().Get(cbs).Value,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
AccessFlags.AccessTransferReadBit,
|
AccessFlags.TransferReadBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
aspectFlags,
|
aspectFlags,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
@ -531,10 +531,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
gd.Api,
|
gd.Api,
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dstTemp.GetImage().Get(cbs).Value,
|
dstTemp.GetImage().Get(cbs).Value,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
AccessFlags.AccessTransferReadBit,
|
AccessFlags.TransferReadBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
aspectFlags,
|
aspectFlags,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
@ -561,10 +561,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
gd,
|
gd,
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
dstTempBuffer.GetBuffer().Get(cbs, 0, dstSize).Value,
|
dstTempBuffer.GetBuffer().Get(cbs, 0, dstSize).Value,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
AccessFlags.AccessTransferReadBit,
|
AccessFlags.TransferReadBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
PipelineStageFlags.PipelineStageTransferBit,
|
PipelineStageFlags.TransferBit,
|
||||||
0,
|
0,
|
||||||
dstSize);
|
dstSize);
|
||||||
|
|
||||||
|
@ -585,8 +585,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
SlowBlit(d32SrcStorage, d32DstStorage, ImageAspectFlags.ImageAspectDepthBit);
|
SlowBlit(d32SrcStorage, d32DstStorage, ImageAspectFlags.DepthBit);
|
||||||
SlowBlit(s8SrcStorage, s8DstStorage, ImageAspectFlags.ImageAspectStencilBit);
|
SlowBlit(s8SrcStorage, s8DstStorage, ImageAspectFlags.StencilBit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static unsafe void InsertImageBarrier(
|
public static unsafe void InsertImageBarrier(
|
||||||
|
@ -631,7 +631,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
private bool SupportsBlitFromD32FS8ToD32FAndS8()
|
private bool SupportsBlitFromD32FS8ToD32FAndS8()
|
||||||
{
|
{
|
||||||
var formatFeatureFlags = FormatFeatureFlags.FormatFeatureBlitSrcBit | FormatFeatureFlags.FormatFeatureBlitDstBit;
|
var formatFeatureFlags = FormatFeatureFlags.BlitSrcBit | FormatFeatureFlags.BlitDstBit;
|
||||||
return _gd.FormatCapabilities.OptimalFormatSupports(formatFeatureFlags, GAL.Format.D32Float) &&
|
return _gd.FormatCapabilities.OptimalFormatSupports(formatFeatureFlags, GAL.Format.D32Float) &&
|
||||||
_gd.FormatCapabilities.OptimalFormatSupports(formatFeatureFlags, GAL.Format.S8Uint);
|
_gd.FormatCapabilities.OptimalFormatSupports(formatFeatureFlags, GAL.Format.S8Uint);
|
||||||
}
|
}
|
||||||
|
@ -903,9 +903,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
var aspectFlags = Info.Format.ConvertAspectFlags();
|
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(
|
var sl = new ImageSubresourceLayers(
|
||||||
|
@ -962,9 +962,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
var aspectFlags = Info.Format.ConvertAspectFlags();
|
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);
|
var sl = new ImageSubresourceLayers(aspectFlags, (uint)(FirstLevel + dstLevel), (uint)(FirstLayer + dstLayer), 1);
|
||||||
|
|
|
@ -159,20 +159,20 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt))
|
if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.ErrorBitExt))
|
||||||
{
|
{
|
||||||
Logger.Error?.Print(LogClass.Gpu, msg);
|
Logger.Error?.Print(LogClass.Gpu, msg);
|
||||||
//throw new Exception(msg);
|
//throw new Exception(msg);
|
||||||
}
|
}
|
||||||
else if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityWarningBitExt))
|
else if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.WarningBitExt))
|
||||||
{
|
{
|
||||||
Logger.Warning?.Print(LogClass.Gpu, msg);
|
Logger.Warning?.Print(LogClass.Gpu, msg);
|
||||||
}
|
}
|
||||||
else if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityInfoBitExt))
|
else if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.InfoBitExt))
|
||||||
{
|
{
|
||||||
Logger.Info?.Print(LogClass.Gpu, msg);
|
Logger.Info?.Print(LogClass.Gpu, msg);
|
||||||
}
|
}
|
||||||
else // if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityVerboseBitExt))
|
else // if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.VerboseBitExt))
|
||||||
{
|
{
|
||||||
Logger.Debug?.Print(LogClass.Gpu, msg);
|
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)
|
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);
|
var khrSurface = new KhrSurface(api.Context);
|
||||||
|
|
||||||
|
@ -561,24 +561,24 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
var filterLogType = logLevel switch
|
var filterLogType = logLevel switch
|
||||||
{
|
{
|
||||||
GraphicsDebugLevel.Error => DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeValidationBitExt,
|
GraphicsDebugLevel.Error => DebugUtilsMessageTypeFlagsEXT.ValidationBitExt,
|
||||||
GraphicsDebugLevel.Slowdowns => DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeValidationBitExt |
|
GraphicsDebugLevel.Slowdowns => DebugUtilsMessageTypeFlagsEXT.ValidationBitExt |
|
||||||
DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypePerformanceBitExt,
|
DebugUtilsMessageTypeFlagsEXT.PerformanceBitExt,
|
||||||
GraphicsDebugLevel.All => DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeGeneralBitExt |
|
GraphicsDebugLevel.All => DebugUtilsMessageTypeFlagsEXT.GeneralBitExt |
|
||||||
DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeValidationBitExt |
|
DebugUtilsMessageTypeFlagsEXT.ValidationBitExt |
|
||||||
DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypePerformanceBitExt,
|
DebugUtilsMessageTypeFlagsEXT.PerformanceBitExt,
|
||||||
_ => throw new ArgumentException($"Invalid log level \"{logLevel}\".")
|
_ => throw new ArgumentException($"Invalid log level \"{logLevel}\".")
|
||||||
};
|
};
|
||||||
|
|
||||||
var filterLogSeverity = logLevel switch
|
var filterLogSeverity = logLevel switch
|
||||||
{
|
{
|
||||||
GraphicsDebugLevel.Error => DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt,
|
GraphicsDebugLevel.Error => DebugUtilsMessageSeverityFlagsEXT.ErrorBitExt,
|
||||||
GraphicsDebugLevel.Slowdowns => DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt |
|
GraphicsDebugLevel.Slowdowns => DebugUtilsMessageSeverityFlagsEXT.ErrorBitExt |
|
||||||
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityWarningBitExt,
|
DebugUtilsMessageSeverityFlagsEXT.WarningBitExt,
|
||||||
GraphicsDebugLevel.All => DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityInfoBitExt |
|
GraphicsDebugLevel.All => DebugUtilsMessageSeverityFlagsEXT.InfoBitExt |
|
||||||
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityWarningBitExt |
|
DebugUtilsMessageSeverityFlagsEXT.WarningBitExt |
|
||||||
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityVerboseBitExt |
|
DebugUtilsMessageSeverityFlagsEXT.VerboseBitExt |
|
||||||
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt,
|
DebugUtilsMessageSeverityFlagsEXT.ErrorBitExt,
|
||||||
_ => throw new ArgumentException($"Invalid log level \"{logLevel}\".")
|
_ => throw new ArgumentException($"Invalid log level \"{logLevel}\".")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -341,11 +341,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
public unsafe Capabilities GetCapabilities()
|
public unsafe Capabilities GetCapabilities()
|
||||||
{
|
{
|
||||||
FormatFeatureFlags compressedFormatFeatureFlags =
|
FormatFeatureFlags compressedFormatFeatureFlags =
|
||||||
FormatFeatureFlags.FormatFeatureSampledImageBit |
|
FormatFeatureFlags.SampledImageBit |
|
||||||
FormatFeatureFlags.FormatFeatureSampledImageFilterLinearBit |
|
FormatFeatureFlags.SampledImageFilterLinearBit |
|
||||||
FormatFeatureFlags.FormatFeatureBlitSrcBit |
|
FormatFeatureFlags.BlitSrcBit |
|
||||||
FormatFeatureFlags.FormatFeatureTransferSrcBit |
|
FormatFeatureFlags.TransferSrcBit |
|
||||||
FormatFeatureFlags.FormatFeatureTransferDstBit;
|
FormatFeatureFlags.TransferDstBit;
|
||||||
|
|
||||||
bool supportsBc123CompressionFormat = FormatCapabilities.OptimalFormatsSupport(compressedFormatFeatureFlags,
|
bool supportsBc123CompressionFormat = FormatCapabilities.OptimalFormatsSupport(compressedFormatFeatureFlags,
|
||||||
GAL.Format.Bc1RgbaSrgb,
|
GAL.Format.Bc1RgbaSrgb,
|
||||||
|
|
|
@ -109,11 +109,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
ImageFormat = surfaceFormat.Format,
|
ImageFormat = surfaceFormat.Format,
|
||||||
ImageColorSpace = surfaceFormat.ColorSpace,
|
ImageColorSpace = surfaceFormat.ColorSpace,
|
||||||
ImageExtent = extent,
|
ImageExtent = extent,
|
||||||
ImageUsage = ImageUsageFlags.ImageUsageColorAttachmentBit | ImageUsageFlags.ImageUsageTransferDstBit,
|
ImageUsage = ImageUsageFlags.ColorAttachmentBit | ImageUsageFlags.TransferDstBit,
|
||||||
ImageSharingMode = SharingMode.Exclusive,
|
ImageSharingMode = SharingMode.Exclusive,
|
||||||
ImageArrayLayers = 1,
|
ImageArrayLayers = 1,
|
||||||
PreTransform = capabilities.CurrentTransform,
|
PreTransform = capabilities.CurrentTransform,
|
||||||
CompositeAlpha = CompositeAlphaFlagsKHR.CompositeAlphaOpaqueBitKhr,
|
CompositeAlpha = CompositeAlphaFlagsKHR.OpaqueBitKhr,
|
||||||
PresentMode = ChooseSwapPresentMode(presentModes, _vsyncEnabled),
|
PresentMode = ChooseSwapPresentMode(presentModes, _vsyncEnabled),
|
||||||
Clipped = true,
|
Clipped = true,
|
||||||
OldSwapchain = oldSwapchain
|
OldSwapchain = oldSwapchain
|
||||||
|
@ -146,7 +146,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
ComponentSwizzle.B,
|
ComponentSwizzle.B,
|
||||||
ComponentSwizzle.A);
|
ComponentSwizzle.A);
|
||||||
|
|
||||||
var aspectFlags = ImageAspectFlags.ImageAspectColorBit;
|
var aspectFlags = ImageAspectFlags.ColorBit;
|
||||||
|
|
||||||
var subresourceRange = new ImageSubresourceRange(aspectFlags, 0, 1, 0, 1);
|
var subresourceRange = new ImageSubresourceRange(aspectFlags, 0, 1, 0, 1);
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
SType = StructureType.ImageViewCreateInfo,
|
SType = StructureType.ImageViewCreateInfo,
|
||||||
Image = swapchainImage,
|
Image = swapchainImage,
|
||||||
ViewType = ImageViewType.ImageViewType2D,
|
ViewType = ImageViewType.Type2D,
|
||||||
Format = format,
|
Format = format,
|
||||||
Components = componentMapping,
|
Components = componentMapping,
|
||||||
SubresourceRange = subresourceRange
|
SubresourceRange = subresourceRange
|
||||||
|
@ -168,12 +168,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
if (availableFormats.Length == 1 && availableFormats[0].Format == VkFormat.Undefined)
|
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)
|
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;
|
return format;
|
||||||
}
|
}
|
||||||
|
@ -184,21 +184,21 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
private static PresentModeKHR ChooseSwapPresentMode(PresentModeKHR[] availablePresentModes, bool vsyncEnabled)
|
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
|
else
|
||||||
{
|
{
|
||||||
return PresentModeKHR.PresentModeFifoKhr;
|
return PresentModeKHR.FifoKhr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
cbs.CommandBuffer,
|
cbs.CommandBuffer,
|
||||||
swapchainImage,
|
swapchainImage,
|
||||||
0,
|
0,
|
||||||
AccessFlags.AccessTransferWriteBit,
|
AccessFlags.TransferWriteBit,
|
||||||
ImageLayout.Undefined,
|
ImageLayout.Undefined,
|
||||||
ImageLayout.General);
|
ImageLayout.General);
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
_gd.CommandBufferPool.Return(
|
_gd.CommandBufferPool.Return(
|
||||||
cbs,
|
cbs,
|
||||||
stackalloc[] { _imageAvailableSemaphore },
|
stackalloc[] { _imageAvailableSemaphore },
|
||||||
stackalloc[] { PipelineStageFlags.PipelineStageColorAttachmentOutputBit },
|
stackalloc[] { PipelineStageFlags.ColorAttachmentOutputBit },
|
||||||
stackalloc[] { _renderFinishedSemaphore });
|
stackalloc[] { _renderFinishedSemaphore });
|
||||||
|
|
||||||
// TODO: Present queue.
|
// TODO: Present queue.
|
||||||
|
@ -373,7 +373,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
ImageLayout srcLayout,
|
ImageLayout srcLayout,
|
||||||
ImageLayout dstLayout)
|
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()
|
var barrier = new ImageMemoryBarrier()
|
||||||
{
|
{
|
||||||
|
@ -390,8 +390,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
_gd.Api.CmdPipelineBarrier(
|
_gd.Api.CmdPipelineBarrier(
|
||||||
commandBuffer,
|
commandBuffer,
|
||||||
PipelineStageFlags.PipelineStageTopOfPipeBit,
|
PipelineStageFlags.TopOfPipeBit,
|
||||||
PipelineStageFlags.PipelineStageAllCommandsBit,
|
PipelineStageFlags.AllCommandsBit,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
null,
|
null,
|
||||||
|
|
Reference in a new issue