Skip to content

Commit c15b84e

Browse files
Merge pull request #846 from Devsh-Graphics-Programming/revert-some-device-limits
video: Revert some device limit changes from #829
2 parents 3f292b7 + 10c3cbb commit c15b84e

File tree

2 files changed

+36
-60
lines changed

2 files changed

+36
-60
lines changed

src/nbl/video/CVulkanPhysicalDevice.cpp

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -401,16 +401,22 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
401401
//vulkan12Properties.denormBehaviorIndependence;
402402
//vulkan12Properties.denormBehaviorIndependence;
403403

404+
//! preserve of 16bit float checked later when features are known
404405
if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat32)
405406
return nullptr;
406-
if (!vulkan12Properties.shaderDenormPreserveFloat32)
407-
return nullptr;
408-
if (!vulkan12Properties.shaderDenormFlushToZeroFloat32)
409-
return nullptr;
410-
if (!vulkan12Properties.shaderRoundingModeRTEFloat32)
411-
return nullptr;
412-
if (!vulkan12Properties.shaderRoundingModeRTZFloat32)
413-
return nullptr;
407+
properties.limits.shaderSignedZeroInfNanPreserveFloat64 = vulkan12Properties.shaderSignedZeroInfNanPreserveFloat64;
408+
properties.limits.shaderDenormPreserveFloat16 = vulkan12Properties.shaderDenormPreserveFloat16;
409+
properties.limits.shaderDenormPreserveFloat32 = vulkan12Properties.shaderDenormPreserveFloat32;
410+
properties.limits.shaderDenormPreserveFloat64 = vulkan12Properties.shaderDenormPreserveFloat64;
411+
properties.limits.shaderDenormFlushToZeroFloat16 = vulkan12Properties.shaderDenormFlushToZeroFloat16;
412+
properties.limits.shaderDenormFlushToZeroFloat32 = vulkan12Properties.shaderDenormFlushToZeroFloat32;
413+
properties.limits.shaderDenormFlushToZeroFloat64 = vulkan12Properties.shaderDenormFlushToZeroFloat64;
414+
properties.limits.shaderRoundingModeRTEFloat16 = vulkan12Properties.shaderRoundingModeRTEFloat16;
415+
properties.limits.shaderRoundingModeRTEFloat32 = vulkan12Properties.shaderRoundingModeRTEFloat32;
416+
properties.limits.shaderRoundingModeRTEFloat64 = vulkan12Properties.shaderRoundingModeRTEFloat64;
417+
properties.limits.shaderRoundingModeRTZFloat16 = vulkan12Properties.shaderRoundingModeRTZFloat16;
418+
properties.limits.shaderRoundingModeRTZFloat32 = vulkan12Properties.shaderRoundingModeRTZFloat32;
419+
properties.limits.shaderRoundingModeRTZFloat64 = vulkan12Properties.shaderRoundingModeRTZFloat64;
414420

415421
// descriptor indexing
416422
properties.limits.maxUpdateAfterBindDescriptorsInAllPools = vulkan12Properties.maxUpdateAfterBindDescriptorsInAllPools;
@@ -898,34 +904,15 @@ std::unique_ptr<CVulkanPhysicalDevice> CVulkanPhysicalDevice::create(core::smart
898904
properties.limits.shaderSharedInt64Atomics = vulkan12Features.shaderSharedInt64Atomics;
899905

900906
properties.limits.shaderFloat16 = vulkan12Features.shaderFloat16;
907+
if (!vulkan12Features.shaderFloat16)
908+
{
909+
// only fail if 16bit floats can be used
910+
if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat16)
911+
return nullptr;
912+
}
913+
901914
if (!vulkan12Features.shaderInt8)
902915
return nullptr;
903-
904-
if (properties.limits.shaderFloat16) {
905-
if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat16)
906-
return nullptr;
907-
if (!vulkan12Properties.shaderDenormPreserveFloat16)
908-
return nullptr;
909-
if (!vulkan12Properties.shaderDenormFlushToZeroFloat16)
910-
return nullptr;
911-
if (!vulkan12Properties.shaderRoundingModeRTEFloat16)
912-
return nullptr;
913-
if (!vulkan12Properties.shaderRoundingModeRTZFloat16)
914-
return nullptr;
915-
}
916-
917-
if (properties.limits.shaderFloat64) {
918-
if (!vulkan12Properties.shaderSignedZeroInfNanPreserveFloat64)
919-
return nullptr;
920-
if (!vulkan12Properties.shaderDenormPreserveFloat64)
921-
return nullptr;
922-
if (!vulkan12Properties.shaderDenormFlushToZeroFloat64)
923-
return nullptr;
924-
if (!vulkan12Properties.shaderRoundingModeRTEFloat64)
925-
return nullptr;
926-
if (!vulkan12Properties.shaderRoundingModeRTZFloat64)
927-
return nullptr;
928-
}
929916

930917
if (!vulkan12Features.descriptorIndexing)
931918
return nullptr;
@@ -1918,4 +1905,4 @@ core::smart_refctd_ptr<ILogicalDevice> CVulkanPhysicalDevice::createLogicalDevic
19181905
return core::make_smart_refctd_ptr<CVulkanLogicalDevice>(core::smart_refctd_ptr<const IAPIConnection>(m_initData.api),m_rdoc_api,this,vk_device,params);
19191906
}
19201907

1921-
}
1908+
}

src/nbl/video/device_capabilities/device_limits.json

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -915,80 +915,69 @@
915915
{
916916
"type": "bool",
917917
"name": "shaderSignedZeroInfNanPreserveFloat64",
918-
"value": false,
919-
"expose": "DISABLE"
918+
"value": false
920919
},
921920
{
922921
"type": "bool",
923922
"name": "shaderDenormPreserveFloat16",
924-
"value": false,
925-
"expose": "DISABLE"
923+
"value": false
926924
},
927925
{
928926
"type": "bool",
929927
"name": "shaderDenormPreserveFloat32",
930-
"value": true,
931-
"expose": "REQUIRE"
928+
"value": false
932929
},
933930
{
934931
"type": "bool",
935932
"name": "shaderDenormPreserveFloat64",
936-
"value": false,
937-
"expose": "DISABLE"
933+
"value": false
938934
},
939935
{
940936
"type": "bool",
941937
"name": "shaderDenormFlushToZeroFloat16",
942-
"value": false,
943-
"expose": "DISABLE"
938+
"value": false
944939
},
945940
{
946941
"type": "bool",
947942
"name": "shaderDenormFlushToZeroFloat32",
948-
"value": true,
949-
"expose": "REQUIRE"
943+
"value": false
950944
},
951945
{
952946
"type": "bool",
953947
"name": "shaderDenormFlushToZeroFloat64",
954-
"value": false,
955-
"expose": "DISABLE"
948+
"value": false
956949
},
957950
{
958951
"type": "bool",
959952
"name": "shaderRoundingModeRTEFloat16",
960953
"value": false,
961-
"expose": "DISABLE"
954+
"comment": ["ROADMAP2024 but no good support yet"]
962955
},
963956
{
964957
"type": "bool",
965958
"name": "shaderRoundingModeRTEFloat32",
966-
"value": true,
967-
"expose": "REQUIRE"
959+
"value": false,
960+
"comment": ["ROADMAP2024 but no good support yet"]
968961
},
969962
{
970963
"type": "bool",
971964
"name": "shaderRoundingModeRTEFloat64",
972-
"value": false,
973-
"expose": "DISABLE"
965+
"value": false
974966
},
975967
{
976968
"type": "bool",
977969
"name": "shaderRoundingModeRTZFloat16",
978-
"value": false,
979-
"expose": "DISABLE"
970+
"value": false
980971
},
981972
{
982973
"type": "bool",
983974
"name": "shaderRoundingModeRTZFloat32",
984-
"value": true,
985-
"expose": "REQUIRE"
975+
"value": false
986976
},
987977
{
988978
"type": "bool",
989979
"name": "shaderRoundingModeRTZFloat64",
990-
"value": false,
991-
"expose": "DISABLE"
980+
"value": false
992981
}
993982
]
994983
},

0 commit comments

Comments
 (0)