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
25
Merged
Tobias Frisch
requested to merge
144-slang-compiler
into
develop
1 year ago
Overview
2
Commits
7
Pipelines
0
Changes
1
Expand
Closes
#144 (closed)
0
0
Merge request reports
Compare
version 7
version 7
6fcadc36
6 months ago
version 6
f005b1a9
6 months ago
version 5
a7496fd7
8 months ago
version 4
b05076ca
8 months ago
version 3
cb72b64c
8 months ago
version 2
b6892647
1 year ago
version 1
c6b25451
1 year ago
develop (base)
and
latest version
latest version
c7b5f3c2
7 commits,
6 months ago
version 7
6fcadc36
6 commits,
6 months ago
version 6
f005b1a9
5 commits,
6 months ago
version 5
a7496fd7
4 commits,
8 months ago
version 4
b05076ca
3 commits,
8 months ago
version 3
cb72b64c
2 commits,
8 months ago
version 2
b6892647
3 commits,
1 year ago
version 1
c6b25451
1 commit,
1 year ago
Show latest version
1 file
+
17
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
modules/shader_compiler/src/vkcv/shader/SlangCompiler.cpp
+
17
−
3
Options
@@ -80,6 +80,7 @@ namespace vkcv::shader {
const
std
::
filesystem
::
path
&
includePath
)
{
slang
::
SessionDesc
sessionDesc
=
{};
slang
::
TargetDesc
targetDesc
=
{};
SlangSourceLanguage
lang
;
targetDesc
.
format
=
SLANG_SPIRV
;
@@ -87,16 +88,21 @@ namespace vkcv::shader {
case
SlangCompileProfile
::
GLSL
:
targetDesc
.
profile
=
s_GlobalSession
->
findProfile
(
"glsl_460"
);
sessionDesc
.
defaultMatrixLayoutMode
=
SLANG_MATRIX_LAYOUT_COLUMN_MAJOR
;
sessionDesc
.
allowGLSLSyntax
=
true
;
lang
=
SLANG_SOURCE_LANGUAGE_GLSL
;
break
;
case
SlangCompileProfile
::
HLSL
:
targetDesc
.
profile
=
s_GlobalSession
->
findProfile
(
"sm_5_0"
);
sessionDesc
.
defaultMatrixLayoutMode
=
SLANG_MATRIX_LAYOUT_ROW_MAJOR
;
lang
=
SLANG_SOURCE_LANGUAGE_HLSL
;
break
;
case
SlangCompileProfile
::
SPIRV
:
targetDesc
.
profile
=
s_GlobalSession
->
findProfile
(
"spirv_1_5"
);
targetDesc
.
flags
=
SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY
;
lang
=
SLANG_SOURCE_LANGUAGE_SPIRV
;
break
;
default:
lang
=
SLANG_SOURCE_LANGUAGE_UNKNOWN
;
break
;
}
@@ -134,8 +140,11 @@ namespace vkcv::shader {
return
false
;
}
const
int
translationUnit
=
request
->
addTranslationUnit
(
lang
,
nullptr
);
request
->
addTranslationUnitSourceString
(
translationUnit
,
nullptr
,
shaderSource
.
c_str
());
const
int
entryPoint
=
request
->
addEntryPoint
(
0
,
"main"
,
findShaderLanguage
(
shaderStage
)
translationUnit
,
"main"
,
findShaderLanguage
(
shaderStage
)
);
if
(
SLANG_FAILED
(
request
->
compile
()))
{
@@ -146,8 +155,13 @@ namespace vkcv::shader {
size_t
size
;
const
void
*
code
=
request
->
getEntryPointCode
(
entryPoint
,
&
size
);
if
((
size
<=
0
)
||
(
!
code
))
{
vkcv_log
(
LogLevel
::
ERROR
,
"Entry point could not be found"
);
if
(
0
==
size
)
{
code
=
request
->
getCompileRequestCode
(
&
size
);
}
if
((
0
==
size
)
||
(
!
code
))
{
vkcv_log
(
LogLevel
::
ERROR
,
"Entry point could not be found
\n
%s"
,
request
->
getDiagnosticOutput
());
return
false
;
}
Loading