Skip to content

Vulkan: Update all components to Vulkan SDK 1.4.313.0 #107773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Jun 20, 2025

Needs to be tested on all platforms where we support Vulkan, but also D3D12 and Metal for SPIR-V.
Our last sync was a year ago so this is long overdue, and thus would be good to include in 4.5.

Updated:

  • vulkan headers
  • volk
  • glslang
  • spirv-reflect
  • spirv-cross
  • vk_mem_alloc 3.3.0

@akien-mga akien-mga added this to the 4.5 milestone Jun 20, 2025
@akien-mga akien-mga requested a review from a team as a code owner June 20, 2025 16:49
@akien-mga akien-mga requested review from stuartcarnie and bruvzg June 20, 2025 16:53
@akien-mga akien-mga changed the title vulkan: Update all components to Vulkan SDK 1.4.313.0 Vulkan: Update all components to Vulkan SDK 1.4.313.0 Jun 20, 2025
@akien-mga akien-mga force-pushed the vulkan-sdk-1.4.313.0 branch from 86f9d62 to a7995eb Compare June 20, 2025 20:41
@akien-mga akien-mga requested a review from a team as a code owner June 20, 2025 20:41
@akien-mga akien-mga force-pushed the vulkan-sdk-1.4.313.0 branch from a7995eb to d8b1c70 Compare June 20, 2025 20:44
Comment on lines 36 to 37
# We don't use it for now, and it depends on Windows APIs.
env_thirdparty_vma.AppendUnique(CPPDEFINES=["VMA_EXTERNAL_MEMORY_WIN32=0"])
Copy link
Member Author

@akien-mga akien-mga Jun 20, 2025

Choose a reason for hiding this comment

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

I disabled this to solve these build errors:

 Error: D:\a\godot\godot\thirdparty\vulkan\vk_mem_alloc.h(6217): error C2039: 'CloseHandle': is not a member of '`global namespace''
Error: D:\a\godot\godot\thirdparty\vulkan\vk_mem_alloc.h(6217): error C3861: 'CloseHandle': identifier not found
Error: D:\a\godot\godot\thirdparty\vulkan\vk_mem_alloc.h(6267): error C2039: 'GetCurrentProcess': is not a member of '`global namespace''
Error: D:\a\godot\godot\thirdparty\vulkan\vk_mem_alloc.h(6267): error C3861: 'GetCurrentProcess': identifier not found
Error: D:\a\godot\godot\thirdparty\vulkan\vk_mem_alloc.h(6269): error C2039: 'DuplicateHandle': is not a member of '`global namespace''
Error: D:\a\godot\godot\thirdparty\vulkan\vk_mem_alloc.h(6269): error C2065: 'FALSE': undeclared identifier
Error: D:\a\godot\godot\thirdparty\vulkan\vk_mem_alloc.h(6269): error C2065: 'DUPLICATE_SAME_ACCESS': undeclared identifier
Error: D:\a\godot\godot\thirdparty\vulkan\vk_mem_alloc.h(6269): error C3861: 'DuplicateHandle': identifier not found

AFAIK we don't use this extension, it's just automatically picked up as present in the Vulkan headers. It was added in VMA 3.2.0: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/master/CHANGELOG.md#320-2024-12-30

If we want to use it, we can likely solve the issues by including windows.h ( 😿 ) or a narrower Win32 header.

Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

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

Metal fix looks good to me, as noted, @akien-mga added an additional case to handle a new enum variant. We can ignore the variant, as it is specifically for this extension, which Godot doesn't use. If that were to change, we'd need to update this code

Updates:
- Vulkan headers
- volk
- glslang
- spirv-reflect
- spirv-cross
- vk_mem_alloc 3.3.0
@akien-mga akien-mga force-pushed the vulkan-sdk-1.4.313.0 branch from d8b1c70 to f0d244b Compare June 20, 2025 21:22
@akien-mga
Copy link
Member Author

BTW, I noticed this in drivers/vulkan/SCsub:

elif env["platform"] == "android":
# Our current NDK version only provides old Vulkan headers,
# so we have to limit VMA.
env_thirdparty_vma.AppendUnique(CPPDEFINES=["VMA_VULKAN_VERSION=1000000"])
elif env["platform"] == "macos" or env["platform"] == "ios":
# MoltenVK supports only Vulkan 1.1 API, limit VMA to the same version.
env_thirdparty_vma.AppendUnique(CPPDEFINES=["VMA_VULKAN_VERSION=1001000"])

The Android note is likely obsolete now that we're using NDK r28, we might want to reconsider.
Likewise the note for macOS and iOS could be checked against the latest MoltenVK to see if it's still relevant.
I don't know what's the actual impact of "limiting VMA" to specific Vulkan versions though.

@bruvzg
Copy link
Member

bruvzg commented Jun 22, 2025

I'm getting a lot of pipeline errors with this PR when running tps-demo using Vulkan on macOS (but the demo seems to be running fine).

ERROR: The shader in this pipeline requires a push constant to be set before drawing, but it's not present.
   at: compute_list_dispatch (servers/rendering/rendering_device.cpp:5275)
ERROR: This compute pipeline requires (20) bytes of push constant data, supplied: (32)
   at: compute_list_set_push_constant (servers/rendering/rendering_device.cpp:5236)

ERROR: The shader in this pipeline requires a push constant to be set before drawing, but it's not present.
   at: compute_list_dispatch (servers/rendering/rendering_device.cpp:5275)
ERROR: This compute pipeline requires (8) bytes of push constant data, supplied: (16)
   at: compute_list_set_push_constant (servers/rendering/rendering_device.cpp:5236)

@dsnopek
Copy link
Contributor

dsnopek commented Jun 26, 2025

I'm getting the same errors as @bruvzg spammed super fast, to the point that I can't seem to operate the editor built from this PR. At least I think it's due to the error spam and not some lower-level issue, but I'm not sure

But if I use an editor compiled from master, and an Android template built from this PR deployed to a Meta Quest 3, the app is usable (still with tons of error spam, but it works), however, the colors look darker than they should be

@akien-mga
Copy link
Member Author

I won't have time to debug the pipeline errors as I'm going on leave :D

If we'd still like to do this update for 4.5 (or whichever SDK comes next, they've been tagging versions weekly for a month now, I expect one will soon be promoted to SDK), someone else will have to take over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants