Commit 636f8131 authored by Leonie Charlotte Franken's avatar Leonie Charlotte Franken
Browse files

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

parent ad3e597c
Pipeline #25030 failed with stages
in 53 seconds
[submodule "lib/glfw"]
path = lib/glfw
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: ")
# load dependencies via separate cmake file
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}/SPIRV_Cross.cmake) # SPIRV-Cross # libspirv_cross_c_shared
# cleanup of compiler 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 @@
#include <iostream>
#include <filesystem>
#include <vulkan/vulkan.hpp>
#include <spirv_glsl.hpp>
namespace vkcv {
......@@ -53,6 +54,8 @@ namespace vkcv {
bool existsShader(ShaderStage shaderStage) const;
void reflectShader(ShaderStage shaderStage) const;
private:
std::unordered_map<ShaderStage, Shader> m_Shaders;
......
Subproject commit ff61890722a91e97c44940494be5b6eed0d5ff5b
......@@ -59,4 +59,10 @@ namespace vkcv {
else
return true;
}
void ShaderProgram::reflectShader(ShaderStage shaderStage) const
{
auto shaderCode = m_Shaders.at(shaderStage).shaderCode;
//TODO
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment