Skip to content

Commit 3a79000

Browse files
s-perronllvm-beanz
andauthored
Print the VK error code (#237)
If the device fails to be created and the error is not recorginzied, the error message impossible to act on. If we output the error number, then the user can look it up, and see what needs to be done. --------- Co-authored-by: Chris B <[email protected]>
1 parent 894bcef commit 3a79000

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/API/VK/Device.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,8 @@ class VKContext {
836836
"Cannot find a compatible Vulkan device");
837837
if (Res)
838838
return llvm::createStringError(std::errc::no_such_device,
839-
"Unknown Vulkan initialization error");
839+
"Unknown Vulkan initialization error: %d",
840+
Res);
840841

841842
uint32_t DeviceCount = 0;
842843
if (vkEnumeratePhysicalDevices(Instance, &DeviceCount, nullptr))
@@ -867,7 +868,8 @@ class VKContext {
867868
"Cannot find a compatible Vulkan device");
868869
if (Res)
869870
return llvm::createStringError(std::errc::no_such_device,
870-
"Unknown Vulkan initialization error");
871+
"Unknown Vulkan initialization error %d",
872+
Res);
871873

872874
DeviceCount = 0;
873875
if (vkEnumeratePhysicalDevices(Instance, &DeviceCount, nullptr))

0 commit comments

Comments
 (0)