@@ -304,9 +304,7 @@ 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
308307 VkPhysicalDeviceCooperativeMatrixPropertiesKHR cooperativeMatrixProperties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR };
309- #endif
310308 VkPhysicalDeviceShaderSMBuiltinsPropertiesNV shaderSMBuiltinsPropertiesNV = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV };
311309 VkPhysicalDeviceShaderCoreProperties2AMD shaderCoreProperties2AMD = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD };
312310 // ! Because Renderdoc is special and instead of ignoring extensions it whitelists them
@@ -331,10 +329,8 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
331329 addToPNextChain (&fragmentDensityMap2Properties);
332330 if (isExtensionSupported (VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME))
333331 addToPNextChain (&rayTracingPipelineProperties);
334- #if 0 // TODO
335332 if (isExtensionSupported (VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
336333 addToPNextChain (&cooperativeMatrixProperties);
337- #endif
338334 if (isExtensionSupported (VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME))
339335 addToPNextChain (&shaderSMBuiltinsPropertiesNV);
340336 if (isExtensionSupported (VK_AMD_SHADER_CORE_PROPERTIES_2_EXTENSION_NAME))
@@ -398,19 +394,32 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
398394 return nullptr ;
399395 if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat32 )
400396 return nullptr ;
401- properties.limits .shaderSignedZeroInfNanPreserveFloat64 = vulkan12Properties.shaderSignedZeroInfNanPreserveFloat64 ;
402- properties.limits .shaderDenormPreserveFloat16 = vulkan12Properties.shaderDenormPreserveFloat16 ;
403- properties.limits .shaderDenormPreserveFloat32 = vulkan12Properties.shaderDenormPreserveFloat32 ;
404- properties.limits .shaderDenormPreserveFloat64 = vulkan12Properties.shaderDenormPreserveFloat64 ;
405- properties.limits .shaderDenormFlushToZeroFloat16 = vulkan12Properties.shaderDenormFlushToZeroFloat16 ;
406- properties.limits .shaderDenormFlushToZeroFloat32 = vulkan12Properties.shaderDenormFlushToZeroFloat32 ;
407- properties.limits .shaderDenormFlushToZeroFloat64 = vulkan12Properties.shaderDenormFlushToZeroFloat64 ;
408- properties.limits .shaderRoundingModeRTEFloat16 = vulkan12Properties.shaderRoundingModeRTEFloat16 ;
409- properties.limits .shaderRoundingModeRTEFloat32 = vulkan12Properties.shaderRoundingModeRTEFloat32 ;
410- properties.limits .shaderRoundingModeRTEFloat64 = vulkan12Properties.shaderRoundingModeRTEFloat64 ;
411- properties.limits .shaderRoundingModeRTZFloat16 = vulkan12Properties.shaderRoundingModeRTZFloat16 ;
412- properties.limits .shaderRoundingModeRTZFloat32 = vulkan12Properties.shaderRoundingModeRTZFloat32 ;
413- properties.limits .shaderRoundingModeRTZFloat64 = vulkan12Properties.shaderRoundingModeRTZFloat64 ;
397+ if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat64 )
398+ return nullptr ;
399+ if (!vulkan12Properties.shaderDenormPreserveFloat16 )
400+ return nullptr ;
401+ if (!vulkan12Properties.shaderDenormPreserveFloat32 )
402+ return nullptr ;
403+ if (!vulkan12Properties.shaderDenormPreserveFloat64 )
404+ return nullptr ;
405+ if (!vulkan12Properties.shaderDenormFlushToZeroFloat16 )
406+ return nullptr ;
407+ if (!vulkan12Properties.shaderDenormFlushToZeroFloat32 )
408+ return nullptr ;
409+ if (!vulkan12Properties.shaderDenormFlushToZeroFloat64 )
410+ return nullptr ;
411+ if (!vulkan12Properties.shaderRoundingModeRTEFloat16 )
412+ return nullptr ;
413+ if (!vulkan12Properties.shaderRoundingModeRTEFloat32 )
414+ return nullptr ;
415+ if (!vulkan12Properties.shaderRoundingModeRTEFloat64 )
416+ return nullptr ;
417+ if (!vulkan12Properties.shaderRoundingModeRTZFloat16 )
418+ return nullptr ;
419+ if (!vulkan12Properties.shaderRoundingModeRTZFloat32 )
420+ return nullptr ;
421+ if (!vulkan12Properties.shaderRoundingModeRTZFloat64 )
422+ return nullptr ;
414423
415424 // descriptor indexing
416425 properties.limits .maxUpdateAfterBindDescriptorsInAllPools = vulkan12Properties.maxUpdateAfterBindDescriptorsInAllPools ;
@@ -439,8 +448,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
439448
440449 properties.limits .supportedDepthResolveModes = static_cast <SPhysicalDeviceLimits::RESOLVE_MODE_FLAGS>(vulkan12Properties.supportedDepthResolveModes );
441450 properties.limits .supportedStencilResolveModes = static_cast <SPhysicalDeviceLimits::RESOLVE_MODE_FLAGS>(vulkan12Properties.supportedStencilResolveModes );
442- properties.limits .independentResolveNone = vulkan12Properties.independentResolveNone ;
443- properties.limits .independentResolve = vulkan12Properties.independentResolve ;
451+
452+ if (!vulkan12Properties.independentResolve || !vulkan12Properties.independentResolveNone )
453+ return nullptr ;
444454
445455 // not dealing with vulkan12Properties.filterMinmaxSingleComponentFormats, TODO report in usage
446456 properties.limits .filterMinmaxImageComponentMapping = vulkan12Properties.filterMinmaxImageComponentMapping ;
@@ -608,10 +618,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
608618 properties.limits .shaderGroupHandleAlignment = rayTracingPipelineProperties.shaderGroupHandleAlignment ;
609619 properties.limits .maxRayHitAttributeSize = rayTracingPipelineProperties.maxRayHitAttributeSize ;
610620 }
611- # if 0 //TODO
621+
612622 if (isExtensionSupported (VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
613623 properties.limits .cooperativeMatrixSupportedStages = static_cast <asset::IShader::E_SHADER_STAGE>(cooperativeMatrixProperties.cooperativeMatrixSupportedStages );
614- #endif
615624
616625
617626 // ! Nabla
@@ -707,9 +716,8 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
707716 VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM rasterizationOrderAttachmentAccessFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM };
708717 VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR rayTracingPositionFetchFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR };
709718 VkPhysicalDeviceColorWriteEnableFeaturesEXT colorWriteEnableFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT };
710- #if 0
711719 VkPhysicalDeviceCooperativeMatrixFeaturesKHR cooperativeMatrixFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR };
712- # endif
720+
713721 if (isExtensionSupported (VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME))
714722 addToPNextChain (&conditionalRenderingFeatures);
715723 if (isExtensionSupported (VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME))
@@ -1126,10 +1134,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
11261134 features.rasterizationOrderDepthAttachmentAccess = rasterizationOrderAttachmentAccessFeatures.rasterizationOrderDepthAttachmentAccess ;
11271135 features.rasterizationOrderStencilAttachmentAccess = rasterizationOrderAttachmentAccessFeatures.rasterizationOrderStencilAttachmentAccess ;
11281136 }
1129- # if 0
1137+
11301138 if (isExtensionSupported (VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
11311139 features.cooperativeMatrixRobustBufferAccess = cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess ;
1132- #endif
11331140
11341141
11351142 /* Vulkan Extensions Features as Limits */
@@ -1202,10 +1209,9 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
12021209
12031210 if (isExtensionSupported (VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME))
12041211 properties.limits .colorWriteEnable = colorWriteEnableFeatures.colorWriteEnable ;
1205- # if 0 //TODO
1212+
12061213 if (isExtensionSupported (VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME))
1207- properties.limits.cooperativeMatrixRobustness = cooperativeMatrixFeatures.robustness;
1208- #endif
1214+ properties.limits .cooperativeMatrixRobustBufferAccess = cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess ;
12091215 }
12101216
12111217 // we compare all limits against the defaults easily!
@@ -1575,10 +1581,9 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
15751581
15761582 VkPhysicalDeviceColorWriteEnableFeaturesEXT colorWriteEnableFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT,nullptr };
15771583 enableExtensionIfAvailable (VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME,&colorWriteEnableFeatures);
1578- # if 0
1584+
15791585 VkPhysicalDeviceCooperativeMatrixFeaturesKHR cooperativeMatrixFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR,nullptr };
15801586 REQUIRE_EXTENSION_IF (enabledFeatures.cooperativeMatrixRobustBufferAccess ,VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME,&cooperativeMatrixFeatures);
1581- #endif
15821587
15831588 #undef REQUIRE_EXTENSION_IF
15841589
@@ -1821,10 +1826,11 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
18211826 rasterizationOrderAttachmentAccessFeatures.rasterizationOrderStencilAttachmentAccess = enabledFeatures.rasterizationOrderStencilAttachmentAccess ;
18221827
18231828 // colorWriteEnableFeatures [LIMIT SO ENABLE EVERYTHING BY DEFAULT]
1824- #if 0
1825- cooperativeMatrixFeatures.cooperativeMatrix = true;
1826- cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess = enabledFeatures.cooperativeMatrixRobustBufferAccess;
1827- #endif
1829+
1830+ if (limits.cooperativeMatrix ) {
1831+ cooperativeMatrixFeatures.cooperativeMatrix = enabledFeatures.cooperativeMatrix ;
1832+ cooperativeMatrixFeatures.cooperativeMatrixRobustBufferAccess = enabledFeatures.cooperativeMatrixRobustBufferAccess ;
1833+ }
18281834
18291835 // convert a set into a vector
18301836 core::vector<const char *> extensionStrings (extensionsToEnable.size ());
0 commit comments