Skip to content

Commit

Permalink
Merge pull request #290 from Bam4d/bug/macos_portability_ext
Browse files Browse the repository at this point in the history
updating volk and adding portability extension for apple devices
  • Loading branch information
Bam4d committed Aug 22, 2023
2 parents cdc5254 + 1dc8389 commit 2ea37c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deps/conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ glm/0.9.9.8
yaml-cpp/0.6.3
spdlog/1.9.2
stb/20200203
volk/1.3.224.1
volk/1.3.243.0
boost/1.82.0


Expand Down
12 changes: 7 additions & 5 deletions src/Griddly/Core/Observers/Vulkan/VulkanInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@ VulkanInstance::VulkanInstance(VulkanConfiguration& config) {
auto instanceCreateInfo = initializers::instanceCreateInfo(applicationInfo, layers_, extensions_);

#ifndef NDEBUG

const char* enabledLayerNames[] = {
"VK_LAYER_KHRONOS_validation",
};
int layerCount = 1;

const char* enabledExtensionNames[] = {
VK_EXT_DEBUG_REPORT_EXTENSION_NAME,
VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME};
int extensionCount = 2;
VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME,
VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME};
int extensionCount = 3;
#else
const char* enabledLayerNames[] = {""};
int layerCount = 0;

const char* enabledExtensionNames[] = {
VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME};
int extensionCount = 1;
VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME,
VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME};
int extensionCount = 2;

#endif
// Check if layers are available
Expand Down Expand Up @@ -85,6 +86,7 @@ VulkanInstance::VulkanInstance(VulkanConfiguration& config) {

instanceCreateInfo.ppEnabledExtensionNames = enabledExtensionNames;
instanceCreateInfo.enabledExtensionCount = extensionCount;
instanceCreateInfo.flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
} else {
spdlog::error("Missing vulkan extensions in driver. Please upgrade your vulkan drivers.");
}
Expand Down

0 comments on commit 2ea37c2

Please sign in to comment.