@@ -1284,6 +1284,30 @@ bool Context::create_device(VkPhysicalDevice gpu_, VkSurfaceKHR surface,
1284
1284
{
1285
1285
if (has_extension (VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME))
1286
1286
ADD_CHAIN (ext.host_query_reset_features , HOST_QUERY_RESET_FEATURES);
1287
+
1288
+ if (has_extension (VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME))
1289
+ {
1290
+ ADD_CHAIN (ext.float16_int8_features , FLOAT16_INT8_FEATURES_KHR);
1291
+ enabled_extensions.push_back (VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME);
1292
+ }
1293
+
1294
+ if (has_extension (VK_KHR_16BIT_STORAGE_EXTENSION_NAME))
1295
+ {
1296
+ ADD_CHAIN (ext.storage_16bit_features , 16BIT_STORAGE_FEATURES_KHR);
1297
+ enabled_extensions.push_back (VK_KHR_16BIT_STORAGE_EXTENSION_NAME);
1298
+ }
1299
+
1300
+ if (has_extension (VK_KHR_8BIT_STORAGE_EXTENSION_NAME))
1301
+ {
1302
+ ADD_CHAIN (ext.storage_8bit_features , 8BIT_STORAGE_FEATURES_KHR);
1303
+ enabled_extensions.push_back (VK_KHR_8BIT_STORAGE_EXTENSION_NAME);
1304
+ }
1305
+
1306
+ if (has_extension (VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME))
1307
+ {
1308
+ ADD_CHAIN (ext.subgroup_size_control_features , SUBGROUP_SIZE_CONTROL_FEATURES_EXT);
1309
+ enabled_extensions.push_back (VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME);
1310
+ }
1287
1311
}
1288
1312
1289
1313
if (ext.device_api_core_version >= VK_API_VERSION_1_3)
@@ -1428,9 +1452,37 @@ bool Context::create_device(VkPhysicalDevice gpu_, VkSurfaceKHR surface,
1428
1452
vkGetPhysicalDeviceFeatures2 (gpu, &pdf2);
1429
1453
}
1430
1454
1455
+ // Promote fallback features to core structs.
1431
1456
if (ext.host_query_reset_features .hostQueryReset )
1432
1457
ext.vk12_features .hostQueryReset = VK_TRUE;
1433
1458
1459
+ if (ext.storage_16bit_features .storageBuffer16BitAccess )
1460
+ ext.vk11_features .storageBuffer16BitAccess = VK_TRUE;
1461
+ if (ext.storage_16bit_features .storageInputOutput16 )
1462
+ ext.vk11_features .storageInputOutput16 = VK_TRUE;
1463
+ if (ext.storage_16bit_features .storagePushConstant16 )
1464
+ ext.vk11_features .storagePushConstant16 = VK_TRUE;
1465
+ if (ext.storage_16bit_features .uniformAndStorageBuffer16BitAccess )
1466
+ ext.vk11_features .uniformAndStorageBuffer16BitAccess = VK_TRUE;
1467
+
1468
+ if (ext.storage_8bit_features .storageBuffer8BitAccess )
1469
+ ext.vk12_features .storageBuffer8BitAccess = VK_TRUE;
1470
+ if (ext.storage_8bit_features .storagePushConstant8 )
1471
+ ext.vk12_features .storagePushConstant8 = VK_TRUE;
1472
+ if (ext.storage_8bit_features .uniformAndStorageBuffer8BitAccess )
1473
+ ext.vk12_features .uniformAndStorageBuffer8BitAccess = VK_TRUE;
1474
+
1475
+ if (ext.float16_int8_features .shaderFloat16 )
1476
+ ext.vk12_features .shaderFloat16 = VK_TRUE;
1477
+ if (ext.float16_int8_features .shaderInt8 )
1478
+ ext.vk12_features .shaderInt8 = VK_TRUE;
1479
+
1480
+ if (ext.subgroup_size_control_features .computeFullSubgroups )
1481
+ ext.vk13_features .computeFullSubgroups = VK_TRUE;
1482
+ if (ext.subgroup_size_control_features .subgroupSizeControl )
1483
+ ext.vk13_features .subgroupSizeControl = VK_TRUE;
1484
+ // /
1485
+
1434
1486
ext.vk11_features .multiviewGeometryShader = VK_FALSE;
1435
1487
ext.vk11_features .multiviewTessellationShader = VK_FALSE;
1436
1488
ext.vk11_features .protectedMemory = VK_FALSE;
@@ -1447,6 +1499,7 @@ bool Context::create_device(VkPhysicalDevice gpu_, VkSurfaceKHR surface,
1447
1499
1448
1500
ext.mesh_shader_features .primitiveFragmentShadingRateMeshShader = VK_FALSE;
1449
1501
ext.mesh_shader_features .meshShaderQueries = VK_FALSE;
1502
+ ext.mesh_shader_features .multiviewMeshShader = VK_FALSE;
1450
1503
1451
1504
ext.device_generated_commands_compute_features .deviceGeneratedComputeCaptureReplay = VK_FALSE;
1452
1505
// TODO
@@ -1516,6 +1569,7 @@ bool Context::create_device(VkPhysicalDevice gpu_, VkSurfaceKHR surface,
1516
1569
VkPhysicalDeviceDriverProperties driver_properties = {};
1517
1570
VkPhysicalDeviceIDProperties id_properties = {};
1518
1571
VkPhysicalDeviceSubgroupProperties subgroup_properties = {};
1572
+ VkPhysicalDeviceSubgroupSizeControlProperties size_control_props = {};
1519
1573
ppNext = &props.pNext ;
1520
1574
1521
1575
if (ext.device_api_core_version >= VK_API_VERSION_1_2)
@@ -1527,6 +1581,8 @@ bool Context::create_device(VkPhysicalDevice gpu_, VkSurfaceKHR surface,
1527
1581
{
1528
1582
if (has_extension (VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME))
1529
1583
ADD_CHAIN (driver_properties, DRIVER_PROPERTIES);
1584
+ if (has_extension (VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME))
1585
+ ADD_CHAIN (size_control_props, SUBGROUP_SIZE_CONTROL_PROPERTIES);
1530
1586
ADD_CHAIN (id_properties, ID_PROPERTIES);
1531
1587
ADD_CHAIN (subgroup_properties, SUBGROUP_PROPERTIES);
1532
1588
}
@@ -1565,6 +1621,14 @@ bool Context::create_device(VkPhysicalDevice gpu_, VkSurfaceKHR surface,
1565
1621
else
1566
1622
ext.driver_id = ext.vk12_props .driverID ;
1567
1623
1624
+ if (ext.device_api_core_version < VK_API_VERSION_1_3)
1625
+ {
1626
+ ext.vk13_props .minSubgroupSize = size_control_props.minSubgroupSize ;
1627
+ ext.vk13_props .maxSubgroupSize = size_control_props.maxSubgroupSize ;
1628
+ ext.vk13_props .requiredSubgroupSizeStages = size_control_props.requiredSubgroupSizeStages ;
1629
+ ext.vk13_props .maxComputeWorkgroupSubgroups = size_control_props.maxComputeWorkgroupSubgroups ;
1630
+ }
1631
+
1568
1632
#ifdef GRANITE_VULKAN_PROFILES
1569
1633
// Override any properties in the profile in strict mode.
1570
1634
if (profile.profile && required_profile_strict)
0 commit comments