Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 119-graphicspipeline-refactoring
  • 129-projekte-und-assets-auslagern
  • 132-denoising-module
  • 143-ar-vr-support-via-openxr
  • 43-multi-threading
  • 91-compute-first-network
  • 95-arm64-raspberry-pi-4-support
  • develop
  • master
  • optimizations
  • 0.1.0
  • 0.2.0
12 results

Target

Select target project
  • vulkan2021/vkcv-framework
1 result
Select Git revision
  • 119-graphicspipeline-refactoring
  • 129-projekte-und-assets-auslagern
  • 132-denoising-module
  • 143-ar-vr-support-via-openxr
  • 43-multi-threading
  • 91-compute-first-network
  • 95-arm64-raspberry-pi-4-support
  • develop
  • master
  • optimizations
  • 0.1.0
  • 0.2.0
12 results
Show changes
Commits on Source (49)
Showing
with 243 additions and 44 deletions
...@@ -18,3 +18,8 @@ cmake-build-release/ ...@@ -18,3 +18,8 @@ cmake-build-release/
# GUI configuration files # GUI configuration files
imgui.ini imgui.ini
# Generated source and header files for shaders
*.hxx
*.cxx
variables: variables:
RUN: RUN:
value: "all" value: "all"
description: "The tests that should run. Possible values: ubuntu, win, all." description: "The tests that should run. Possible values: ubuntu, win-msvc, win-mingw, mac, all."
GIT_DEPTH: 1 GIT_DEPTH: 15
stages: stages:
- build - build
...@@ -17,7 +17,7 @@ build_ubuntu_gcc: ...@@ -17,7 +17,7 @@ build_ubuntu_gcc:
- ubuntu-gcc-cached - ubuntu-gcc-cached
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
timeout: 10m timeout: 15m
retry: 1 retry: 1
script: script:
- mkdir debug - mkdir debug
...@@ -34,13 +34,13 @@ build_ubuntu_gcc: ...@@ -34,13 +34,13 @@ build_ubuntu_gcc:
build_win10_msvc: build_win10_msvc:
only: only:
variables: variables:
- $RUN =~ /\bwin.*/i || $RUN =~ /\ball.*/i - $RUN =~ /\bwin-msvc.*/i || $RUN =~ /\ball.*/i
stage: build stage: build
tags: tags:
- win10-msvc-cached - win10-msvc-cached
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
timeout: 10m timeout: 15m
retry: 0 retry: 0
script: script:
- cd 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\' - cd 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\'
...@@ -51,6 +51,42 @@ build_win10_msvc: ...@@ -51,6 +51,42 @@ build_win10_msvc:
- cmake -DCMAKE_BUILD_TYPE=Debug .. - cmake -DCMAKE_BUILD_TYPE=Debug ..
- cmake --build . - cmake --build .
build_win10_mingw:
only:
variables:
- $RUN =~ /\bwin-mingw.*/i || $RUN =~ /\ball.*/i
stage: build
tags:
- win10-mingw-cached
variables:
GIT_SUBMODULE_STRATEGY: recursive
timeout: 15m
retry: 0
script:
- mkdir debug
- cd debug
- cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++.exe .. -G "Unix Makefiles"
- cmake --build . -j 8
build_mac_clang:
only:
variables:
- $RUN =~ /\bmac.*/i || $RUN =~ /\ball.*/i
stage: build
tags:
- catalina-clang-cached
variables:
GIT_SUBMODULE_STRATEGY: recursive
timeout: 15m
retry: 1
script:
- mkdir debug
- cd debug
- export LDFLAGS="-L/usr/local/opt/llvm/lib"
- export CPPFLAGS="-I/usr/local/opt/llvm/include"
- cmake -DCMAKE_C_COMPILER="/usr/local/opt/llvm/bin/clang" -DCMAKE_CXX_COMPILER="/usr/local/opt/llvm/bin/clang++" -DCMAKE_BUILD_TYPE=Debug ..
- cmake --build .
deploy_doc_develop: deploy_doc_develop:
only: only:
variables: variables:
......
...@@ -28,3 +28,6 @@ ...@@ -28,3 +28,6 @@
[submodule "lib/VulkanMemoryAllocator-Hpp"] [submodule "lib/VulkanMemoryAllocator-Hpp"]
path = lib/VulkanMemoryAllocator-Hpp path = lib/VulkanMemoryAllocator-Hpp
url = https://github.com/malte-v/VulkanMemoryAllocator-Hpp.git url = https://github.com/malte-v/VulkanMemoryAllocator-Hpp.git
[submodule "modules/upscaling/lib/FidelityFX-FSR"]
path = modules/upscaling/lib/FidelityFX-FSR
url = https://github.com/GPUOpen-Effects/FidelityFX-FSR.git
...@@ -33,7 +33,8 @@ set(vkcv_flags ${CMAKE_CXX_FLAGS}) ...@@ -33,7 +33,8 @@ set(vkcv_flags ${CMAKE_CXX_FLAGS})
# enabling warnings in the debug build # enabling warnings in the debug build
if (vkcv_build_debug) if (vkcv_build_debug)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(vkcv_flags ${vkcv_flags} " -Weverything") #set(vkcv_flags ${vkcv_flags} " -Weverything")
set(vkcv_flags ${vkcv_flags} " -Wextra -Wall")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(vkcv_flags ${vkcv_flags} " -Wextra -Wall -pedantic") set(vkcv_flags ${vkcv_flags} " -Wextra -Wall -pedantic")
else() else()
......
...@@ -3,7 +3,13 @@ set(vkcv_config_lib ${vkcv_config}/lib) ...@@ -3,7 +3,13 @@ set(vkcv_config_lib ${vkcv_config}/lib)
set(vkcv_lib_path ${PROJECT_SOURCE_DIR}/${vkcv_lib}) set(vkcv_lib_path ${PROJECT_SOURCE_DIR}/${vkcv_lib})
if(NOT WIN32) if(NOT WIN32)
set(vkcv_libraries stdc++fs) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(vkcv_libraries stdc++fs)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
list(APPEND vkcv_flags -Xpreprocessor)
endif()
# optimization for loading times # optimization for loading times
list(APPEND vkcv_flags -pthread) list(APPEND vkcv_flags -pthread)
...@@ -34,6 +40,9 @@ endif () ...@@ -34,6 +40,9 @@ endif ()
# fix dependencies for different Linux distros (looking at you Ubuntu) # fix dependencies for different Linux distros (looking at you Ubuntu)
include(${vkcv_config_ext}/CheckLibraries.cmake) include(${vkcv_config_ext}/CheckLibraries.cmake)
# add custom function to include a file like a shader as string
include(${vkcv_config_ext}/IncludeShader.cmake)
# cleanup of compiler definitions aka preprocessor variables # cleanup of compiler definitions aka preprocessor variables
if (vkcv_definitions) if (vkcv_definitions)
list(REMOVE_DUPLICATES vkcv_definitions) list(REMOVE_DUPLICATES vkcv_definitions)
......
...@@ -6,6 +6,9 @@ set(vkcv_sources ...@@ -6,6 +6,9 @@ set(vkcv_sources
${vkcv_include}/vkcv/Core.hpp ${vkcv_include}/vkcv/Core.hpp
${vkcv_source}/vkcv/Core.cpp ${vkcv_source}/vkcv/Core.cpp
${vkcv_include}/vkcv/File.hpp
${vkcv_source}/vkcv/File.cpp
${vkcv_include}/vkcv/PassConfig.hpp ${vkcv_include}/vkcv/PassConfig.hpp
${vkcv_source}/vkcv/PassConfig.cpp ${vkcv_source}/vkcv/PassConfig.cpp
......
function(include_shader shader include_dir source_dir)
if (NOT EXISTS ${shader})
message(WARNING "Shader file does not exist: ${shader}")
else()
get_filename_component(filename ${shader} NAME)
file(SIZE ${shader} filesize)
set(include_target_file ${include_dir}/${filename}.hxx)
set(source_target_file ${source_dir}/${filename}.cxx)
if ((EXISTS ${source_target_file}) AND (EXISTS ${include_target_file}))
file(TIMESTAMP ${shader} shader_timestamp "%Y-%m-%dT%H:%M:%S")
file(TIMESTAMP ${source_target_file} source_timestamp "%Y-%m-%dT%H:%M:%S")
string(COMPARE GREATER ${shader_timestamp} ${source_timestamp} shader_update)
else()
set(shader_update true)
endif()
if (shader_update)
string(TOUPPER ${filename} varname)
string(REPLACE "." "_" varname ${varname})
set(shader_header "#pragma once\n")
string(APPEND shader_header "// This file is auto-generated via cmake, so don't touch it!\n")
string(APPEND shader_header "extern unsigned char ${varname} [${filesize}]\;\n")
string(APPEND shader_header "extern unsigned int ${varname}_LEN\;\n")
string(APPEND shader_header "const std::string ${varname}_SHADER (reinterpret_cast<const char*>(${varname}), ${varname}_LEN)\;")
file(WRITE ${include_target_file} ${shader_header})
find_program(xxd_program "xxd")
if (EXISTS ${xxd_program})
get_filename_component(shader_directory ${shader} DIRECTORY)
add_custom_command(
OUTPUT ${source_target_file}
WORKING_DIRECTORY "${shader_directory}"
COMMAND xxd -i -C "${filename}" "${source_target_file}"
COMMENT "Processing shader into source files: ${shader}"
)
else()
set(shader_source "// This file is auto-generated via cmake, so don't touch it!\n")
string(APPEND shader_source "unsigned char ${varname}[] = {")
math(EXPR max_fileoffset "${filesize} - 1" OUTPUT_FORMAT DECIMAL)
message(STATUS "Processing shader into source files: ${shader}")
foreach(fileoffset RANGE ${max_fileoffset})
file(READ ${shader} shader_source_byte OFFSET ${fileoffset} LIMIT 1 HEX)
math(EXPR offset_modulo "${fileoffset} % 12" OUTPUT_FORMAT DECIMAL)
if (${offset_modulo} EQUAL 0)
string(APPEND shader_source "\n ")
endif()
if (${fileoffset} LESS ${max_fileoffset})
string(APPEND shader_source "0x${shader_source_byte}, ")
else()
string(APPEND shader_source "0x${shader_source_byte}\n")
endif()
endforeach()
string(APPEND shader_source "}\;\n")
string(APPEND shader_source "unsigned int ${varname}_LEN = ${filesize}\;")
file(WRITE ${source_target_file} ${shader_source})
endif()
endif()
endif()
endfunction()
...@@ -39,9 +39,9 @@ namespace vkcv ...@@ -39,9 +39,9 @@ namespace vkcv
static Context create(const char *applicationName, static Context create(const char *applicationName,
uint32_t applicationVersion, uint32_t applicationVersion,
std::vector<vk::QueueFlagBits> queueFlags, const std::vector<vk::QueueFlagBits>& queueFlags,
std::vector<const char *> instanceExtensions, const std::vector<const char *>& instanceExtensions,
std::vector<const char *> deviceExtensions); const std::vector<const char *>& deviceExtensions);
private: private:
/** /**
......
...@@ -138,9 +138,9 @@ namespace vkcv ...@@ -138,9 +138,9 @@ namespace vkcv
static Core create(Window &window, static Core create(Window &window,
const char *applicationName, const char *applicationName,
uint32_t applicationVersion, uint32_t applicationVersion,
std::vector<vk::QueueFlagBits> queueFlags = {}, const std::vector<vk::QueueFlagBits>& queueFlags = {},
std::vector<const char*> instanceExtensions = {}, const std::vector<const char*>& instanceExtensions = {},
std::vector<const char*> deviceExtensions = {}); const std::vector<const char*>& deviceExtensions = {});
/** /**
* Creates a basic vulkan graphics pipeline using @p config from the pipeline config class and returns it using the @p handle. * Creates a basic vulkan graphics pipeline using @p config from the pipeline config class and returns it using the @p handle.
...@@ -163,7 +163,7 @@ namespace vkcv ...@@ -163,7 +163,7 @@ namespace vkcv
*/ */
[[nodiscard]] [[nodiscard]]
PipelineHandle createComputePipeline( PipelineHandle createComputePipeline(
const ShaderProgram &config, const ShaderProgram &shaderProgram,
const std::vector<vk::DescriptorSetLayout> &descriptorSetLayouts); const std::vector<vk::DescriptorSetLayout> &descriptorSetLayouts);
/** /**
...@@ -196,11 +196,13 @@ namespace vkcv ...@@ -196,11 +196,13 @@ namespace vkcv
* @param minFilter Minimizing filter * @param minFilter Minimizing filter
* @param mipmapMode Mipmapping filter * @param mipmapMode Mipmapping filter
* @param addressMode Address mode * @param addressMode Address mode
* @param mipLodBias Mip level of detail bias
* @return Sampler handle * @return Sampler handle
*/ */
[[nodiscard]] [[nodiscard]]
SamplerHandle createSampler(SamplerFilterType magFilter, SamplerFilterType minFilter, SamplerHandle createSampler(SamplerFilterType magFilter, SamplerFilterType minFilter,
SamplerMipmapMode mipmapMode, SamplerAddressMode addressMode); SamplerMipmapMode mipmapMode, SamplerAddressMode addressMode,
float mipLodBias = 0.0f);
/** /**
* Creates an #Image with a given format, width, height and depth. * Creates an #Image with a given format, width, height and depth.
...@@ -223,9 +225,13 @@ namespace vkcv ...@@ -223,9 +225,13 @@ namespace vkcv
Multisampling multisampling = Multisampling::None); Multisampling multisampling = Multisampling::None);
[[nodiscard]] [[nodiscard]]
uint32_t getImageWidth(ImageHandle imageHandle); uint32_t getImageWidth(const ImageHandle& image);
[[nodiscard]] [[nodiscard]]
uint32_t getImageHeight(ImageHandle imageHandle); uint32_t getImageHeight(const ImageHandle& image);
[[nodiscard]]
vk::Format getImageFormat(const ImageHandle& image);
/** TODO: /** TODO:
* @param setDescriptions * @param setDescriptions
...@@ -283,15 +289,21 @@ namespace vkcv ...@@ -283,15 +289,21 @@ namespace vkcv
const RecordCommandFunction &record, const RecordCommandFunction &record,
const FinishCommandFunction &finish); const FinishCommandFunction &finish);
void submitCommandStream(const CommandStreamHandle handle); void submitCommandStream(const CommandStreamHandle& handle);
void prepareSwapchainImageForPresent(const CommandStreamHandle handle); void prepareSwapchainImageForPresent(const CommandStreamHandle& handle);
void prepareImageForSampling(const CommandStreamHandle cmdStream, const ImageHandle image); void prepareImageForSampling(const CommandStreamHandle& cmdStream, const ImageHandle& image);
void prepareImageForStorage(const CommandStreamHandle cmdStream, const ImageHandle image); void prepareImageForStorage(const CommandStreamHandle& cmdStream, const ImageHandle& image);
void recordImageMemoryBarrier(const CommandStreamHandle cmdStream, const ImageHandle image); void recordImageMemoryBarrier(const CommandStreamHandle& cmdStream, const ImageHandle& image);
void recordBufferMemoryBarrier(const CommandStreamHandle cmdStream, const BufferHandle buffer); void recordBufferMemoryBarrier(const CommandStreamHandle& cmdStream, const BufferHandle& buffer);
void resolveMSAAImage(CommandStreamHandle cmdStream, ImageHandle src, ImageHandle dst); void resolveMSAAImage(const CommandStreamHandle& cmdStream, const ImageHandle& src, const ImageHandle& dst);
[[nodiscard]]
vk::ImageView getSwapchainImageView() const; vk::ImageView getSwapchainImageView() const;
void recordMemoryBarrier(const CommandStreamHandle& cmdStream);
void recordBlitImage(const CommandStreamHandle& cmdStream, const ImageHandle& src, const ImageHandle& dst,
SamplerFilterType filterType);
}; };
} }
...@@ -23,7 +23,9 @@ namespace vkcv ...@@ -23,7 +23,9 @@ namespace vkcv
STORAGE_BUFFER, STORAGE_BUFFER,
SAMPLER, SAMPLER,
IMAGE_SAMPLED, IMAGE_SAMPLED,
IMAGE_STORAGE IMAGE_STORAGE,
UNIFORM_BUFFER_DYNAMIC,
STORAGE_BUFFER_DYNAMIC
}; };
/* /*
......
...@@ -20,16 +20,15 @@ namespace vkcv { ...@@ -20,16 +20,15 @@ namespace vkcv {
uint32_t mipLevel; uint32_t mipLevel;
}; };
struct UniformBufferDescriptorWrite { struct BufferDescriptorWrite {
inline UniformBufferDescriptorWrite(uint32_t binding, BufferHandle buffer) : binding(binding), buffer(buffer) {}; inline BufferDescriptorWrite(uint32_t binding, BufferHandle buffer, bool dynamic = false,
uint32_t binding; uint32_t offset = 0, uint32_t size = 0) :
BufferHandle buffer; binding(binding), buffer(buffer), dynamic(dynamic), offset(offset), size(size) {};
};
struct StorageBufferDescriptorWrite {
inline StorageBufferDescriptorWrite(uint32_t binding, BufferHandle buffer) : binding(binding), buffer(buffer) {};
uint32_t binding; uint32_t binding;
BufferHandle buffer; BufferHandle buffer;
bool dynamic;
uint32_t offset;
uint32_t size;
}; };
struct SamplerDescriptorWrite { struct SamplerDescriptorWrite {
...@@ -41,8 +40,8 @@ namespace vkcv { ...@@ -41,8 +40,8 @@ namespace vkcv {
struct DescriptorWrites { struct DescriptorWrites {
std::vector<SampledImageDescriptorWrite> sampledImageWrites; std::vector<SampledImageDescriptorWrite> sampledImageWrites;
std::vector<StorageImageDescriptorWrite> storageImageWrites; std::vector<StorageImageDescriptorWrite> storageImageWrites;
std::vector<UniformBufferDescriptorWrite> uniformBufferWrites; std::vector<BufferDescriptorWrite> uniformBufferWrites;
std::vector<StorageBufferDescriptorWrite> storageBufferWrites; std::vector<BufferDescriptorWrite> storageBufferWrites;
std::vector<SamplerDescriptorWrite> samplerWrites; std::vector<SamplerDescriptorWrite> samplerWrites;
}; };
} }
\ No newline at end of file
...@@ -14,11 +14,13 @@ namespace vkcv { ...@@ -14,11 +14,13 @@ namespace vkcv {
}; };
struct DescriptorSetUsage { struct DescriptorSetUsage {
inline DescriptorSetUsage(uint32_t setLocation, vk::DescriptorSet vulkanHandle) noexcept inline DescriptorSetUsage(uint32_t setLocation, vk::DescriptorSet vulkanHandle,
: setLocation(setLocation), vulkanHandle(vulkanHandle) {} const std::vector<uint32_t>& dynamicOffsets = {}) noexcept
: setLocation(setLocation), vulkanHandle(vulkanHandle), dynamicOffsets(dynamicOffsets) {}
const uint32_t setLocation; const uint32_t setLocation;
const vk::DescriptorSet vulkanHandle; const vk::DescriptorSet vulkanHandle;
const std::vector<uint32_t> dynamicOffsets;
}; };
struct Mesh { struct Mesh {
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <mutex> #include <mutex>
#endif #endif
#include <vector>
namespace vkcv { namespace vkcv {
template<typename... T> template<typename... T>
......
#pragma once
#include <filesystem>
namespace vkcv {
std::filesystem::path generateTemporaryFilePath();
std::filesystem::path generateTemporaryDirectoryPath();
}
...@@ -32,8 +32,8 @@ namespace vkcv { ...@@ -32,8 +32,8 @@ namespace vkcv {
const std::vector<Queue> &getTransferQueues() const; const std::vector<Queue> &getTransferQueues() const;
static void queueCreateInfosQueueHandles(vk::PhysicalDevice &physicalDevice, static void queueCreateInfosQueueHandles(vk::PhysicalDevice &physicalDevice,
std::vector<float> &queuePriorities, const std::vector<float> &queuePriorities,
std::vector<vk::QueueFlagBits> &queueFlags, const std::vector<vk::QueueFlagBits> &queueFlags,
std::vector<vk::DeviceQueueCreateInfo> &queueCreateInfos, std::vector<vk::DeviceQueueCreateInfo> &queueCreateInfos,
std::vector<std::pair<int, int>> &queuePairsGraphics, std::vector<std::pair<int, int>> &queuePairsGraphics,
std::vector<std::pair<int, int>> &queuePairsCompute, std::vector<std::pair<int, int>> &queuePairsCompute,
......
...@@ -7,3 +7,4 @@ add_subdirectory(material) ...@@ -7,3 +7,4 @@ add_subdirectory(material)
add_subdirectory(scene) add_subdirectory(scene)
add_subdirectory(shader_compiler) add_subdirectory(shader_compiler)
add_subdirectory(testing) add_subdirectory(testing)
add_subdirectory(upscaling)
...@@ -10,6 +10,9 @@ set(vkcv_shader_compiler_include ${PROJECT_SOURCE_DIR}/include) ...@@ -10,6 +10,9 @@ set(vkcv_shader_compiler_include ${PROJECT_SOURCE_DIR}/include)
# Add source and header files to the module # Add source and header files to the module
set(vkcv_shader_compiler_sources set(vkcv_shader_compiler_sources
${vkcv_shader_compiler_include}/vkcv/shader/Compiler.hpp
${vkcv_shader_compiler_source}/vkcv/shader/Compiler.cpp
${vkcv_shader_compiler_include}/vkcv/shader/GLSLCompiler.hpp ${vkcv_shader_compiler_include}/vkcv/shader/GLSLCompiler.hpp
${vkcv_shader_compiler_source}/vkcv/shader/GLSLCompiler.cpp ${vkcv_shader_compiler_source}/vkcv/shader/GLSLCompiler.cpp
) )
......
#pragma once #pragma once
#include <filesystem>
#include <string>
#include <unordered_map>
#include <vkcv/Event.hpp> #include <vkcv/Event.hpp>
#include <vkcv/ShaderStage.hpp>
namespace vkcv::shader { namespace vkcv::shader {
...@@ -8,10 +13,21 @@ namespace vkcv::shader { ...@@ -8,10 +13,21 @@ namespace vkcv::shader {
class Compiler { class Compiler {
private: private:
protected:
std::unordered_map<std::string, std::string> m_defines;
public: public:
virtual bool compileSource(ShaderStage shaderStage, const char* shaderSource,
const ShaderCompiledFunction& compiled,
const std::filesystem::path& includePath) = 0;
virtual void compile(ShaderStage shaderStage, const std::filesystem::path& shaderPath, virtual void compile(ShaderStage shaderStage, const std::filesystem::path& shaderPath,
const ShaderCompiledFunction& compiled, bool update = false) = 0; const ShaderCompiledFunction& compiled,
const std::filesystem::path& includePath, bool update) = 0;
std::string getDefine(const std::string& name) const;
void setDefine(const std::string& name, const std::string& value);
}; };
} }
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace vkcv::shader { namespace vkcv::shader {
class GLSLCompiler { class GLSLCompiler : public Compiler {
private: private:
public: public:
GLSLCompiler(); GLSLCompiler();
...@@ -20,8 +20,13 @@ namespace vkcv::shader { ...@@ -20,8 +20,13 @@ namespace vkcv::shader {
GLSLCompiler& operator=(const GLSLCompiler& other); GLSLCompiler& operator=(const GLSLCompiler& other);
GLSLCompiler& operator=(GLSLCompiler&& other) = default; GLSLCompiler& operator=(GLSLCompiler&& other) = default;
bool compileSource(ShaderStage shaderStage, const char* shaderSource,
const ShaderCompiledFunction& compiled,
const std::filesystem::path& includePath);
void compile(ShaderStage shaderStage, const std::filesystem::path& shaderPath, void compile(ShaderStage shaderStage, const std::filesystem::path& shaderPath,
const ShaderCompiledFunction& compiled, bool update = false); const ShaderCompiledFunction& compiled,
const std::filesystem::path& includePath = "", bool update = false) override;
}; };
......
#include "vkcv/shader/Compiler.hpp"
namespace vkcv::shader {
std::string Compiler::getDefine(const std::string &name) const {
return m_defines.at(name);
}
void Compiler::setDefine(const std::string &name, const std::string &value) {
m_defines[name] = value;
}
}