Skip to content
Snippets Groups Projects
Verified Commit 3abbab4a authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Initial commit to add submodules and cmake configs

parent adf52ba1
No related branches found
No related tags found
1 merge request!116Resolve "VCC/Shady support"
This commit is part of merge request !116. Comments created here will be created in the context of that merge request.
...@@ -70,3 +70,12 @@ ...@@ -70,3 +70,12 @@
path = modules/asset_loader/lib/wuffs-mirror-release-c path = modules/asset_loader/lib/wuffs-mirror-release-c
url = https://github.com/google/wuffs-mirror-release-c.git url = https://github.com/google/wuffs-mirror-release-c.git
branch = main branch = main
[submodule "modules/shader_compiler/lib/shady"]
path = modules/shader_compiler/lib/shady
url = https://github.com/TheJackiMonster/shady.git
[submodule "modules/shader_compiler/lib/SPIRV-Headers"]
path = modules/shader_compiler/lib/SPIRV-Headers
url = https://github.com/KhronosGroup/SPIRV-Headers.git
[submodule "modules/shader_compiler/lib/murmur3"]
path = modules/shader_compiler/lib/murmur3
url = https://github.com/PeterScott/murmur3.git
...@@ -21,6 +21,9 @@ set(vkcv_shader_compiler_sources ...@@ -21,6 +21,9 @@ set(vkcv_shader_compiler_sources
${vkcv_shader_compiler_include}/vkcv/shader/HLSLCompiler.hpp ${vkcv_shader_compiler_include}/vkcv/shader/HLSLCompiler.hpp
${vkcv_shader_compiler_source}/vkcv/shader/HLSLCompiler.cpp ${vkcv_shader_compiler_source}/vkcv/shader/HLSLCompiler.cpp
${vkcv_shader_compiler_include}/vkcv/shader/ShadyCompiler.hpp
${vkcv_shader_compiler_source}/vkcv/shader/ShadyCompiler.cpp
) )
filter_headers(vkcv_shader_compiler_sources ${vkcv_shader_compiler_include} vkcv_shader_compiler_headers) filter_headers(vkcv_shader_compiler_sources ${vkcv_shader_compiler_include} vkcv_shader_compiler_headers)
...@@ -33,9 +36,16 @@ set_target_properties(vkcv_shader_compiler PROPERTIES PUBLIC_HEADER "${vkcv_shad ...@@ -33,9 +36,16 @@ set_target_properties(vkcv_shader_compiler PROPERTIES PUBLIC_HEADER "${vkcv_shad
set(vkcv_shader_compiler_lib lib) set(vkcv_shader_compiler_lib lib)
set(vkcv_shader_compiler_lib_path ${PROJECT_SOURCE_DIR}/${vkcv_shader_compiler_lib}) set(vkcv_shader_compiler_lib_path ${PROJECT_SOURCE_DIR}/${vkcv_shader_compiler_lib})
# Load SPIRV-Headers
include(config/SPIRV-Headers.cmake)
# Check and load GLSLANG # Check and load GLSLANG
include(config/GLSLANG.cmake) include(config/GLSLANG.cmake)
# Check and load Shady (with murmur3)
include(config/Murmur3.cmake)
include(config/Shady.cmake)
# link the required libraries to the module # link the required libraries to the module
target_link_libraries(vkcv_shader_compiler ${vkcv_shader_compiler_libraries} vkcv) target_link_libraries(vkcv_shader_compiler ${vkcv_shader_compiler_libraries} vkcv)
......
use_git_submodule("${vkcv_shader_compiler_lib_path}/murmur3" murmur3_status)
if (${murmur3_status})
add_library(murmur3 STATIC ${vkcv_shader_compiler_lib}/murmur3/murmur3.c)
target_include_directories(murmur3 INTERFACE ${vkcv_shader_compiler_lib}/murmur3)
set_target_properties(murmur3 PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif ()
use_git_submodule("${vkcv_shader_compiler_lib_path}/SPIRV-Headers" spriv_headers_status)
if (${spriv_headers_status})
add_subdirectory(${vkcv_shader_compiler_lib}/SPIRV-Headers)
list(APPEND vkcv_shader_compiler_libraries SPIRV-Headers)
list(APPEND vkcv_shader_compiler_includes ${vkcv_shader_compiler_lib}/SPIRV-Headers/include)
endif ()
use_git_submodule("${vkcv_shader_compiler_lib_path}/shady" shady_status)
if (${shady_status})
set(EXTERNAL_SPIRV_HEADERS ON CACHE INTERNAL "")
set(EXTERNAL_MURMUR3 ON CACHE INTERNAL "")
add_subdirectory(${vkcv_shader_compiler_lib}/shady)
list(APPEND vkcv_shader_compiler_libraries shady)
list(APPEND vkcv_shader_compiler_includes ${vkcv_shader_compiler_lib}/shady/include)
endif ()
#pragma once
#include <filesystem>
#include <vkcv/ShaderStage.hpp>
#include "Compiler.hpp"
namespace vkcv::shader {
class ShadyCompiler : public Compiler {
public:
ShadyCompiler();
ShadyCompiler(const ShadyCompiler& other);
ShadyCompiler(ShadyCompiler&& other) = default;
~ShadyCompiler();
ShadyCompiler& operator=(const ShadyCompiler& other);
ShadyCompiler& operator=(ShadyCompiler&& other) = default;
void compile(ShaderStage shaderStage,
const std::filesystem::path& shaderPath,
const ShaderCompiledFunction& compiled,
const std::filesystem::path& includePath = "",
bool update = false) override;
}
}
Subproject commit bdd1b2ab1f03e616047bbcf8971157dccd50c792
Subproject commit dae94be0c0f54a399d23ea6cbe54bca5a4e93ce4
Subproject commit 6ab5f5fc520de70e6f19d1e7312a70aea71020fd
#include "vkcv/shader/ShadyCompiler.hpp"
#include <vkcv/File.hpp>
#include <vkcv/Logger.hpp>
namespace vkcv::shader {
ShadyCompiler::ShadyCompiler() : Compiler() {
// TODO
}
ShadyCompiler::ShadyCompiler(const ShadyCompiler &other) : Compiler(other) {
// TODO
}
ShadyCompiler::~ShadyCompiler() {
// TODO
}
ShadyCompiler &ShadyCompiler::operator=(const ShadyCompiler &other) {
// TODO
return *this;
}
void ShadyCompiler::compile(ShaderStage shaderStage,
const std::filesystem::path &shaderPath,
const ShaderCompiledFunction &compiled,
const std::filesystem::path &includePath,
bool update) {
// TODO
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment