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

View file

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

View file

@ -180,12 +180,26 @@ namespace Ryujinx.Graphics.Vulkan
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);
Capabilities = new HardwareCapabilities(
supportedExtensions.Contains(ExtConditionalRendering.ExtensionName),
supportedExtensions.Contains(ExtExtendedDynamicState.ExtensionName),
supportedExtensions.Contains(ExtTransformFeedback.ExtensionName),
supportsTransformFeedback,
propertiesTransformFeedback.TransformFeedbackQueries,
supportedFeatures.GeometryShader,
propertiesSubgroupSizeControl.MinSubgroupSize,
propertiesSubgroupSizeControl.MaxSubgroupSize,