Implement primitive restart support

Maxwell3D also supports using an arbitrary restart index value however no games are known to use this so leave it for now.
This commit is contained in:
Billy Laws
2022-04-13 22:01:39 +01:00
committed by PixelyIon
parent 3f3acc31d8
commit feb179fcff
6 changed files with 85 additions and 7 deletions

View File

@ -32,6 +32,8 @@ namespace skyline::gpu {
bool supportsFloatControls{}; //!< If extensive control over FP behavior is exposed (with VK_KHR_shader_float_controls)
vk::PhysicalDeviceFloatControlsProperties floatControls{}; //!< Specifics of FP behavior control (All members will be zero'd out when unavailable)
bool supportsImageReadWithoutFormat{}; //!< If a storage image can be read without a format
bool supportsTopologyListRestart{}; //!< If the device supports using primitive restart for topology lists (with VK_EXT_primitive_topology_list_restart)
bool supportsTopologyPatchListRestart{}; //!< If the device supports using primitive restart for topology patch lists (with VK_EXT_primitive_topology_list_restart)
bool supportsSubgroupVote{}; //!< If subgroup votes are supported in shaders with SPV_KHR_subgroup_vote
u32 subgroupSize{}; //!< Size of a subgroup on the host GPU
@ -56,9 +58,23 @@ namespace skyline::gpu {
TraitManager() = default;
using DeviceProperties2 = vk::StructureChain<vk::PhysicalDeviceProperties2, vk::PhysicalDeviceDriverProperties, vk::PhysicalDeviceFloatControlsProperties, vk::PhysicalDeviceSubgroupProperties>;
using DeviceProperties2 = vk::StructureChain<
vk::PhysicalDeviceProperties2,
vk::PhysicalDeviceDriverProperties,
vk::PhysicalDeviceFloatControlsProperties,
vk::PhysicalDeviceSubgroupProperties>;
using DeviceFeatures2 = vk::StructureChain<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceCustomBorderColorFeaturesEXT, vk::PhysicalDeviceVertexAttributeDivisorFeaturesEXT, vk::PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT, vk::PhysicalDeviceShaderFloat16Int8Features, vk::PhysicalDeviceShaderAtomicInt64Features, vk::PhysicalDeviceUniformBufferStandardLayoutFeatures, vk::PhysicalDeviceShaderDrawParametersFeatures, vk::PhysicalDeviceProvokingVertexFeaturesEXT>;
using DeviceFeatures2 = vk::StructureChain<
vk::PhysicalDeviceFeatures2,
vk::PhysicalDeviceCustomBorderColorFeaturesEXT,
vk::PhysicalDeviceVertexAttributeDivisorFeaturesEXT,
vk::PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT,
vk::PhysicalDeviceShaderFloat16Int8Features,
vk::PhysicalDeviceShaderAtomicInt64Features,
vk::PhysicalDeviceUniformBufferStandardLayoutFeatures,
vk::PhysicalDeviceShaderDrawParametersFeatures,
vk::PhysicalDeviceProvokingVertexFeaturesEXT,
vk::PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT>;
TraitManager(const DeviceFeatures2 &deviceFeatures2, DeviceFeatures2 &enabledFeatures2, const std::vector<vk::ExtensionProperties> &deviceExtensions, std::vector<std::array<char, VK_MAX_EXTENSION_NAME_SIZE>> &enabledExtensions, const DeviceProperties2 &deviceProperties2);