Skip to content

Commit 9825eb1

Browse files
authored
Conditionalize dependency on the Vulkan 1.4 SDK (#323)
Some linux distros still only have the Vulkan 1.3 SDK readily available - this allows folks using those to run these tests without jumping through too many hoops.
1 parent 266bdd7 commit 9825eb1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/API/VK/Device.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,17 @@ class VKDevice : public offloadtest::Device {
324324
Features12.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES;
325325
VkPhysicalDeviceVulkan13Features Features13{};
326326
Features13.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES;
327+
#ifdef VK_VERSION_1_4
327328
VkPhysicalDeviceVulkan14Features Features14{};
328329
Features14.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES;
330+
#endif
329331

330332
Features.pNext = &Features11;
331333
Features11.pNext = &Features12;
332334
Features12.pNext = &Features13;
335+
#ifdef VK_VERSION_1_4
333336
Features13.pNext = &Features14;
334-
Features14.pNext = NULL;
337+
#endif
335338
vkGetPhysicalDeviceFeatures2(Device, &Features);
336339

337340
Caps.insert(std::make_pair(
@@ -356,9 +359,11 @@ class VKDevice : public offloadtest::Device {
356359
#define VULKAN13_FEATURE_BOOL(Name) \
357360
Caps.insert( \
358361
std::make_pair(#Name, make_capability<bool>(#Name, Features13.Name)));
362+
#ifdef VK_VERSION_1_4
359363
#define VULKAN14_FEATURE_BOOL(Name) \
360364
Caps.insert( \
361365
std::make_pair(#Name, make_capability<bool>(#Name, Features14.Name)));
366+
#endif
362367
#include "VKFeatures.def"
363368
}
364369

@@ -426,14 +431,17 @@ class VKDevice : public offloadtest::Device {
426431
Features12.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES;
427432
VkPhysicalDeviceVulkan13Features Features13{};
428433
Features13.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES;
434+
#ifdef VK_VERSION_1_4
429435
VkPhysicalDeviceVulkan14Features Features14{};
430436
Features14.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES;
437+
#endif
431438

432439
Features.pNext = &Features11;
433440
Features11.pNext = &Features12;
434441
Features12.pNext = &Features13;
442+
#ifdef VK_VERSION_1_4
435443
Features13.pNext = &Features14;
436-
Features14.pNext = NULL;
444+
#endif
437445
vkGetPhysicalDeviceFeatures2(Device, &Features);
438446

439447
DeviceInfo.pEnabledFeatures = &Features.features;

0 commit comments

Comments
 (0)