Check for transform feedback query support

Sometimes transform feedback is supported without the query type.
This commit is contained in:
riperiperi 2022-05-21 15:11:36 +01:00
parent d4ccb6b895
commit f636810c6c
3 changed files with 19 additions and 2 deletions

View file

@ -7,6 +7,7 @@ namespace Ryujinx.Graphics.Vulkan
public bool SupportsConditionalRendering { get; } public bool SupportsConditionalRendering { get; }
public bool SupportsExtendedDynamicState { get; } public bool SupportsExtendedDynamicState { get; }
public bool SupportsTransformFeedback { get; } public bool SupportsTransformFeedback { get; }
public bool SupportsTransformFeedbackQueries { get; }
public bool SupportsGeometryShader { get; } public bool SupportsGeometryShader { get; }
public uint MinSubgroupSize { get; } public uint MinSubgroupSize { get; }
public uint MaxSubgroupSize { get; } public uint MaxSubgroupSize { get; }
@ -16,6 +17,7 @@ namespace Ryujinx.Graphics.Vulkan
bool supportsConditionalRendering, bool supportsConditionalRendering,
bool supportsExtendedDynamicState, bool supportsExtendedDynamicState,
bool supportsTransformFeedback, bool supportsTransformFeedback,
bool supportsTransformFeedbackQueries,
bool supportsGeometryShader, bool supportsGeometryShader,
uint minSubgroupSize, uint minSubgroupSize,
uint maxSubgroupSize, uint maxSubgroupSize,
@ -24,6 +26,7 @@ namespace Ryujinx.Graphics.Vulkan
SupportsConditionalRendering = supportsConditionalRendering; SupportsConditionalRendering = supportsConditionalRendering;
SupportsExtendedDynamicState = supportsExtendedDynamicState; SupportsExtendedDynamicState = supportsExtendedDynamicState;
SupportsTransformFeedback = supportsTransformFeedback; SupportsTransformFeedback = supportsTransformFeedback;
SupportsTransformFeedbackQueries = supportsTransformFeedbackQueries;
SupportsGeometryShader = supportsGeometryShader; SupportsGeometryShader = supportsGeometryShader;
MinSubgroupSize = minSubgroupSize; MinSubgroupSize = minSubgroupSize;
MaxSubgroupSize = maxSubgroupSize; MaxSubgroupSize = maxSubgroupSize;

View file

@ -67,7 +67,7 @@ namespace Ryujinx.Graphics.Vulkan.Queries
return type switch return type switch
{ {
CounterType.SamplesPassed => true, CounterType.SamplesPassed => true,
CounterType.TransformFeedbackPrimitivesWritten => gd.Capabilities.SupportsTransformFeedback, CounterType.TransformFeedbackPrimitivesWritten => gd.Capabilities.SupportsTransformFeedbackQueries,
CounterType.PrimitivesGenerated => gd.Capabilities.SupportsGeometryShader, CounterType.PrimitivesGenerated => gd.Capabilities.SupportsGeometryShader,
_ => false _ => false
}; };

View file

@ -180,12 +180,26 @@ namespace Ryujinx.Graphics.Vulkan
properties2.PNext = &propertiesSubgroupSizeControl; properties2.PNext = &propertiesSubgroupSizeControl;
} }
bool supportsTransformFeedback = supportedExtensions.Contains(ExtTransformFeedback.ExtensionName);
PhysicalDeviceTransformFeedbackPropertiesEXT propertiesTransformFeedback = new PhysicalDeviceTransformFeedbackPropertiesEXT()
{
SType = StructureType.PhysicalDeviceTransformFeedbackPropertiesExt
};
if (supportsTransformFeedback)
{
propertiesTransformFeedback.PNext = properties2.PNext;
properties2.PNext = &propertiesTransformFeedback;
}
Api.GetPhysicalDeviceProperties2(_physicalDevice, &properties2); Api.GetPhysicalDeviceProperties2(_physicalDevice, &properties2);
Capabilities = new HardwareCapabilities( Capabilities = new HardwareCapabilities(
supportedExtensions.Contains(ExtConditionalRendering.ExtensionName), supportedExtensions.Contains(ExtConditionalRendering.ExtensionName),
supportedExtensions.Contains(ExtExtendedDynamicState.ExtensionName), supportedExtensions.Contains(ExtExtendedDynamicState.ExtensionName),
supportedExtensions.Contains(ExtTransformFeedback.ExtensionName), supportsTransformFeedback,
propertiesTransformFeedback.TransformFeedbackQueries,
supportedFeatures.GeometryShader, supportedFeatures.GeometryShader,
propertiesSubgroupSizeControl.MinSubgroupSize, propertiesSubgroupSizeControl.MinSubgroupSize,
propertiesSubgroupSizeControl.MaxSubgroupSize, propertiesSubgroupSizeControl.MaxSubgroupSize,