diff --git a/src/include/kompute/Shader.hpp b/src/include/kompute/Shader.hpp index 89ecc2aeb..701f7fc16 100644 --- a/src/include/kompute/Shader.hpp +++ b/src/include/kompute/Shader.hpp @@ -11,14 +11,42 @@ namespace kp { +/** + Shader utily class with functions to compile and process glsl files. +*/ class Shader { public: + /** + * Compile multiple sources with optional filenames. Currently this function + * uses the glslang C++ interface which is not thread safe so this funciton + * should not be called from multiple threads concurrently. If you have a + * online shader processing multithreading use-case that can't use offline + * compilation please open an issue. + * + * @param sources A list of raw glsl shaders in string format + * @param files A list of file names respective to each of the sources + * @param entryPoint The function name to use as entry point + * @param definitions List of pairs containing key value definitions + * @return The compiled SPIR-V binary in unsigned int32 format + */ static std::vector compile_sources( const std::vector& sources, const std::vector& files = {}, const std::string& entryPoint = "main", std::vector> definitions = {}); + /** + * Compile a single glslang source from string value. Currently this function + * uses the glslang C++ interface which is not thread safe so this funciton + * should not be called from multiple threads concurrently. If you have a + * online shader processing multithreading use-case that can't use offline + * compilation please open an issue. + * + * @param source An individual raw glsl shader in string format + * @param entryPoint The function name to use as entry point + * @param definitions List of pairs containing key value definitions + * @return The compiled SPIR-V binary in unsigned int32 format + */ static std::vector compile_source( const std::string& source, const std::string& entryPoint = "main",