Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ jobs:
- name: retrieve VulkanSDK
if: steps.VulkanSDK.outputs.cache-hit != 'true'
run: |
wget https://sdk.lunarg.com/sdk/download/1.4.304.1/mac/vulkansdk-macos-1.4.304.1.zip
unzip vulkansdk-macos-1.4.304.1.zip
sudo InstallVulkan-1.4.304.1.app/Contents/MacOS/InstallVulkan-1.4.304.1 --root ~/VulkanSDK --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.ios
wget https://sdk.lunarg.com/sdk/download/1.4.341.1/mac/vulkansdk-macos-1.4.341.1.zip
unzip vulkansdk-macos-1.4.341.1.zip
sudo vulkansdk-macOS-1.4.341.1.app/Contents/MacOS/vulkansdk-macOS-1.4.341.1 --root ~/VulkanSDK --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.ios

- name: build_ios
run: |
source ~/VulkanSDK/iOS/setup-env.sh
cmake -H"." -B"build/ios" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_DEPLOYMENT_TARGET=16.3 -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO
cmake -G Xcode -B"build/ios" --toolchain bldsys/toolchain/ios.cmake -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO
cmake --build "build/ios" --target vulkan_samples --config ${{ matrix.build_type }} -- -allowProvisioningUpdates
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2020-2025, Arm Limited and Contributors
# Copyright (c) 2024-2025, Mobica Limited
# Copyright (c) 2024-2025, Sascha Willems
# Copyright (c) 2020-2026, Arm Limited and Contributors
# Copyright (c) 2024-2026, Mobica Limited
# Copyright (c) 2024-2026, Sascha Willems
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down Expand Up @@ -43,7 +43,9 @@ else ()
# search for Vulkan SDK
find_package(Vulkan)

if(Vulkan_FOUND)
# Apple platforms always define Vulkan_SDK, so don't look for shader compilers otherwise we will build
# the shaders for every new config - instead use pre-built shaders which improves project build times.
if(Vulkan_FOUND AND NOT APPLE)
if(NOT Vulkan_dxc_exe_FOUND)
find_program(Vulkan_dxc_EXECUTABLE
NAMES dxc
Expand Down
3 changes: 2 additions & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2025, Arm Limited and Contributors
# Copyright (c) 2019-2026, Arm Limited and Contributors
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down Expand Up @@ -137,6 +137,7 @@ if(IOS)
endif ()
# Vulkan cache variables already defined by main project CMakeLists and updated on Apple platforms by global_options.cmake
if(Vulkan_LIBRARY AND ${Vulkan_VERSION} VERSION_GREATER_EQUAL 1.3.278)
get_filename_component(Vulkan_Target_SDK "$ENV{VULKAN_SDK}/.." REALPATH)
target_sources(${PROJECT_NAME} PRIVATE
${Vulkan_Target_SDK}/iOS/share/vulkan
)
Expand Down
10 changes: 5 additions & 5 deletions bldsys/cmake/global_options.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[[
Copyright (c) 2019-2025, Arm Limited and Contributors
Copyright (c) 2019-2026, Arm Limited and Contributors

SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -78,10 +78,10 @@ if(APPLE)
else()
message(FATAL_ERROR "Can't find MoltenVK library. Please install the Vulkan SDK or MoltenVK project and set VULKAN_SDK.")
endif()
#elseif(OTHER_VULKAN_DRIVER)
# handle any special processing here for other Vulkan driver (e.g. KosmicKrisp) for standalone usage on macOS or deployment to iOS
# would likely require extensions to CMake find_package() OPTIONAL_COMPONENTS and library variables to identify & use other driver
#else()
elseif(IOS AND NOT Vulkan_Layer_VALIDATION)
# if building for iOS devices (not iOS Simulator as above) and Vulkan_Layer_VALIDATION is not defined or found, search in the Vulkan SDK
find_library(Vulkan_Layer_VALIDATION NAMES VkLayer_khronos_validation HINTS "$ENV{VULKAN_SDK}/lib")
else()
# if not using standalone driver, retain find_package() results for Vulkan driver, Vulkan loader, and Validation Layer library variables
# no need to override with _HPP_VULKAN_LIBRARY in this case since Vulkan DynamicLoader will find/load Vulkan library on macOS & iOS
endif()
Expand Down
44 changes: 44 additions & 0 deletions bldsys/toolchain/ios.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#[[

Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
Copy link
Copy Markdown

@fgiancane8 fgiancane8 Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. Not a contribution.

@SRSaunders can you please accept this change? Legal team reviewed this and requested the copyright to be stated like this, according to Apache-2.0 license.

Otherwise, LGTM.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but if it's not a contribution, then what is it? I am not sure I understand the intent of this change from your legal folks. Can you clarify what this means?

Copy link
Copy Markdown

@fgiancane8 fgiancane8 Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Apache 2 license:

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

Last line in the license explains the "Not a Contribution" usage in copyrights. I relayed your question to the Legal team to provide more clarity here.

Copy link
Copy Markdown
Contributor Author

@SRSaunders SRSaunders Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I am not a maintainer on this project so I cannot say whether this can be accepted or not. You will have to ask @gpx1000 about that.

However, based on the above text, "Contribution" and "submitted" are exactly what we are doing here, which is described by "communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work".

The next clause "but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." means that we should NOT include in the license any further improvements discussed by you if you mark a new communication as such. Note the exact wording here: the license talks about marking "communication as Not a Contribution", not the licensed work itself. That means in future discussion that you could mark a new idea as Not a Contribution and it would not be incorporated in the code and not included in the original license. That would be more reasonable.

However, these kinds of communication clauses are typically put in licensing agreements when the IP licensing is 1-way only, with no follow-on discussion desired by the licensee. That approach is not very typical of open source where ongoing contribution and discussion is typically welcomed and encouraged.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SRSaunders thanks for all the clarifications. As you can imagine, I am not a legal person myself so I am following what folks from legal team told me to do. Please bear with me some more time to see if I can get some more information and/or inputs on how we can better address this.

@gpx1000 since you're maintainer here, any history/inputs/etc would be very much appreciated.

Thanks all folks, hopefully we'll get it sorted out quickly.

Copy link
Copy Markdown
Contributor Author

@SRSaunders SRSaunders Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this. At the simplest level, you can't make a contribution and then call it "Not a contribution". However, new stuff can be discussed but not contributed as long as you mark it that way.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marty-johnson59 Could you take a look? I think we're fine but I'm not a lawyer, and have no wish to have an opinion.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll bring this up with Khronos legal, but my read is that this was a "contribution", so not sure we're OK with marking it as "not a contribution"... @fgiancane8, can you help clarify how/why this should not be considered a contribution? That might help our legal team sort this out. Thanks

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marty-johnson59 hello Marty,
thanks for the feedback. I have just followed the directions from the legal team who is in changer of reviewing patches internally. I will ask to review again if upstream is not OK with changes not being a contributions. We have different policies with respect to licenses so I am following the rules here. Will ping you back once I have more answers. thanks for the patience :)

Copyright (c) 2026, Stephen Saunders

SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 the "License";
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

------------------------------------------------------------------------

Co-Authored-By: (Qualcomm) Giancane, Francesco <fgiancan@qti.qualcomm.com>
Co-Authored-By: Stephen Saunders

]]

# As per upstream CMake recommendation in https://gitlab.kitware.com/cmake/cmake/-/issues/27661
# for iOS we can use a toolchain file to set up search paths and simplify the command line
#
# iOS/setup-env.sh will first take care of defining the VULKAN_SDK environment variable
# Toolchain file shall define:
# - Target system name to iOS
# - Minimum deployment target to iOS 16.3
# - Build only the active arch for devices and simulator
# - Export the $ENV{VULKAN_SDK} variable to `CMAKE_FIND_ROOT_PATH`
#
# Note: We define CMAKE_FIND_ROOT_PATH to locate the iOS Vulkan frameworks from the SDK.
# We don't define CMAKE_OSX_SYSROOT here since we need to build for both physical devices
# (iphoneos) and simulator (iphonesimulator) - do that instead on the cmake command line.

set(CMAKE_SYSTEM_NAME iOS)
set(CMAKE_OSX_DEPLOYMENT_TARGET 16.3)
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH YES)
set(CMAKE_FIND_ROOT_PATH "$ENV{VULKAN_SDK}")
8 changes: 4 additions & 4 deletions docs/build.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
////
- Copyright (c) 2019-2025, Arm Limited and Contributors
- Copyright (c) 2019-2026, Arm Limited and Contributors
-
- SPDX-License-Identifier: Apache-2.0
-
Expand Down Expand Up @@ -327,14 +327,14 @@ source /PATH/TO/VULKAN/SDK/iOS/setup-env.sh
`Step 1.` The following command will generate the project

----
cmake -G Xcode -Bbuild/ios -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_DEPLOYMENT_TARGET=16.3 -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=YES -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_IOS_INSTALL_COMBINED=NO -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM="XXXX" -DMACOSX_BUNDLE_GUI_IDENTIFIER="com.YYYY.vulkansamples"
cmake -G Xcode -Bbuild/ios --toolchain bldsys/toolchain/ios.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM="XXXX" -DMACOSX_BUNDLE_GUI_IDENTIFIER="com.YYYY.vulkansamples"
----
NB: You MUST change the XXXX in the above to your TeamID (or Organizational Unit identifier in your Apple Development certificate) for code signing, and YYYY to your bundle identifier. iOS will NOT allow the application to run without code signing and bundle identifier setup.

Alternatively, you can build for the iOS Simulator (requires Vulkan SDK 1.4.321.0 or later) without code signing or specifying a bundle identifier (a default bundle id will be used). However, depending on your host architecture, you MUST select either arm64 (Apple Silicon) or x86_64 in the command below. _Note: On arm64 (Apple Silicon) hosts the Vulkan library may not load on iOS Simulator without specifying your TeamID and bundle identifier as shown above._
Alternatively, you can build for the iOS Simulator (requires Vulkan SDK 1.4.321.0 or later) without code signing or specifying a bundle identifier (a default bundle id will be used). However, depending on your host architecture, you MUST select either arm64 (Apple Silicon) OR x86_64 in the command below. _Note: On arm64 hosts (Apple Silicon) the Vulkan library may not load on iOS Simulator without specifying your TeamID and bundle identifier as shown above._

----
cmake -G Xcode -Bbuild/ios-sim -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=16.3 -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=YES -DCMAKE_OSX_ARCHITECTURES=<arm64|x86_64> -DCMAKE_IOS_INSTALL_COMBINED=NO
cmake -G Xcode -Bbuild/ios-sim --toolchain bldsys/toolchain/ios.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=<arm64|x86_64>
----

`Step 2.` Build the project
Expand Down
3 changes: 2 additions & 1 deletion framework/vulkan_sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,8 @@ template <vkb::BindingType bindingType>
inline void VulkanSample<bindingType>::request_layers(std::unordered_map<std::string, vkb::RequestMode> &requested_layers) const
{
#if defined(VKB_DEBUG) || defined(VKB_VALIDATION_LAYERS)
requested_layers["VK_LAYER_KHRONOS_validation"] = vkb::RequestMode::Required;
// VK_LAYER_KHRONOS_validation must be optional in case layer not available for debug builds (e.g. running on Windows with no SDK installed or on iOS Simulator)
requested_layers["VK_LAYER_KHRONOS_validation"] = vkb::RequestMode::Optional;
#endif
}

Expand Down
13 changes: 8 additions & 5 deletions samples/api/texture_loading/texture_loading.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2025, Sascha Willems
/* Copyright (c) 2019-2026, Sascha Willems
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -408,10 +408,13 @@ void TextureLoading::load_texture()
// Free all Vulkan resources used by a texture object
void TextureLoading::destroy_texture(Texture texture)
{
vkDestroyImageView(get_device().get_handle(), texture.view, nullptr);
vkDestroyImage(get_device().get_handle(), texture.image, nullptr);
vkDestroySampler(get_device().get_handle(), texture.sampler, nullptr);
vkFreeMemory(get_device().get_handle(), texture.device_memory, nullptr);
if (has_device())
{
vkDestroyImageView(get_device().get_handle(), texture.view, nullptr);
vkDestroyImage(get_device().get_handle(), texture.image, nullptr);
vkDestroySampler(get_device().get_handle(), texture.sampler, nullptr);
vkFreeMemory(get_device().get_handle(), texture.device_memory, nullptr);
}
}

void TextureLoading::build_command_buffers()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019-2025, Sascha Willems
/* Copyright (c) 2019-2026, Sascha Willems
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -285,9 +285,12 @@ void TextureMipMapGeneration::load_texture_generate_mipmaps(std::string file_nam
// Free all Vulkan resources used by a texture object
void TextureMipMapGeneration::destroy_texture(Texture texture)
{
vkDestroyImageView(get_device().get_handle(), texture.view, nullptr);
vkDestroyImage(get_device().get_handle(), texture.image, nullptr);
vkFreeMemory(get_device().get_handle(), texture.device_memory, nullptr);
if (has_device())
{
vkDestroyImageView(get_device().get_handle(), texture.view, nullptr);
vkDestroyImage(get_device().get_handle(), texture.image, nullptr);
vkFreeMemory(get_device().get_handle(), texture.device_memory, nullptr);
}
}

void TextureMipMapGeneration::load_assets()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ HPPPipelineCache::~HPPPipelineCache()
get_device().get_handle().destroyPipelineCache(pipeline_cache);
}

vkb::fs::write_temp(get_device().get_resource_cache().serialize(), "hpp_cache.data");
if (has_device())
{
vkb::fs::write_temp(get_device().get_resource_cache().serialize(), "hpp_cache.data");
}
}

bool HPPPipelineCache::prepare(const vkb::ApplicationOptions &options)
Expand Down
5 changes: 4 additions & 1 deletion samples/performance/pipeline_cache/pipeline_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ PipelineCache::~PipelineCache()
vkDestroyPipelineCache(get_device().get_handle(), pipeline_cache, nullptr);
}

vkb::fs::write_temp(get_device().get_resource_cache().serialize(), "cache.data");
if (has_device())
{
vkb::fs::write_temp(get_device().get_resource_cache().serialize(), "cache.data");
}
}

bool PipelineCache::prepare(const vkb::ApplicationOptions &options)
Expand Down
Loading