11package tests
22
33import io.kotlintest.specs.StringSpec
4+ import main.isNotGithubAction
45import vkk.VkQueueFlag
56import vkk._10.structs.DeviceCreateInfo
67import vkk._10.structs.DeviceQueueCreateInfo
78import vkk.has
8- import vkk.vk
99import vkk.vu
1010
1111class `03 initDevice` : StringSpec () {
@@ -14,30 +14,31 @@ class `03 initDevice` : StringSpec() {
1414 val engineName = " Vulkan.hpp"
1515
1616 init {
17- " 03 initDevice" {
17+ if (isNotGithubAction)
18+ " 03 initDevice" {
1819
19- val instance = vu.createInstance(appName, engineName)
20+ val instance = vu.createInstance(appName, engineName)
2021// if(vk.DEBUG)
2122// vk::UniqueDebugUtilsMessengerEXT debugUtilsMessenger = vk::su::createDebugUtilsMessenger(instance);
2223
23- val physicalDevice = instance.enumeratePhysicalDevices[0 ]
24+ val physicalDevice = instance.enumeratePhysicalDevices[0 ]
2425
25- /* VULKAN_HPP_KEY_START */
26+ /* VULKAN_HPP_KEY_START */
2627
27- // get the QueueFamilyProperties of the first PhysicalDevice
28- val queueFamilyProperties = physicalDevice.queueFamilyProperties
28+ // get the QueueFamilyProperties of the first PhysicalDevice
29+ val queueFamilyProperties = physicalDevice.queueFamilyProperties
2930
30- // get the first index into queueFamiliyProperties which supports graphics
31- val graphicsQueueFamilyIndex = queueFamilyProperties.indexOfFirst { it.queueFlags has VkQueueFlag .GRAPHICS_BIT }
32- assert (graphicsQueueFamilyIndex in queueFamilyProperties.indices)
31+ // get the first index into queueFamiliyProperties which supports graphics
32+ val graphicsQueueFamilyIndex = queueFamilyProperties.indexOfFirst { it.queueFlags has VkQueueFlag .GRAPHICS_BIT }
33+ assert (graphicsQueueFamilyIndex in queueFamilyProperties.indices)
3334
34- // create a UniqueDevice
35- val queuePriority = 0f
36- val deviceQueueCreateInfo = DeviceQueueCreateInfo (0 , graphicsQueueFamilyIndex, queuePriority)
37- val device = physicalDevice.createDeviceUnique(DeviceCreateInfo (0 , deviceQueueCreateInfo))
35+ // create a UniqueDevice
36+ val queuePriority = 0f
37+ val deviceQueueCreateInfo = DeviceQueueCreateInfo (0 , graphicsQueueFamilyIndex, queuePriority)
38+ val device = physicalDevice.createDeviceUnique(DeviceCreateInfo (0 , deviceQueueCreateInfo))
3839
39- // Note: No need to explicitly destroy the device, as the corresponding destroy function is
40- // called by the destructor of the UniqueDevice on leaving this scope.
41- }
40+ // Note: No need to explicitly destroy the device, as the corresponding destroy function is
41+ // called by the destructor of the UniqueDevice on leaving this scope.
42+ }
4243 }
4344}
0 commit comments