Skip to content

Minor cleanup on swapchain creation#117

Merged
gpx1000 merged 2 commits intoKhronosGroup:mainfrom
asuessenbach:06_swap_chain_creation
Aug 21, 2025
Merged

Minor cleanup on swapchain creation#117
gpx1000 merged 2 commits intoKhronosGroup:mainfrom
asuessenbach:06_swap_chain_creation

Conversation

@asuessenbach
Copy link
Copy Markdown
Contributor

Essentially, introduced a little helper function to determine the minImageCount for the swapchain, and added some assertions.

As usual, if you think, this looks good, I can carry it over to the other chapters.

And still I'm not able to build or run this program, see #93.

@asuessenbach asuessenbach force-pushed the 06_swap_chain_creation branch 4 times, most recently from cf1b755 to ec63815 Compare July 31, 2025 13:53
@asuessenbach asuessenbach requested a review from gpx1000 July 31, 2025 14:08
@asuessenbach
Copy link
Copy Markdown
Contributor Author

Any opinion on this PR?

@gpx1000
Copy link
Copy Markdown
Contributor

gpx1000 commented Aug 18, 2025

Sorry, yep this looks good to me.

@asuessenbach asuessenbach force-pushed the 06_swap_chain_creation branch 9 times, most recently from ddeb266 to 5e36441 Compare August 18, 2025 16:05
@asuessenbach
Copy link
Copy Markdown
Contributor Author

This PR takes a number of iterations, as I still can't build on my own!

I still have the problem, that
>cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=C:\git\vcpkg\scripts\buildsystems\vcpkg.cmake
gives me

CMake Error at C:/Program Files/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find KTX (missing: KTX_INCLUDE_DIR KTX_LIBRARY)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  CMake/FindKTX.cmake:55 (find_package_handle_standard_args)
  C:/git/vcpkg/scripts/buildsystems/vcpkg.cmake:896 (_find_package)
  CMakeLists.txt:15 (find_package)

Any idea on how to resolve that is very much appreciated!

@asuessenbach asuessenbach force-pushed the 06_swap_chain_creation branch 8 times, most recently from 55f6017 to 558169e Compare August 19, 2025 08:51
@asuessenbach asuessenbach force-pushed the 06_swap_chain_creation branch from 558169e to 9e43862 Compare August 19, 2025 09:12
@SaschaWillems
Copy link
Copy Markdown
Collaborator

CMake setup seems to be flaky on Windows. Maybe you can manually specify KTX_INCLUDE_DIR and KTX_LIBRARY either at command line or via CMake GUI:

image

Copy link
Copy Markdown
Collaborator

@SaschaWillems SaschaWillems left a comment

Choose a reason for hiding this comment

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

Changes LGTM and work fine for me on Windows 11.

@asuessenbach
Copy link
Copy Markdown
Contributor Author

Maybe you can manually specify KTX_INCLUDE_DIR and KTX_LIBRARY either at command line or via CMake GUI

Yes, that works. Thanks for that hint.

Now everything builds fine. Besides lots of warnings like:
warning MSB8065: Custom build for item "C:\git\Vulkan-Tutorial\attachments\build\VS2022_64\CMakeFiles\aba807fc7232e5502cfd42ef82d295e2\shaders.rule" succeeded, but specified output "c:\git\vulkan-tutorial\attachments\build\vs2022_64\33_vulkan_profiles\shaders" has not been created. This may cause incremental build to work incorrectly.
Is that something I should be worried about?

Besides that, is there a way to start all attachments one after the other and close them automatically? Similar to the batch mode in Vulkan-Samples?

@asuessenbach
Copy link
Copy Markdown
Contributor Author

... and: starting with 09_shader_modules, there are three projects per chapter in the VS solution: $chapter, $chapter_shader, and $chapter_slang_shader. Is that intended?

@gpx1000
Copy link
Copy Markdown
Contributor

gpx1000 commented Aug 21, 2025

Yeah, that's sadly the way Visual Studio handles cmake. We can do things to organize it a bit; maybe can consolidate into one shader compile step, but that's just Visual Studio doing Visual Studio things.

@gpx1000 gpx1000 merged commit 2d8319c into KhronosGroup:main Aug 21, 2025
5 checks passed
@asuessenbach asuessenbach deleted the 06_swap_chain_creation branch August 25, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants