Skip to content
Snippets Groups Projects
Commit 636f8131 authored by Leonie Franken's avatar Leonie Franken
Browse files

[#36][Propose] Add SPIRV-Cross Library globally

parent ad3e597c
No related branches found
No related tags found
1 merge request!28Resolve "Shader Program Reflection"
Pipeline #25030 failed
[submodule "lib/glfw"] [submodule "lib/glfw"]
path = lib/glfw path = lib/glfw
url = https://github.com/glfw/glfw.git url = https://github.com/glfw/glfw.git
[submodule "lib/SPIRV-Cross"]
path = lib/SPIRV-Cross
url = https://github.com/KhronosGroup/SPIRV-Cross.git
...@@ -16,6 +16,7 @@ set(vkcv_config_msg " - Library: ") ...@@ -16,6 +16,7 @@ set(vkcv_config_msg " - Library: ")
# load dependencies via separate cmake file # load dependencies via separate cmake file
include(${vkcv_config_lib}/GLFW.cmake) # glfw-x11 / glfw-wayland # libglfw3-dev include(${vkcv_config_lib}/GLFW.cmake) # glfw-x11 / glfw-wayland # libglfw3-dev
include(${vkcv_config_lib}/Vulkan.cmake) # vulkan-intel / vulkan-radeon / nvidia # libvulkan-dev include(${vkcv_config_lib}/Vulkan.cmake) # vulkan-intel / vulkan-radeon / nvidia # libvulkan-dev
include(${vkcv_config_lib}/SPIRV_Cross.cmake) # SPIRV-Cross # libspirv_cross_c_shared
# cleanup of compiler flags # cleanup of compiler flags
if (vkcv_flags) if (vkcv_flags)
......
find_package(spirv_cross_c_shared QUIET)
if (spirv-cross_FOUND)
list(APPEND vkcv_libraries spirv_cross_c_shared)
message(${vkcv_config_msg} " SPIRV Cross - ")
else()
if (EXISTS "${vkcv_lib_path}/SPIRV-Cross")
add_subdirectory(${vkcv_lib}/SPIRV-Cross)
list(APPEND vkcv_libraries spirv_cross_c_shared)
message(${vkcv_config_msg} " SPIRV Cross - ")
else()
message(WARNING "SPIRV-Cross is required..! Update the submodules!")
endif ()
endif ()
\ No newline at end of file
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <iostream> #include <iostream>
#include <filesystem> #include <filesystem>
#include <vulkan/vulkan.hpp> #include <vulkan/vulkan.hpp>
#include <spirv_glsl.hpp>
namespace vkcv { namespace vkcv {
...@@ -53,6 +54,8 @@ namespace vkcv { ...@@ -53,6 +54,8 @@ namespace vkcv {
bool existsShader(ShaderStage shaderStage) const; bool existsShader(ShaderStage shaderStage) const;
void reflectShader(ShaderStage shaderStage) const;
private: private:
std::unordered_map<ShaderStage, Shader> m_Shaders; std::unordered_map<ShaderStage, Shader> m_Shaders;
......
Subproject commit ff61890722a91e97c44940494be5b6eed0d5ff5b
...@@ -59,4 +59,10 @@ namespace vkcv { ...@@ -59,4 +59,10 @@ namespace vkcv {
else else
return true; return true;
} }
void ShaderProgram::reflectShader(ShaderStage shaderStage) const
{
auto shaderCode = m_Shaders.at(shaderStage).shaderCode;
//TODO
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment