Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video: adjust device_limits/features to the updated profiles #829

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions src/nbl/video/CVulkanPhysicalDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
//VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT graphicsPipelineLibraryProperties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT };
VkPhysicalDeviceFragmentDensityMap2PropertiesEXT fragmentDensityMap2Properties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT };
VkPhysicalDeviceRayTracingPipelinePropertiesKHR rayTracingPipelineProperties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR };
#if 0 // TODO
VkPhysicalDeviceCooperativeMatrixPropertiesKHR cooperativeMatrixProperties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR };
#endif
VkPhysicalDeviceShaderSMBuiltinsPropertiesNV shaderSMBuiltinsPropertiesNV = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV };
VkPhysicalDeviceShaderCoreProperties2AMD shaderCoreProperties2AMD = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD };
//! Because Renderdoc is special and instead of ignoring extensions it whitelists them
Expand All @@ -329,8 +331,10 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
addToPNextChain(&fragmentDensityMap2Properties);
if (isExtensionSupported(VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME))
addToPNextChain(&rayTracingPipelineProperties);
#if 0 // TODO
if (isExtensionSupported(VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
addToPNextChain(&cooperativeMatrixProperties);
#endif
if (isExtensionSupported(VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME))
addToPNextChain(&shaderSMBuiltinsPropertiesNV);
if (isExtensionSupported(VK_AMD_SHADER_CORE_PROPERTIES_2_EXTENSION_NAME))
Expand Down Expand Up @@ -604,9 +608,11 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
properties.limits.shaderGroupHandleAlignment = rayTracingPipelineProperties.shaderGroupHandleAlignment;
properties.limits.maxRayHitAttributeSize = rayTracingPipelineProperties.maxRayHitAttributeSize;
}

#if 0 //TODO
if (isExtensionSupported(VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
properties.limits.cooperativeMatrixSupportedStages = static_cast<asset::IShader::E_SHADER_STAGE>(cooperativeMatrixProperties.cooperativeMatrixSupportedStages);
#endif


//! Nabla
if (isExtensionSupported(VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME))
Expand Down Expand Up @@ -701,7 +707,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM rasterizationOrderAttachmentAccessFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM };
VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR rayTracingPositionFetchFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR };
VkPhysicalDeviceColorWriteEnableFeaturesEXT colorWriteEnableFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT };
#if 0
VkPhysicalDeviceCooperativeMatrixFeaturesKHR cooperativeMatrixFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR };
#endif
if (isExtensionSupported(VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME))
addToPNextChain(&conditionalRenderingFeatures);
if (isExtensionSupported(VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME))
Expand Down Expand Up @@ -895,11 +903,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
if (!vulkan12Features.shaderUniformTexelBufferArrayDynamicIndexing || !vulkan12Features.shaderStorageTexelBufferArrayDynamicIndexing)
return nullptr;
// not uniform at all
properties.limits.shaderUniformBufferArrayNonUniformIndexing = vulkan12Features.shaderUniformBufferArrayNonUniformIndexing;
if (!vulkan12Features.shaderSampledImageArrayNonUniformIndexing || !vulkan12Features.shaderStorageBufferArrayNonUniformIndexing || !vulkan12Features.shaderStorageImageArrayNonUniformIndexing)
if (!vulkan12Features.shaderUniformBufferArrayNonUniformIndexing || !vulkan12Features.shaderSampledImageArrayNonUniformIndexing || !vulkan12Features.shaderStorageBufferArrayNonUniformIndexing || !vulkan12Features.shaderStorageImageArrayNonUniformIndexing)
return nullptr;
properties.limits.shaderInputAttachmentArrayNonUniformIndexing = vulkan12Features.shaderInputAttachmentArrayNonUniformIndexing;
if (!vulkan12Features.shaderUniformTexelBufferArrayNonUniformIndexing || !vulkan12Features.shaderStorageTexelBufferArrayNonUniformIndexing)
if (!vulkan12Features.shaderInputAttachmentArrayNonUniformIndexing || !vulkan12Features.shaderUniformTexelBufferArrayNonUniformIndexing || !vulkan12Features.shaderStorageTexelBufferArrayNonUniformIndexing)
return nullptr;
// update after bind
properties.limits.descriptorBindingUniformBufferUpdateAfterBind = vulkan12Features.descriptorBindingUniformBufferUpdateAfterBind;
Expand Down Expand Up @@ -972,8 +978,8 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart

properties.limits.shaderZeroInitializeWorkgroupMemory = vulkan13Features.shaderZeroInitializeWorkgroupMemory;

if (!vulkan13Features.dynamicRendering)
return nullptr;
// not checking dynamicRendering

if (!vulkan13Features.shaderIntegerDotProduct)
return nullptr;
if (!vulkan13Features.maintenance4)
Expand Down Expand Up @@ -1120,9 +1126,11 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
features.rasterizationOrderDepthAttachmentAccess = rasterizationOrderAttachmentAccessFeatures.rasterizationOrderDepthAttachmentAccess;
features.rasterizationOrderStencilAttachmentAccess = rasterizationOrderAttachmentAccessFeatures.rasterizationOrderStencilAttachmentAccess;
}

#if 0
if (isExtensionSupported(VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
features.cooperativeMatrixRobustBufferAccess = cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess;
#endif


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

VkPhysicalDeviceColorWriteEnableFeaturesEXT colorWriteEnableFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT,nullptr };
enableExtensionIfAvailable(VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME,&colorWriteEnableFeatures);

#if 0
VkPhysicalDeviceCooperativeMatrixFeaturesKHR cooperativeMatrixFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR,nullptr };
REQUIRE_EXTENSION_IF(enabledFeatures.cooperativeMatrixRobustBufferAccess,VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME,&cooperativeMatrixFeatures);
#endif

#undef REQUIRE_EXTENSION_IF

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

//colorWriteEnableFeatures [LIMIT SO ENABLE EVERYTHING BY DEFAULT]

#if 0
cooperativeMatrixFeatures.cooperativeMatrix = true;
cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess = enabledFeatures.cooperativeMatrixRobustBufferAccess;
#endif

// convert a set into a vector
core::vector<const char*> extensionStrings(extensionsToEnable.size());
Expand Down
26 changes: 13 additions & 13 deletions src/nbl/video/device_capabilities/device_features.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"type": "bool",
"name": "robustBufferAccess",
"value": true,
"value": false,
"comment": ["widely supported but has performance overhead, so remains an optional feature to enable"]
},
{
Expand Down Expand Up @@ -49,7 +49,7 @@
{
"type": "bool",
"name": "tessellationShader",
"value": true
"value": false
}
]
},
Expand Down Expand Up @@ -203,7 +203,7 @@
{
"type": "bool",
"name": "vertexPipelineStoresAndAtomics",
"value": true,
"value": false,
"expose": "MOVE_TO_LIMIT",
"comment": [
"All iOS GPUs don't support"
Expand All @@ -212,16 +212,16 @@
{
"type": "bool",
"name": "fragmentStoresAndAtomics",
"value": true,
"value": false,
"expose": "MOVE_TO_LIMIT",
"comment": [
"ROADMAP 2024 no supporton iOS GPUs"
"ROADMAP 2024"
]
},
{
"type": "bool",
"name": "shaderTessellationAndGeometryPointSize",
"value": true,
"value": false,
"expose": "MOVE_TO_LIMIT",
"comment": [
"Candidate for promotion, just need to look into Linux and Android"
Expand Down Expand Up @@ -544,7 +544,7 @@
{
"type": "bool",
"name": "samplerYcbcrConversion",
"value": true,
"value": false,
"expose": "DISABLE",
"comment": [
"[DO NOT EXPOSE] ROADMAP 2024 Enables certain formats in Vulkan",
Expand Down Expand Up @@ -578,7 +578,7 @@
{
"type": "bool",
"name": "drawIndirectCount",
"value": true,
"value": false,
"expose": "MOVE_TO_LIMIT",
"comment": [
"[EXPOSE AS A LIMIT] ROADMAP 2022 requires support but MoltenVK doesn't support",
Expand Down Expand Up @@ -699,7 +699,7 @@
"type": "bool",
"name": "shaderUniformBufferArrayNonUniformIndexing",
"value": true,
"expose": "MOVE_TO_LIMIT",
"expose": "REQUIRE",
"comment": ["[EXPOSE AS A LIMIT] ROADMAP 2024 mandates but poor device support"]
},
{
Expand All @@ -726,7 +726,7 @@
"type": "bool",
"name": "shaderInputAttachmentArrayNonUniformIndexing",
"value": true,
"expose": "MOVE_TO_LIMIT",
"expose": "REQUIRE",
"comment": ["[EXPOSE AS A LIMIT] This is for a SPIR-V capability, the overhead should only be incurred if the pipeline uses this capability"]
},
{
Expand Down Expand Up @@ -836,7 +836,7 @@
{
"type": "bool",
"name": "imagelessFramebuffer",
"value": true,
"value": false,
"expose": "DISABLE",
"comment": [
"[DO NOT EXPOSE] Decided against exposing, API is braindead, for details see: https://github.com/Devsh-Graphics-Programming/Nabla/issues/378",
Expand Down Expand Up @@ -950,14 +950,14 @@
{
"type": "bool",
"name": "shaderOutputViewportIndex",
"value": true,
"value": false,
"expose": "MOVE_TO_LIMIT",
"comment": ["ALIAS: VK_EXT_shader_viewport_index_layer"]
},
{
"type": "bool",
"name": "shaderOutputLayer",
"value": true,
"value": false,
"expose": "MOVE_TO_LIMIT",
"comment": ["ALIAS: VK_EXT_shader_viewport_index_layer"]
}
Expand Down
Loading