Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Merge requests
!115
Resolve "Slang Compiler"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Slang Compiler"
144-slang-compiler
into
develop
Overview
2
Commits
7
Pipelines
0
Changes
3
Merged
Tobias Frisch
requested to merge
144-slang-compiler
into
develop
1 year ago
Overview
2
Commits
7
Pipelines
0
Changes
3
Expand
Closes
#144 (closed)
0
0
Merge request reports
Viewing commit
a7496fd7
Prev
Next
Show latest version
3 files
+
151
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
Verified
a7496fd7
Add generic SlangCompiler class
· a7496fd7
Tobias Frisch
authored
9 months ago
Signed-off-by:
Tobias Frisch
<
tfrisch@uni-koblenz.de
>
modules/shader_compiler/include/vkcv/shader/SlangCompiler.hpp
0 → 100644
+
91
−
0
Options
#pragma once
#include
<filesystem>
#include
<vkcv/ShaderStage.hpp>
#include
"Compiler.hpp"
namespace
vkcv
::
shader
{
/**
* @addtogroup vkcv_shader
* @{
*/
enum
class
SlangCompileProfile
{
GLSL
,
HLSL
,
SPIRV
,
UNKNOWN
};
/**
* An abstract class to handle Slang runtime shader compilation.
*/
class
SlangCompiler
:
public
Compiler
{
private:
SlangCompileProfile
m_profile
;
public:
/**
* The constructor of a runtime Slang shader compiler instance.
*
* @param[in] profile Compile profile (optional)
*/
SlangCompiler
(
SlangCompileProfile
profile
=
SlangCompileProfile
::
UNKNOWN
);
/**
* The copy-constructor of a runtime Slang shader compiler instance.
*
* @param[in] other Other instance of a Slang shader compiler instance
*/
SlangCompiler
(
const
SlangCompiler
&
other
);
/**
* The move-constructor of a runtime Slang shader compiler instance.
*
* @param[out] other Other instance of a Slang shader compiler instance
*/
SlangCompiler
(
SlangCompiler
&&
other
)
=
default
;
/**
* The destructor of a runtime Slang shader compiler instance.
*/
~
SlangCompiler
();
/**
* The copy-operator of a runtime Slang shader compiler instance.
*
* @param[in] other Other instance of a Slang shader compiler instance
* @return Reference to this instance
*/
SlangCompiler
&
operator
=
(
const
SlangCompiler
&
other
);
/**
* The copy-operator of a runtime Slang shader compiler instance.
*
* @param[out] other Other instance of a Slang shader compiler instance
* @return Reference to this instance
*/
SlangCompiler
&
operator
=
(
SlangCompiler
&&
other
)
=
default
;
/**
* Compile a shader from source for a target stage with a custom shader
* include path and an event function called if the compilation completes.
*
* @param[in] shaderStage Shader pipeline stage
* @param[in] shaderSource Source of shader
* @param[in] compiled Shader compilation event
* @param[in] includePath Include path for shaders
* @return Result if the compilation succeeds
*/
bool
compileSource
(
ShaderStage
shaderStage
,
const
std
::
string
&
shaderSource
,
const
ShaderCompiledFunction
&
compiled
,
const
std
::
filesystem
::
path
&
includePath
)
override
;
};
/** @} */
}
Loading