dc0dbc50ab
* Add support for VK_EXT_depth_clip_control. * Code review feedback Minor formatting Co-authored-by: gdkchan <gab.dark.100@gmail.com> * Check .DepthClipControl to make sure the host actually supports the feature. * Review feedback: remove Vulkan platform switch, relying on QueryHostSupportsDepthClipControl to drive the behaviour - OpenGL returns true, and any future platforms that don't support the [-1, 1] depth mode can return false for the transformation. --------- Co-authored-by: gdkchan <gab.dark.100@gmail.com>
129 lines
6.5 KiB
C#
129 lines
6.5 KiB
C#
using Silk.NET.Vulkan;
|
|
using System;
|
|
|
|
namespace Ryujinx.Graphics.Vulkan
|
|
{
|
|
[Flags]
|
|
enum PortabilitySubsetFlags
|
|
{
|
|
None = 0,
|
|
|
|
NoTriangleFans = 1,
|
|
NoPointMode = 1 << 1,
|
|
No3DImageView = 1 << 2,
|
|
NoLodBias = 1 << 3
|
|
}
|
|
|
|
readonly struct HardwareCapabilities
|
|
{
|
|
public readonly bool SupportsIndexTypeUint8;
|
|
public readonly bool SupportsCustomBorderColor;
|
|
public readonly bool SupportsBlendEquationAdvanced;
|
|
public readonly bool SupportsBlendEquationAdvancedCorrelatedOverlap;
|
|
public readonly bool SupportsBlendEquationAdvancedNonPreMultipliedSrcColor;
|
|
public readonly bool SupportsBlendEquationAdvancedNonPreMultipliedDstColor;
|
|
public readonly bool SupportsIndirectParameters;
|
|
public readonly bool SupportsFragmentShaderInterlock;
|
|
public readonly bool SupportsGeometryShaderPassthrough;
|
|
public readonly bool SupportsSubgroupSizeControl;
|
|
public readonly bool SupportsShaderInt8;
|
|
public readonly bool SupportsShaderStencilExport;
|
|
public readonly bool SupportsShaderStorageImageMultisample;
|
|
public readonly bool SupportsConditionalRendering;
|
|
public readonly bool SupportsExtendedDynamicState;
|
|
public readonly bool SupportsMultiView;
|
|
public readonly bool SupportsNullDescriptors;
|
|
public readonly bool SupportsPushDescriptors;
|
|
public readonly bool SupportsPrimitiveTopologyListRestart;
|
|
public readonly bool SupportsPrimitiveTopologyPatchListRestart;
|
|
public readonly bool SupportsTransformFeedback;
|
|
public readonly bool SupportsTransformFeedbackQueries;
|
|
public readonly bool SupportsPreciseOcclusionQueries;
|
|
public readonly bool SupportsPipelineStatisticsQuery;
|
|
public readonly bool SupportsGeometryShader;
|
|
public readonly bool SupportsViewportArray2;
|
|
public readonly bool SupportsHostImportedMemory;
|
|
public readonly bool SupportsDepthClipControl;
|
|
public readonly uint MinSubgroupSize;
|
|
public readonly uint MaxSubgroupSize;
|
|
public readonly ShaderStageFlags RequiredSubgroupSizeStages;
|
|
public readonly SampleCountFlags SupportedSampleCounts;
|
|
public readonly PortabilitySubsetFlags PortabilitySubset;
|
|
public readonly uint VertexBufferAlignment;
|
|
public readonly uint SubTexelPrecisionBits;
|
|
|
|
public HardwareCapabilities(
|
|
bool supportsIndexTypeUint8,
|
|
bool supportsCustomBorderColor,
|
|
bool supportsBlendEquationAdvanced,
|
|
bool supportsBlendEquationAdvancedCorrelatedOverlap,
|
|
bool supportsBlendEquationAdvancedNonPreMultipliedSrcColor,
|
|
bool supportsBlendEquationAdvancedNonPreMultipliedDstColor,
|
|
bool supportsIndirectParameters,
|
|
bool supportsFragmentShaderInterlock,
|
|
bool supportsGeometryShaderPassthrough,
|
|
bool supportsSubgroupSizeControl,
|
|
bool supportsShaderInt8,
|
|
bool supportsShaderStencilExport,
|
|
bool supportsShaderStorageImageMultisample,
|
|
bool supportsConditionalRendering,
|
|
bool supportsExtendedDynamicState,
|
|
bool supportsMultiView,
|
|
bool supportsNullDescriptors,
|
|
bool supportsPushDescriptors,
|
|
bool supportsPrimitiveTopologyListRestart,
|
|
bool supportsPrimitiveTopologyPatchListRestart,
|
|
bool supportsTransformFeedback,
|
|
bool supportsTransformFeedbackQueries,
|
|
bool supportsPreciseOcclusionQueries,
|
|
bool supportsPipelineStatisticsQuery,
|
|
bool supportsGeometryShader,
|
|
bool supportsViewportArray2,
|
|
bool supportsHostImportedMemory,
|
|
bool supportsDepthClipControl,
|
|
uint minSubgroupSize,
|
|
uint maxSubgroupSize,
|
|
ShaderStageFlags requiredSubgroupSizeStages,
|
|
SampleCountFlags supportedSampleCounts,
|
|
PortabilitySubsetFlags portabilitySubset,
|
|
uint vertexBufferAlignment,
|
|
uint subTexelPrecisionBits)
|
|
{
|
|
SupportsIndexTypeUint8 = supportsIndexTypeUint8;
|
|
SupportsCustomBorderColor = supportsCustomBorderColor;
|
|
SupportsBlendEquationAdvanced = supportsBlendEquationAdvanced;
|
|
SupportsBlendEquationAdvancedCorrelatedOverlap = supportsBlendEquationAdvancedCorrelatedOverlap;
|
|
SupportsBlendEquationAdvancedNonPreMultipliedSrcColor = supportsBlendEquationAdvancedNonPreMultipliedSrcColor;
|
|
SupportsBlendEquationAdvancedNonPreMultipliedDstColor = supportsBlendEquationAdvancedNonPreMultipliedDstColor;
|
|
SupportsIndirectParameters = supportsIndirectParameters;
|
|
SupportsFragmentShaderInterlock = supportsFragmentShaderInterlock;
|
|
SupportsGeometryShaderPassthrough = supportsGeometryShaderPassthrough;
|
|
SupportsSubgroupSizeControl = supportsSubgroupSizeControl;
|
|
SupportsShaderInt8 = supportsShaderInt8;
|
|
SupportsShaderStencilExport = supportsShaderStencilExport;
|
|
SupportsShaderStorageImageMultisample = supportsShaderStorageImageMultisample;
|
|
SupportsConditionalRendering = supportsConditionalRendering;
|
|
SupportsExtendedDynamicState = supportsExtendedDynamicState;
|
|
SupportsMultiView = supportsMultiView;
|
|
SupportsNullDescriptors = supportsNullDescriptors;
|
|
SupportsPushDescriptors = supportsPushDescriptors;
|
|
SupportsPrimitiveTopologyListRestart = supportsPrimitiveTopologyListRestart;
|
|
SupportsPrimitiveTopologyPatchListRestart = supportsPrimitiveTopologyPatchListRestart;
|
|
SupportsTransformFeedback = supportsTransformFeedback;
|
|
SupportsTransformFeedbackQueries = supportsTransformFeedbackQueries;
|
|
SupportsPreciseOcclusionQueries = supportsPreciseOcclusionQueries;
|
|
SupportsPipelineStatisticsQuery = supportsPipelineStatisticsQuery;
|
|
SupportsGeometryShader = supportsGeometryShader;
|
|
SupportsViewportArray2 = supportsViewportArray2;
|
|
SupportsHostImportedMemory = supportsHostImportedMemory;
|
|
SupportsDepthClipControl = supportsDepthClipControl;
|
|
MinSubgroupSize = minSubgroupSize;
|
|
MaxSubgroupSize = maxSubgroupSize;
|
|
RequiredSubgroupSizeStages = requiredSubgroupSizeStages;
|
|
SupportedSampleCounts = supportedSampleCounts;
|
|
PortabilitySubset = portabilitySubset;
|
|
VertexBufferAlignment = vertexBufferAlignment;
|
|
SubTexelPrecisionBits = subTexelPrecisionBits;
|
|
}
|
|
}
|
|
}
|