Skip to content

Commit e6ada08

Browse files
authored
Apple compatibility fixes for driver optionality (MoltenVK & KosmicKrisp) (#1435)
* Change VKB_ENABLE_PORTABILITY from CMake declaration to option (default ON) * Protect MoltenVK-specific code with VKB_ENABLE_PORTABILITY guards * Remove unneeded Apple-specific #ifdefs from descriptor_indexing sample * Update profiles sample to not assume MoltenVK portability driver on Apple * Fix [hpp_]hello_triangle samples to check for null objects on error termination * Improve CMake comments+messages for iOS config and build framework * Update copyright header date in vulkan_samples CMakeLists * Update profiles sample: portability subset, update-after-bind pool, clean-up on exit * Always check for Portability at runtime and update comments to not assume MoltenVK * Revert VKB_ENABLE_PORTABILITY check in global_options.cmake and add comments for driver optionality
1 parent 05f8a2f commit e6ada08

18 files changed

Lines changed: 138 additions & 146 deletions

File tree

app/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019-2024, Arm Limited and Contributors
1+
# Copyright (c) 2019-2025, Arm Limited and Contributors
22
#
33
# SPDX-License-Identifier: Apache-2.0
44
#
@@ -135,7 +135,7 @@ if(IOS)
135135
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY "YES"
136136
)
137137
endif ()
138-
# No need to search for Vulkan package or MoltenVK library, Vulkan cache variables already defined on Apple platforms by global_options.cmake
138+
# Vulkan cache variables already defined by main project CMakeLists and updated on Apple platforms by global_options.cmake
139139
if(Vulkan_LIBRARY AND ${Vulkan_VERSION} VERSION_GREATER_EQUAL 1.3.278)
140140
target_sources(${PROJECT_NAME} PRIVATE
141141
${Vulkan_Target_SDK}/iOS/share/vulkan
@@ -163,17 +163,24 @@ if(IOS)
163163
set(FRAMEWORKS_TO_EMBED)
164164
if(Vulkan_MoltenVK_LIBRARY)
165165
list(APPEND FRAMEWORKS_TO_EMBED "${Vulkan_MoltenVK_LIBRARY};")
166+
message(STATUS "Embedding Vulkan driver: ${Vulkan_MoltenVK_LIBRARY}")
167+
# add support for potentially other iOS Vulkan drivers here...
168+
#elseif(OTHER_IOS_VULKAN_DRIVER)
169+
#list(APPEND FRAMEWORKS_TO_EMBED "${OTHER_IOS_VULKAN_DRIVER};")
170+
#message(STATUS "Embedding Vulkan driver: ${OTHER_IOS_VULKAN_DRIVER}")
166171
else()
167-
message(FATAL_ERROR "Can't find MoltenVK library. Please install the Vulkan SDK or MoltenVK project and set VULKAN_SDK.")
172+
message(FATAL_ERROR "Can't find Vulkan driver for iOS. Please install the Vulkan SDK and run: 'source <MY_SDK_PATH>/iOS/setup-env.sh'")
168173
endif()
169174
if(Vulkan_LIBRARY)
170175
list(APPEND FRAMEWORKS_TO_EMBED "${Vulkan_LIBRARY};")
176+
message(STATUS "Embedding Vulkan loader: ${Vulkan_LIBRARY}")
171177
endif()
172178
if(Vulkan_Layer_VALIDATION)
173179
# trouble is can't turn this on/off if XCode decides to build debug and we're configured for release. Need to revist
174180
# note the Vulkan validation layer must be present and enabled even in release mode for the shader_debugprintf sample
175181
#if(("${VKB_DEBUG}" STREQUAL "ON") OR ("${VKB_VALIDATION_LAYERS}" STREQUAL "ON"))
176182
list(APPEND FRAMEWORKS_TO_EMBED "${Vulkan_Layer_VALIDATION}")
183+
message(STATUS "Embedding Vulkan Validation Layer: ${Vulkan_Layer_VALIDATION}")
177184
#endif()
178185
endif()
179186
set_target_properties(${PROJECT_NAME} PROPERTIES

bldsys/cmake/global_options.cmake

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ endif()
3333

3434
if(APPLE)
3535
cmake_minimum_required(VERSION 3.24)
36-
set(VKB_ENABLE_PORTABILITY ON CACHE BOOL "Enable portability enumeration and subset features in the framework. This is required to be set when running on Apple platforms." FORCE)
36+
option(VKB_ENABLE_PORTABILITY "Enable portability enumeration and subset features in the framework. This is default ON for Apple platforms." ON)
3737

38+
# the following assumes MoltenVK is used for these cases: a) standalone deployment on macOS (i.e. set USE_MoltenVK=ON), and b) for iOS deployment
39+
# if this assumption changes (e.g. KosmicKrisp adds standalone or iOS support), then this section will require modification to handle optionality
3840
find_package(Vulkan QUIET OPTIONAL_COMPONENTS MoltenVK)
3941
if(USE_MoltenVK OR (IOS AND (NOT Vulkan_MoltenVK_FOUND OR ${CMAKE_OSX_SYSROOT} STREQUAL "iphonesimulator")))
40-
# if using MoltenVK, or MoltenVK for iOS was not found, or using iOS Simulator, look for MoltenVK in the Vulkan SDK and MoltenVK project locations
42+
# if using MoltenVK standalone, or MoltenVK for iOS not found or using iOS Simulator, look for MoltenVK in Vulkan SDK and MoltenVK project paths
4143
if(NOT Vulkan_MoltenVK_LIBRARY)
4244
# since both are available in the Vulkan SDK and MoltenVK github project, make sure we look for MoltenVK framework on iOS and dylib on macOS
4345
set(_saved_cmake_find_framework ${CMAKE_FIND_FRAMEWORK})
@@ -58,7 +60,8 @@ if(APPLE)
5860
# on iOS we can control Vulkan library loading priority by selecting which libraries are embedded in the iOS application bundle
5961
if(IOS)
6062
add_compile_definitions(_HPP_VULKAN_LIBRARY="MoltenVK.framework/MoltenVK")
61-
# unset FindVulkan.cmake cache variables so Vulkan loader, Validation Layer, and icd/layer json files are not embedded on iOS
63+
# unset FindVulkan.cmake cache variables so Vulkan loader and Validation Layer libraries are not embedded on iOS Simulator
64+
# the iOS Simulator supports arm64 & x86_64 hosts, but the Vulkan loader and Validation Layer are compiled for arm64 only
6265
unset(Vulkan_LIBRARY CACHE)
6366
unset(Vulkan_Layer_VALIDATION CACHE)
6467

@@ -69,15 +72,18 @@ if(APPLE)
6972
add_compile_definitions(_GLFW_VULKAN_LIBRARY="libMoltenVK.dylib")
7073
set(ENV{DYLD_LIBRARY_PATH} "${MoltenVK_LIBRARY_PATH}:$ENV{DYLD_LIBRARY_PATH}")
7174
else()
72-
message(FATAL_ERROR "Vulkan library found in MoltenVK search path. Please set VULKAN_SDK to the MoltenVK project install location.")
75+
message(FATAL_ERROR "Vulkan loader found in MoltenVK search path. Please set VULKAN_SDK to the MoltenVK project install location.")
7376
endif()
74-
message(STATUS "Using MoltenVK: ${Vulkan_MoltenVK_LIBRARY}")
77+
message(STATUS "Using MoltenVK standalone: ${Vulkan_MoltenVK_LIBRARY}")
7578
else()
7679
message(FATAL_ERROR "Can't find MoltenVK library. Please install the Vulkan SDK or MoltenVK project and set VULKAN_SDK.")
7780
endif()
78-
elseif(IOS)
79-
# if not using MoltenVK on iOS, set up global Vulkan Library define for iOS Vulkan loader
80-
add_compile_definitions(_HPP_VULKAN_LIBRARY="vulkan.framework/vulkan")
81+
#elseif(OTHER_VULKAN_DRIVER)
82+
# handle any special processing here for other Vulkan driver (e.g. KosmicKrisp) for standalone usage on macOS or deployment to iOS
83+
# would likely require extensions to CMake find_package() OPTIONAL_COMPONENTS and library variables to identify & use other driver
84+
#else()
85+
# if not using standalone driver, retain find_package() results for Vulkan driver, Vulkan loader, and Validation Layer library variables
86+
# no need to override with _HPP_VULKAN_LIBRARY in this case since Vulkan DynamicLoader will find/load Vulkan library on macOS & iOS
8187
endif()
8288

8389
if(CMAKE_GENERATOR MATCHES "Xcode")
@@ -103,6 +109,8 @@ if(APPLE)
103109
set(CMAKE_SUPPRESS_REGENERATION ON)
104110
endif()
105111
endif()
112+
else()
113+
option(VKB_ENABLE_PORTABILITY "Enable portability enumeration and subset features in the framework. This is default OFF for non-Apple platforms." OFF)
106114
endif()
107115

108116
set(VKB_WARNINGS_AS_ERRORS ON CACHE BOOL "Enable Warnings as Errors")

framework/core/instance.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,19 @@ inline bool enable_layer_setting(vk::LayerSettingEXT const &requested_lay
251251
// Vulkan does not provide a reflection API for layer settings. Layer settings are described in each layer JSON manifest.
252252
bool is_available = std::ranges::any_of(
253253
enabled_layers, [&requested_layer_setting](auto const &available_layer) { return strcmp(available_layer, requested_layer_setting.pLayerName) == 0; });
254+
254255
#if defined(PLATFORM__MACOS)
255-
// On Apple platforms the MoltenVK layer is implicitly enabled and available, and cannot be explicitly added or checked via enabled_layers.
256-
is_available = is_available || strcmp(requested_layer_setting.pLayerName, "MoltenVK") == 0;
256+
// On Apple the MoltenVK driver configuration layer is implicitly enabled and available, and cannot be explicitly added or checked via enabled_layers.
257+
if (!is_available && strcmp(requested_layer_setting.pLayerName, "MoltenVK") == 0)
258+
{
259+
// Check for VK_EXT_layer_settings extension in the driver which indicates MoltenVK vs. KosmicKrisp (note: VK_MVK_moltenvk extension is deprecated).
260+
std::vector<vk::ExtensionProperties> available_instance_extensions = vk::enumerateInstanceExtensionProperties();
261+
if (std::ranges::any_of(available_instance_extensions,
262+
[](vk::ExtensionProperties const &extension) { return strcmp(extension.extensionName, VK_EXT_LAYER_SETTINGS_EXTENSION_NAME) == 0; }))
263+
{
264+
is_available = true;
265+
}
266+
}
257267
#endif
258268

259269
if (!is_available)

framework/vulkan_sample.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ inline bool VulkanSample<bindingType>::prepare(const ApplicationOptions &options
11171117
}
11181118

11191119
#ifdef VKB_ENABLE_PORTABILITY
1120-
// VK_KHR_portability_subset must be enabled if present in the implementation (e.g on macOS/iOS with beta extensions enabled)
1120+
// VK_KHR_portability_subset must be enabled if present in the implementation (e.g on macOS/iOS using MoltenVK with beta extensions enabled)
11211121
add_device_extension(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME, /*optional=*/true);
11221122
#endif
11231123

samples/api/hello_triangle/hello_triangle.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ void HelloTriangle::init_device()
301301
}
302302

303303
#if (defined(VKB_ENABLE_PORTABILITY))
304-
// VK_KHR_portability_subset must be enabled if present in the implementation (e.g on macOS/iOS with beta extensions enabled)
304+
// VK_KHR_portability_subset must be enabled if present in the implementation (e.g on macOS/iOS using MoltenVK with beta extensions enabled)
305305
if (std::ranges::any_of(device_extensions,
306306
[](VkExtensionProperties const &extension) { return strcmp(extension.extensionName, VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME) == 0; }))
307307
{
@@ -1005,7 +1005,10 @@ HelloTriangle::~HelloTriangle()
10051005
{
10061006
// When destroying the application, we need to make sure the GPU is no longer accessing any resources
10071007
// This is done by doing a device wait idle, which blocks until the GPU signals
1008-
vkDeviceWaitIdle(context.device);
1008+
if (context.device != VK_NULL_HANDLE)
1009+
{
1010+
vkDeviceWaitIdle(context.device);
1011+
}
10091012

10101013
for (auto &framebuffer : context.swapchain_framebuffers)
10111014
{

samples/api/hello_triangle_1_3/hello_triangle_1_3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void HelloTriangleV13::init_device()
309309
}
310310

311311
#if (defined(VKB_ENABLE_PORTABILITY))
312-
// VK_KHR_portability_subset must be enabled if present in the implementation (e.g on macOS/iOS with beta extensions enabled)
312+
// VK_KHR_portability_subset must be enabled if present in the implementation (e.g on macOS/iOS using MoltenVK with beta extensions enabled)
313313
if (std::ranges::any_of(device_extensions,
314314
[](VkExtensionProperties const &extension) { return strcmp(extension.extensionName, VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME) == 0; }))
315315
{

samples/api/hpp_hello_triangle/hpp_hello_triangle.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ HPPHelloTriangle::HPPHelloTriangle()
7676
HPPHelloTriangle::~HPPHelloTriangle()
7777
{
7878
// Don't release anything until the GPU is completely idle.
79-
device.waitIdle();
79+
if (device)
80+
{
81+
device.waitIdle();
82+
}
8083

8184
teardown_framebuffers();
8285

@@ -142,7 +145,10 @@ HPPHelloTriangle::~HPPHelloTriangle()
142145
instance.destroyDebugUtilsMessengerEXT(debug_utils_messenger);
143146
}
144147

145-
instance.destroy();
148+
if (instance)
149+
{
150+
instance.destroy();
151+
}
146152
}
147153

148154
bool HPPHelloTriangle::prepare(const vkb::ApplicationOptions &options)
@@ -325,7 +331,7 @@ vk::Device HPPHelloTriangle::create_device(const std::vector<const char *> &requ
325331
std::vector<const char *> active_device_extensions(required_device_extensions);
326332

327333
#if (defined(VKB_ENABLE_PORTABILITY))
328-
// VK_KHR_portability_subset must be enabled if present in the implementation (e.g on macOS/iOS with beta extensions enabled)
334+
// VK_KHR_portability_subset must be enabled if present in the implementation (e.g on macOS/iOS using MoltenVK with beta extensions enabled)
329335
if (std::ranges::any_of(device_extensions,
330336
[](vk::ExtensionProperties const &extension) { return strcmp(extension.extensionName, VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME) == 0; }))
331337
{
@@ -915,7 +921,10 @@ void HPPHelloTriangle::select_physical_device_and_surface()
915921
void HPPHelloTriangle::teardown_framebuffers()
916922
{
917923
// Wait until device is idle before teardown.
918-
queue.waitIdle();
924+
if (queue)
925+
{
926+
queue.waitIdle();
927+
}
919928

920929
for (auto &framebuffer : swapchain_data.framebuffers)
921930
{

samples/api/hpp_hello_triangle_1_3/hpp_hello_triangle_1_3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ void HPPHelloTriangleV13::init_device()
386386
}
387387

388388
#if (defined(VKB_ENABLE_PORTABILITY))
389-
// VK_KHR_portability_subset must be enabled if present in the implementation (e.g on macOS/iOS with beta extensions enabled)
389+
// VK_KHR_portability_subset must be enabled if present in the implementation (e.g on macOS/iOS using MoltenVK with beta extensions enabled)
390390
if (std::ranges::any_of(device_extensions,
391391
[](vk::ExtensionProperties const &extension) { return strcmp(extension.extensionName, VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME) == 0; }))
392392
{

samples/extensions/descriptor_indexing/descriptor_indexing.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,6 @@ DescriptorIndexing::DescriptorIndexing()
3131
// Works around a validation layer bug with descriptor pool allocation with VARIABLE_COUNT.
3232
// See: https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/2350.
3333
add_device_extension(VK_KHR_MAINTENANCE1_EXTENSION_NAME);
34-
35-
#if defined(PLATFORM__MACOS)
36-
// On Apple use layer setting to enable MoltenVK's Metal argument buffers - needed for descriptor indexing/scaling
37-
add_instance_extension(VK_EXT_LAYER_SETTINGS_EXTENSION_NAME, /*optional*/ true);
38-
39-
VkLayerSettingEXT layerSetting;
40-
layerSetting.pLayerName = "MoltenVK";
41-
layerSetting.pSettingName = "MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS";
42-
layerSetting.type = VK_LAYER_SETTING_TYPE_INT32_EXT;
43-
layerSetting.valueCount = 1;
44-
45-
// Make this static so layer setting reference remains valid after leaving constructor scope
46-
static const int32_t useMetalArgumentBuffers = 1;
47-
layerSetting.pValues = &useMetalArgumentBuffers;
48-
49-
add_layer_setting(layerSetting);
50-
#endif
5134
}
5235

5336
DescriptorIndexing::~DescriptorIndexing()
@@ -212,14 +195,6 @@ void DescriptorIndexing::create_bindless_descriptors()
212195
{
213196
uint32_t descriptorCount = descriptor_indexing_properties.maxDescriptorSetUpdateAfterBindSampledImages;
214197

215-
#if defined(PLATFORM__MACOS)
216-
// On Apple Vulkan API <= 1.2.283 variable descriptor counts don't work, use max expected count instead. Fixed in later versions.
217-
if (get_device().get_gpu().get_properties().apiVersion <= VK_MAKE_API_VERSION(0, 1, 2, 283))
218-
{
219-
descriptorCount = std::max(NumDescriptorsStreaming, NumDescriptorsNonUniform);
220-
}
221-
#endif
222-
223198
VkDescriptorSetLayoutBinding binding = vkb::initializers::descriptor_set_layout_binding(VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_SHADER_STAGE_FRAGMENT_BIT, 0, descriptorCount);
224199
VkDescriptorSetLayoutCreateInfo set_layout_create_info = vkb::initializers::descriptor_set_layout_create_info(&binding, 1);
225200

@@ -262,14 +237,6 @@ void DescriptorIndexing::create_bindless_descriptors()
262237
// For the non-uniform indexing part, we allocate few descriptors, and for the streaming case, we allocate a fairly large ring buffer of descriptors we can play around with.
263238
uint32_t poolCount = NumDescriptorsStreaming + NumDescriptorsNonUniform;
264239

265-
#if defined(PLATFORM__MACOS)
266-
// On Apple Vulkan API <= 1.2.283 variable descriptor counts don't work, use pool size of max expected count x 2 (for 2 allocations). Fixed in later versions.
267-
if (get_device().get_gpu().get_properties().apiVersion <= VK_MAKE_API_VERSION(0, 1, 2, 283))
268-
{
269-
poolCount = std::max(NumDescriptorsStreaming, NumDescriptorsNonUniform) * 2;
270-
}
271-
#endif
272-
273240
VkDescriptorPoolSize pool_size = vkb::initializers::descriptor_pool_size(VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, poolCount);
274241
VkDescriptorPoolCreateInfo pool = vkb::initializers::descriptor_pool_create_info(1, &pool_size, 2);
275242

samples/extensions/portability/portability.cpp

Lines changed: 47 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ Portability::Portability() :
3333
filter_pass()
3434
{
3535
title = "Portability";
36-
// Portability is a Vulkan 1.3 extension
37-
set_api_version(VK_API_VERSION_1_3);
38-
add_instance_extension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
39-
add_instance_extension(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME, /*optional*/ true);
36+
// These instance extensions are conditionally added by the sample framework when VKB_ENABLE_PORTABILITY is enabled
37+
// add_instance_extension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
38+
// add_instance_extension(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME, /*optional=*/true);
39+
40+
// VK_KHR_portability_subset depends on VK_KHR_get_physical_device_properties2 or Vulkan 1.1 (default for project)
41+
// This device extension is conditionally added by the sample framework when VKB_ENABLE_PORTABILITY is enabled
4042
}
4143

4244
Portability::~Portability()
@@ -868,41 +870,48 @@ void Portability::render(float delta_time)
868870
void Portability::on_update_ui_overlay(vkb::Drawer &drawer)
869871
{
870872
#ifdef VKB_ENABLE_PORTABILITY
871-
std::string portability_support_list;
872-
if (portability_features.constantAlphaColorBlendFactors)
873-
portability_support_list += "constantAlphaColorBlendFactors\n";
874-
if (portability_features.events)
875-
portability_support_list += "events\n";
876-
if (portability_features.imageView2DOn3DImage)
877-
portability_support_list += "imageView2DOn3dImage\n";
878-
if (portability_features.imageViewFormatReinterpretation)
879-
portability_support_list += "imageViewFormatReinterpretation\n";
880-
if (portability_features.imageViewFormatSwizzle)
881-
portability_support_list += "imageViewFormatSwizzle\n";
882-
if (portability_features.multisampleArrayImage)
883-
portability_support_list += "multisampleArrayImage\n";
884-
if (portability_features.mutableComparisonSamplers)
885-
portability_support_list += "mutableComparisonSamplers\n";
886-
if (portability_features.pointPolygons)
887-
portability_support_list += "pointPolygons\n";
888-
if (portability_features.samplerMipLodBias)
889-
portability_support_list += "samplerMipLodBias\n";
890-
if (portability_features.separateStencilMaskRef)
891-
portability_support_list += "separateStencilMaskRef\n";
892-
if (portability_features.shaderSampleRateInterpolationFunctions)
893-
portability_support_list += "shaderSampleRateInterpolationFunctions\n";
894-
if (portability_features.tessellationIsolines)
895-
portability_support_list += "tessellationIsolines\n";
896-
if (portability_features.tessellationPointMode)
897-
portability_support_list += "tessellationPointMode\n";
898-
if (portability_features.triangleFans)
899-
portability_support_list += "triangleFans\n";
900-
if (portability_features.vertexAttributeAccessBeyondStride)
901-
portability_support_list += "vertexAttributeAccessBeyondStride\n";
902-
drawer.text("Device Portability feature support list:\n%s", portability_support_list.c_str());
903-
#else
904-
drawer.text("VKB_ENABLE_PORTABILITY not enabled can't list portability feature set");
873+
// VK_KHR_portability_subset extension must be available in the implementation to list device portability feature set
874+
if (get_device().get_gpu().is_extension_supported(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME))
875+
{
876+
std::string portability_support_list;
877+
if (portability_features.constantAlphaColorBlendFactors)
878+
portability_support_list += "constantAlphaColorBlendFactors\n";
879+
if (portability_features.events)
880+
portability_support_list += "events\n";
881+
if (portability_features.imageView2DOn3DImage)
882+
portability_support_list += "imageView2DOn3dImage\n";
883+
if (portability_features.imageViewFormatReinterpretation)
884+
portability_support_list += "imageViewFormatReinterpretation\n";
885+
if (portability_features.imageViewFormatSwizzle)
886+
portability_support_list += "imageViewFormatSwizzle\n";
887+
if (portability_features.multisampleArrayImage)
888+
portability_support_list += "multisampleArrayImage\n";
889+
if (portability_features.mutableComparisonSamplers)
890+
portability_support_list += "mutableComparisonSamplers\n";
891+
if (portability_features.pointPolygons)
892+
portability_support_list += "pointPolygons\n";
893+
if (portability_features.samplerMipLodBias)
894+
portability_support_list += "samplerMipLodBias\n";
895+
if (portability_features.separateStencilMaskRef)
896+
portability_support_list += "separateStencilMaskRef\n";
897+
if (portability_features.shaderSampleRateInterpolationFunctions)
898+
portability_support_list += "shaderSampleRateInterpolationFunctions\n";
899+
if (portability_features.tessellationIsolines)
900+
portability_support_list += "tessellationIsolines\n";
901+
if (portability_features.tessellationPointMode)
902+
portability_support_list += "tessellationPointMode\n";
903+
if (portability_features.triangleFans)
904+
portability_support_list += "triangleFans\n";
905+
if (portability_features.vertexAttributeAccessBeyondStride)
906+
portability_support_list += "vertexAttributeAccessBeyondStride\n";
907+
drawer.text("Device Portability feature support list:\n%s", portability_support_list.c_str());
908+
}
909+
else
905910
#endif
911+
{
912+
drawer.text("VK_KHR_portability_subset not available can't list portability feature set");
913+
}
914+
906915
if (drawer.header("Settings"))
907916
{
908917
if (drawer.checkbox("Bloom", &bloom))

0 commit comments

Comments
 (0)