Skip to content

Commit c8cf8f4

Browse files
committed
video: correct limits/features values
Signed-off-by: Ali Cheraghi <alichraghi@proton.me>
1 parent 9eec70c commit c8cf8f4

File tree

3 files changed

+102
-90
lines changed

3 files changed

+102
-90
lines changed

src/nbl/video/CVulkanPhysicalDevice.cpp

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
304304
//VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT graphicsPipelineLibraryProperties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT };
305305
VkPhysicalDeviceFragmentDensityMap2PropertiesEXT fragmentDensityMap2Properties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT };
306306
VkPhysicalDeviceRayTracingPipelinePropertiesKHR rayTracingPipelineProperties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR };
307+
#if 0 // TODO
307308
VkPhysicalDeviceCooperativeMatrixPropertiesKHR cooperativeMatrixProperties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR };
309+
#endif
308310
VkPhysicalDeviceShaderSMBuiltinsPropertiesNV shaderSMBuiltinsPropertiesNV = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV };
309311
VkPhysicalDeviceShaderCoreProperties2AMD shaderCoreProperties2AMD = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD };
310312
//! Because Renderdoc is special and instead of ignoring extensions it whitelists them
@@ -329,8 +331,10 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
329331
addToPNextChain(&fragmentDensityMap2Properties);
330332
if (isExtensionSupported(VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME))
331333
addToPNextChain(&rayTracingPipelineProperties);
334+
#if 0 // TODO
332335
if (isExtensionSupported(VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
333336
addToPNextChain(&cooperativeMatrixProperties);
337+
#endif
334338
if (isExtensionSupported(VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME))
335339
addToPNextChain(&shaderSMBuiltinsPropertiesNV);
336340
if (isExtensionSupported(VK_AMD_SHADER_CORE_PROPERTIES_2_EXTENSION_NAME))
@@ -604,9 +608,11 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
604608
properties.limits.shaderGroupHandleAlignment = rayTracingPipelineProperties.shaderGroupHandleAlignment;
605609
properties.limits.maxRayHitAttributeSize = rayTracingPipelineProperties.maxRayHitAttributeSize;
606610
}
607-
611+
#if 0 //TODO
608612
if (isExtensionSupported(VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
609613
properties.limits.cooperativeMatrixSupportedStages = static_cast<asset::IShader::E_SHADER_STAGE>(cooperativeMatrixProperties.cooperativeMatrixSupportedStages);
614+
#endif
615+
610616

611617
//! Nabla
612618
if (isExtensionSupported(VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME))
@@ -701,7 +707,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
701707
VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM rasterizationOrderAttachmentAccessFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM };
702708
VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR rayTracingPositionFetchFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR };
703709
VkPhysicalDeviceColorWriteEnableFeaturesEXT colorWriteEnableFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT };
710+
#if 0
704711
VkPhysicalDeviceCooperativeMatrixFeaturesKHR cooperativeMatrixFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR };
712+
#endif
705713
if (isExtensionSupported(VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME))
706714
addToPNextChain(&conditionalRenderingFeatures);
707715
if (isExtensionSupported(VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME))
@@ -895,11 +903,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
895903
if (!vulkan12Features.shaderUniformTexelBufferArrayDynamicIndexing || !vulkan12Features.shaderStorageTexelBufferArrayDynamicIndexing)
896904
return nullptr;
897905
// not uniform at all
898-
properties.limits.shaderUniformBufferArrayNonUniformIndexing = vulkan12Features.shaderUniformBufferArrayNonUniformIndexing;
899-
if (!vulkan12Features.shaderSampledImageArrayNonUniformIndexing || !vulkan12Features.shaderStorageBufferArrayNonUniformIndexing || !vulkan12Features.shaderStorageImageArrayNonUniformIndexing)
906+
if (!vulkan12Features.shaderUniformBufferArrayNonUniformIndexing || !vulkan12Features.shaderSampledImageArrayNonUniformIndexing || !vulkan12Features.shaderStorageBufferArrayNonUniformIndexing || !vulkan12Features.shaderStorageImageArrayNonUniformIndexing)
900907
return nullptr;
901-
properties.limits.shaderInputAttachmentArrayNonUniformIndexing = vulkan12Features.shaderInputAttachmentArrayNonUniformIndexing;
902-
if (!vulkan12Features.shaderUniformTexelBufferArrayNonUniformIndexing || !vulkan12Features.shaderStorageTexelBufferArrayNonUniformIndexing)
908+
if (!vulkan12Features.shaderInputAttachmentArrayNonUniformIndexing || !vulkan12Features.shaderUniformTexelBufferArrayNonUniformIndexing || !vulkan12Features.shaderStorageTexelBufferArrayNonUniformIndexing)
903909
return nullptr;
904910
// update after bind
905911
properties.limits.descriptorBindingUniformBufferUpdateAfterBind = vulkan12Features.descriptorBindingUniformBufferUpdateAfterBind;
@@ -972,8 +978,8 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
972978

973979
properties.limits.shaderZeroInitializeWorkgroupMemory = vulkan13Features.shaderZeroInitializeWorkgroupMemory;
974980

975-
if (!vulkan13Features.dynamicRendering)
976-
return nullptr;
981+
// not checking dynamicRendering
982+
977983
if (!vulkan13Features.shaderIntegerDotProduct)
978984
return nullptr;
979985
if (!vulkan13Features.maintenance4)
@@ -1120,9 +1126,11 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
11201126
features.rasterizationOrderDepthAttachmentAccess = rasterizationOrderAttachmentAccessFeatures.rasterizationOrderDepthAttachmentAccess;
11211127
features.rasterizationOrderStencilAttachmentAccess = rasterizationOrderAttachmentAccessFeatures.rasterizationOrderStencilAttachmentAccess;
11221128
}
1123-
1129+
#if 0
11241130
if (isExtensionSupported(VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
11251131
features.cooperativeMatrixRobustBufferAccess = cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess;
1132+
#endif
1133+
11261134

11271135
/* Vulkan Extensions Features as Limits */
11281136
if (isExtensionSupported(VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME))
@@ -1567,9 +1575,10 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
15671575

15681576
VkPhysicalDeviceColorWriteEnableFeaturesEXT colorWriteEnableFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT,nullptr };
15691577
enableExtensionIfAvailable(VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME,&colorWriteEnableFeatures);
1570-
1578+
#if 0
15711579
VkPhysicalDeviceCooperativeMatrixFeaturesKHR cooperativeMatrixFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR,nullptr };
15721580
REQUIRE_EXTENSION_IF(enabledFeatures.cooperativeMatrixRobustBufferAccess,VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME,&cooperativeMatrixFeatures);
1581+
#endif
15731582

15741583
#undef REQUIRE_EXTENSION_IF
15751584

@@ -1812,9 +1821,10 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
18121821
rasterizationOrderAttachmentAccessFeatures.rasterizationOrderStencilAttachmentAccess = enabledFeatures.rasterizationOrderStencilAttachmentAccess;
18131822

18141823
//colorWriteEnableFeatures [LIMIT SO ENABLE EVERYTHING BY DEFAULT]
1815-
1824+
#if 0
18161825
cooperativeMatrixFeatures.cooperativeMatrix = true;
18171826
cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess = enabledFeatures.cooperativeMatrixRobustBufferAccess;
1827+
#endif
18181828

18191829
// convert a set into a vector
18201830
core::vector<const char*> extensionStrings(extensionsToEnable.size());

src/nbl/video/device_capabilities/device_features.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"type": "bool",
1010
"name": "robustBufferAccess",
11-
"value": true,
11+
"value": false,
1212
"comment": ["widely supported but has performance overhead, so remains an optional feature to enable"]
1313
},
1414
{
@@ -49,7 +49,7 @@
4949
{
5050
"type": "bool",
5151
"name": "tessellationShader",
52-
"value": true
52+
"value": false
5353
}
5454
]
5555
},
@@ -203,7 +203,7 @@
203203
{
204204
"type": "bool",
205205
"name": "vertexPipelineStoresAndAtomics",
206-
"value": true,
206+
"value": false,
207207
"expose": "MOVE_TO_LIMIT",
208208
"comment": [
209209
"All iOS GPUs don't support"
@@ -212,16 +212,16 @@
212212
{
213213
"type": "bool",
214214
"name": "fragmentStoresAndAtomics",
215-
"value": true,
215+
"value": false,
216216
"expose": "MOVE_TO_LIMIT",
217217
"comment": [
218-
"ROADMAP 2024 no supporton iOS GPUs"
218+
"ROADMAP 2024"
219219
]
220220
},
221221
{
222222
"type": "bool",
223223
"name": "shaderTessellationAndGeometryPointSize",
224-
"value": true,
224+
"value": false,
225225
"expose": "MOVE_TO_LIMIT",
226226
"comment": [
227227
"Candidate for promotion, just need to look into Linux and Android"
@@ -544,7 +544,7 @@
544544
{
545545
"type": "bool",
546546
"name": "samplerYcbcrConversion",
547-
"value": true,
547+
"value": false,
548548
"expose": "DISABLE",
549549
"comment": [
550550
"[DO NOT EXPOSE] ROADMAP 2024 Enables certain formats in Vulkan",
@@ -578,7 +578,7 @@
578578
{
579579
"type": "bool",
580580
"name": "drawIndirectCount",
581-
"value": true,
581+
"value": false,
582582
"expose": "MOVE_TO_LIMIT",
583583
"comment": [
584584
"[EXPOSE AS A LIMIT] ROADMAP 2022 requires support but MoltenVK doesn't support",
@@ -699,7 +699,7 @@
699699
"type": "bool",
700700
"name": "shaderUniformBufferArrayNonUniformIndexing",
701701
"value": true,
702-
"expose": "MOVE_TO_LIMIT",
702+
"expose": "REQUIRE",
703703
"comment": ["[EXPOSE AS A LIMIT] ROADMAP 2024 mandates but poor device support"]
704704
},
705705
{
@@ -726,7 +726,7 @@
726726
"type": "bool",
727727
"name": "shaderInputAttachmentArrayNonUniformIndexing",
728728
"value": true,
729-
"expose": "MOVE_TO_LIMIT",
729+
"expose": "REQUIRE",
730730
"comment": ["[EXPOSE AS A LIMIT] This is for a SPIR-V capability, the overhead should only be incurred if the pipeline uses this capability"]
731731
},
732732
{
@@ -836,7 +836,7 @@
836836
{
837837
"type": "bool",
838838
"name": "imagelessFramebuffer",
839-
"value": true,
839+
"value": false,
840840
"expose": "DISABLE",
841841
"comment": [
842842
"[DO NOT EXPOSE] Decided against exposing, API is braindead, for details see: https://github.com/Devsh-Graphics-Programming/Nabla/issues/378",
@@ -950,14 +950,14 @@
950950
{
951951
"type": "bool",
952952
"name": "shaderOutputViewportIndex",
953-
"value": true,
953+
"value": false,
954954
"expose": "MOVE_TO_LIMIT",
955955
"comment": ["ALIAS: VK_EXT_shader_viewport_index_layer"]
956956
},
957957
{
958958
"type": "bool",
959959
"name": "shaderOutputLayer",
960-
"value": true,
960+
"value": false,
961961
"expose": "MOVE_TO_LIMIT",
962962
"comment": ["ALIAS: VK_EXT_shader_viewport_index_layer"]
963963
}

0 commit comments

Comments
 (0)