Skip to content

Commit d14be3b

Browse files
authored
Fix a few compiler warnings and startup/validation issues at runtime (SaschaWillems#1193)
* Add error recovery to trianglevulkan13 and fix missing "override" compiler warnings * Look for vkGetPhysicalDeviceFormatProperties2KHR in hostimagecopy example * Enable fragmentStoresAndAtomics feature to avoid VVL warning in subpasses example
1 parent 02ed0ee commit d14be3b

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

examples/hostimagecopy/hostimagecopy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ class VulkanExample : public VulkanExampleBase
419419
// Get the function pointers required host image copies
420420
vkCopyMemoryToImageEXT = reinterpret_cast<PFN_vkCopyMemoryToImageEXT>(vkGetDeviceProcAddr(device, "vkCopyMemoryToImageEXT"));
421421
vkTransitionImageLayoutEXT = reinterpret_cast<PFN_vkTransitionImageLayoutEXT>(vkGetDeviceProcAddr(device, "vkTransitionImageLayoutEXT"));
422-
vkGetPhysicalDeviceFormatProperties2 = reinterpret_cast<PFN_vkGetPhysicalDeviceFormatProperties2>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFormatProperties2"));
422+
vkGetPhysicalDeviceFormatProperties2 = reinterpret_cast<PFN_vkGetPhysicalDeviceFormatProperties2>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFormatProperties2KHR"));
423423

424424
loadAssets();
425425
loadTexture();

examples/subpasses/subpasses.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ class VulkanExample : public VulkanExampleBase
9999
camera.setRotation(glm::vec3(0.5f, 210.05f, 0.0f));
100100
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
101101
ui.subpass = 2;
102+
103+
enabledFeatures.fragmentStoresAndAtomics = VK_TRUE;
102104
}
103105

104106
~VulkanExample()

examples/trianglevulkan13/trianglevulkan13.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ class VulkanExample : public VulkanExampleBase
140140
}
141141
}
142142

143+
virtual void getEnabledFeatures() override
144+
{
145+
// Vulkan 1.3 device support is required for this example
146+
if (deviceProperties.apiVersion < VK_API_VERSION_1_3) {
147+
vks::tools::exitFatal("Selected GPU does not support support Vulkan 1.3", VK_ERROR_INCOMPATIBLE_DRIVER);
148+
}
149+
}
150+
143151
// This function is used to request a device memory type that supports all the property flags we request (e.g. device local, host visible)
144152
// Upon success it will return the index of the memory type that fits our requested memory properties
145153
// This is necessary as implementations can offer an arbitrary number of memory types with different memory properties

0 commit comments

Comments
 (0)