-
Notifications
You must be signed in to change notification settings - Fork 64
Daemon-vulkan infrastructure 2 #1845
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
base: master
Are you sure you want to change the base?
Conversation
Most of the changes are just the XML spec and existing generator code. |
afbdcb0
to
f8462a8
Compare
f8462a8
to
72c00bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VulkanHeaders
seems to be a third-party library, so it should go in libs
. Is there some good reason to check in the files directly instead of using a submodule?
72c00bf
to
4d9ae49
Compare
Most of it is not used by daemon-vulkan. |
So what is the future maintenance plan for VulkanHeaders: do we expect to maintain it ourselves or periodically sync updates from upstream? |
Periodic sync. Header generator rarely ever gets updates and likely would continue working as is without issue. |
2cdc4da
to
2ce79c6
Compare
OK cool. In any case it should go in |
2ce79c6
to
64f9b54
Compare
Moved it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slightly modified version of the Khronos Vulkan header generator,
If there are modifications of the files in libs/
relative to upstream, would you mind checking in the original upstream version as the first commit, and then the local changes as a second commit? That way we can see what was changed in the history.
Also I request that the commit hash of the Vulkan Headers repo be recorded in the commit message.
cmake/DaemonVulkan.cmake
Outdated
message( FATAL_ERROR "Could NOT find libVulkan" ) | ||
endif() | ||
|
||
set( generatorPath ${CMAKE_SOURCE_DIR}/cmake/DaemonVulkan/VulkanHeaders/ ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path needs to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as well.
cmake/DaemonVulkan.cmake
Outdated
endif() | ||
endfunction() | ||
|
||
function( GenerateVulkanHeaders2 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need GenerateVulkanHeaders and GenerateVulkanHeaders2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just unsuccessful attempts at making cmake generate it automatically. I've removed that, easier to just run the generator script manually and commit the headers than deal with cmake's bullshit.
cmake/DaemonVulkan.cmake
Outdated
find_package( Vulkan REQUIRED COMPONENTS glslangValidator glslang ) | ||
|
||
if( NOT Vulkan_FOUND ) | ||
message( FATAL_ERROR "Could NOT find libVulkan" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be needed since REQUIRED was used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed that find_package
since it's not used anymore.
cmake/DaemonVulkan.cmake
Outdated
endforeach() | ||
|
||
if( REGENERATE OR ${generatorPath}/vk.xml IS_NEWER_THAN ${generatorPath}/vk.xml.tmp OR NOT EXISTS ${generatorPath}/vk.xml.tmp ) | ||
configure_file( ${generatorPath}/vk.xml ${generatorPath}/vk.xml.tmp COPYONLY ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to make an exact copy of the XML file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just more attempts at making it generate, removed now.
|
||
macro( GenerateVulkanShaders target ) | ||
# Pre-processing for #insert/#include | ||
foreach( src IN LISTS graphicsEngineList ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is graphicsEngineList
defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In renderer-vulkan/src.cmake, but there's nothing to check in there currently. I have a couple files there that I've been testing with locally, but they're just random code from the GL renderer with a few changes.
option( VULKAN_SPIRV_LTO "Enable link-time SPIR-V optimisations." ON ) | ||
|
||
if( USE_VULKAN ) | ||
add_executable( VulkanShaderParser "${DAEMON_DIR}/cmake/DaemonVulkan/VulkanShaderParser.cpp" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Host-mode tools mess up cross compiling, so it would be nice to rewrite that in Python at some point (non-blocking comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah probably. This is mostly just the #insert code from gl_shader.cpp, with support for recursion and glslangValidator calls.
6a64000
to
21f9e08
Compare
Sure, done. |
…t to regenerate when modifying
21f9e08
to
1fd0e0b
Compare
cbb126c
to
be51166
Compare
Vulkan header generator and xml spec from https://github.com/KhronosGroup/Vulkan-Docs commit: 7fe2b623f13dabb885e35b953dd690f01093d4bb
be51166
to
f81e205
Compare
Also add a script to generate all the headers we need along with function loading.
f81e205
to
984d775
Compare
Adds some more cmake changes required for daemon-vulkan, slightly modified version of the Khronos Vulkan header generator, as well as a shader generator with support for
#insert/#include
and SPIR-V generation. Also added some of the embed stuff from #1842 with more functionality.