Use of vk::StructureChain on device creation.#89
Conversation
| {.dynamicRendering = true }, // vk::PhysicalDeviceVulkan13Features | ||
| {.extendedDynamicState = true } // vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT | ||
| }; | ||
|
|
There was a problem hiding this comment.
That's really cool, I didn't even know this was available. We should also find a place in the tutorial text to call this out, describe pros/cons and recommend it. If you'd like go ahead and add this to the rest of the chapters and I'm happy to draft the language in the tutorial itself unless you wanna do that?
There was a problem hiding this comment.
If you'd like go ahead and add this to the rest of the chapters
With "this", you mean the approach right above?
I also like that one a little more, even though it needs that vk::PhysicalDeviceFeatures2 as an anchor for the structs, which isn't used besides that.
The other approach doesn't need that struct, the feature structs are simply chained to vk::DeviceCreateInfo.
I'm happy to draft the language in the tutorial itself
Sounds good.
There was a problem hiding this comment.
Yep, i meant the first approach. For some reason to my eye it still looks cleaner even if it requires an extra struct rather than directly to the device create info. Maybe because it feels closer to what I'm used to with the C version to use the extra struct or at least kinda follow what I'm expecting.
d1a6f35 to
ce6b836
Compare
ce6b836 to
615f375
Compare
|
Adjusted the device creation in all the chapters. Note: chapters |
|
Thanks for the work @asuessenbach, I wasn't aware of the validation errors or compute shader not building. I'll take a look at that. This PR LGTM. |
|
@asuessenbach , 31_compute_shader.cpp compiles and runs for me. CI shows it builds correctly, could you tell me more about what causes it to not build? I want to see if I can fix CI so it'll help me out. I'm working on the text to document this change in the tutorial right now (why I merged early). I'll also look into the validation issues. |
|
@gpx1000: I can successfully compile 31_compute_shader.cpp. But before and up to this PR, I got the following messages on building 31_compute_shader: I can't easily identify the issue here. With top of tree, I even can't create the solution using the CMake GUI. I get Is there anything obvious, I'm missing? |
|
I had similar CMake errors. CMake GUI was picking up wrong packages, I need to run on cmd line and specifiy the vcpkg toolchain like this: cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=V:\github\vcpkg\scripts\buildsystems\vcpkg.cmake That picks up the correct packages. Using CMake's GUI on Windows doesn't work for me either, I guess that's because you explicitly need to specify the vcpkg toolchain |
|
Yeah the tool chain file must be defined. I should write up directions in
the readme for using vcpkg with and without the gui
…On Wed, Jul 9, 2025, 8:54 AM Sascha Willems ***@***.***> wrote:
*SaschaWillems* left a comment (KhronosGroup/Vulkan-Tutorial#89)
<#89 (comment)>
I had similar CMake errors. CMake GUI was picking up wrong packages, I
need to run on cmd line and specifiy the vcpkg toolchain like this:
cmake -B build -S .
-DCMAKE_TOOLCHAIN_FILE=V:\github\vcpkg\scripts\buildsystems\vcpkg.cmake
That picks up the correct packages.
—
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5IAYZSNSV5H7HPIVHXCJL3HU3MLAVCNFSM6AAAAACA6TGMRGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTANJTGE3TENBSGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Unfortunately, using that command line doesn't resolve my issue. When I run the install_dependencies_windows.bat, I get the following: It says, all dependencies have been installed successfully, but there's some error on the KTX stuff. When I then run the build as given by @SaschaWillems, I get I have no ideas how to resolve that. |
|
hmm... looks like the CI is also having the problem. Lemme investigate. |
Demonstrates the usage of
vk::StructureChainon device creation, with two slightly different approaches.If one of them is considered to be good, I can adjust this code in the other sources as well.