Skip to content

Commit fd86461

Browse files
committed
maintenance4 fix in feautes
1 parent 6c01509 commit fd86461

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

include/nbl/video/SPhysicalDeviceFeatures.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,6 @@ struct SPhysicalDeviceFeatures
550550
/* PipelineExecutablePropertiesFeaturesKHR *//* VK_KHR_pipeline_executable_properties */
551551
bool pipelineExecutableInfo = false;
552552

553-
// [TODO] Always Enable, Report as limit: Use multiple booleans that represent what `VK_KHR_maintenance4` adds support for, instead of single bool; see description in https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance4.html
554-
/* Maintenance4FeaturesKHR *//* VK_KHR_maintenance4 *//* MOVED TO Vulkan 1.3 Core */
555-
bool maintenance4 = false;
556-
557553
/* CoherentMemoryFeaturesAMD *//* VK_AMD_device_coherent_memory */
558554
bool deviceCoherentMemory = false;
559555

@@ -1185,7 +1181,6 @@ struct SPhysicalDeviceFeatures
11851181
if (performanceCounterQueryPools && !_rhs.performanceCounterQueryPools) return false;
11861182
if (performanceCounterMultipleQueryPools && !_rhs.performanceCounterMultipleQueryPools) return false;
11871183
if (pipelineExecutableInfo && !_rhs.pipelineExecutableInfo) return false;
1188-
if (maintenance4 && !_rhs.maintenance4) return false;
11891184
if (deviceCoherentMemory && !_rhs.deviceCoherentMemory) return false;
11901185
if (bufferMarkerAMD && !_rhs.bufferMarkerAMD) return false;
11911186
if (!_rhs.swapchainMode.hasFlags(swapchainMode)) return false;

include/nbl/video/SPhysicalDeviceLimits.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,10 @@ struct SPhysicalDeviceLimits
589589
/* ShaderSMBuiltinsFeaturesNV *//* VK_NV_shader_sm_builtins */
590590
bool shaderSMBuiltins = false;
591591

592+
// [TODO] MORE: Use multiple booleans that represent what `VK_KHR_maintenance4` adds support for, instead of single bool; see description in https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance4.html
593+
/* VkPhysicalDeviceMaintenance4Features *//* VK_KHR_maintenance4 */
594+
bool workgroupSizeFromSpecConstant = false;
595+
592596
bool shaderSubgroupPartitioned = false; /* VK_NV_shader_subgroup_partitioned */
593597
bool gcnShader = false; /* VK_AMD_gcn_shader */
594598
bool gpuShaderHalfFloat = false; /* VK_AMD_gpu_shader_half_float */
@@ -876,6 +880,7 @@ struct SPhysicalDeviceLimits
876880
if (imageFootprint && !_rhs.imageFootprint) return false;
877881
if (texelBufferAlignment && !_rhs.texelBufferAlignment) return false;
878882
if (shaderSMBuiltins && !_rhs.shaderSMBuiltins) return false;
883+
if (workgroupSizeFromSpecConstant && !_rhs.workgroupSizeFromSpecConstant) return false;
879884
if (shaderSubgroupPartitioned && !_rhs.shaderSubgroupPartitioned) return false;
880885
if (gcnShader && !_rhs.gcnShader) return false;
881886
if (gpuShaderHalfFloat && !_rhs.gpuShaderHalfFloat) return false;

src/nbl/video/CVulkanPhysicalDevice.h

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,12 +1051,6 @@ class CVulkanPhysicalDevice final : public IPhysicalDevice
10511051
m_features.pipelineExecutableInfo = pipelineExecutablePropertiesFeatures.pipelineExecutableInfo;
10521052
}
10531053

1054-
/* VkPhysicalDeviceMaintenance4Features */
1055-
if (isExtensionSupported(VK_KHR_MAINTENANCE_4_EXTENSION_NAME))
1056-
{
1057-
m_features.maintenance4 = maintenance4Features.maintenance4;
1058-
}
1059-
10601054
/* VkPhysicalDeviceCoherentMemoryFeaturesAMD */
10611055
if (isExtensionSupported(VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME))
10621056
{
@@ -1141,6 +1135,11 @@ class CVulkanPhysicalDevice final : public IPhysicalDevice
11411135
m_properties.limits.shaderSMBuiltins = shaderSMBuiltinsFeatures.shaderSMBuiltins;
11421136
}
11431137

1138+
if (isExtensionSupported(VK_KHR_MAINTENANCE_4_EXTENSION_NAME))
1139+
{
1140+
m_properties.limits.workgroupSizeFromSpecConstant = maintenance4Features.maintenance4;
1141+
}
1142+
11441143
m_properties.limits.shaderSubgroupPartitioned = isExtensionSupported(VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME);
11451144
m_properties.limits.gcnShader = isExtensionSupported(VK_AMD_GCN_SHADER_EXTENSION_NAME);
11461145
m_properties.limits.gpuShaderHalfFloat = isExtensionSupported(VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME);
@@ -1643,6 +1642,13 @@ class CVulkanPhysicalDevice final : public IPhysicalDevice
16431642
addFeatureToChain(&shaderSMBuiltinsFeatures);
16441643
}
16451644

1645+
if (insertExtensionIfAvailable(VK_KHR_MAINTENANCE_4_EXTENSION_NAME))
1646+
{
1647+
// No Extension Requirements
1648+
maintenance4Features.maintenance4 = m_properties.limits.workgroupSizeFromSpecConstant;
1649+
addFeatureToChain(&maintenance4Features);
1650+
}
1651+
16461652
insertExtensionIfAvailable(VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME); // No Extension Requirements
16471653
insertExtensionIfAvailable(VK_AMD_GCN_SHADER_EXTENSION_NAME); // No Extension Requirements
16481654
insertExtensionIfAvailable(VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME); // No Extension Requirements
@@ -1661,6 +1667,8 @@ class CVulkanPhysicalDevice final : public IPhysicalDevice
16611667
insertExtensionIfAvailable(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME); // No Extension Requirements
16621668
insertExtensionIfAvailable(VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME); // No Extension Requirements
16631669
insertExtensionIfAvailable(VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME); // No Extension Requirements
1670+
1671+
16641672
}
16651673

16661674
// B. FeaturesToEnable: add names to strings and structs to feature chain
@@ -2213,9 +2221,7 @@ class CVulkanPhysicalDevice final : public IPhysicalDevice
22132221
}
22142222

22152223
CHECK_VULKAN_EXTENTION_FOR_SINGLE_VAR_FEATURE(pipelineExecutableInfo, VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME, pipelineExecutablePropertiesFeatures);
2216-
2217-
CHECK_VULKAN_EXTENTION_FOR_SINGLE_VAR_FEATURE(maintenance4, VK_KHR_MAINTENANCE_4_EXTENSION_NAME, maintenance4Features)
2218-
2224+
22192225
CHECK_VULKAN_EXTENTION_FOR_SINGLE_VAR_FEATURE(deviceCoherentMemory, VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME, coherentMemoryFeatures);
22202226

22212227
if (enabledFeatures.bufferMarkerAMD)

0 commit comments

Comments
 (0)