Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
640bd096
Commit
640bd096
authored
Aug 09, 2018
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1468: Add command-line --entry-point support, same as existing -e.
parent
56a75975
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
StandAlone.cpp
StandAlone/StandAlone.cpp
+8
-4
runtests
Test/runtests
+1
-1
No files found.
StandAlone/StandAlone.cpp
View file @
640bd096
...
...
@@ -446,6 +446,11 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
Error
(
"--client expects vulkan100 or opengl100"
);
}
bumpArg
();
}
else
if
(
lowerword
==
"entry-point"
)
{
entryPointName
=
argv
[
1
];
if
(
argc
<=
1
)
Error
(
"no <name> provided for --entry-point"
);
bumpArg
();
}
else
if
(
lowerword
==
"flatten-uniform-arrays"
||
// synonyms
lowerword
==
"flatten-uniform-array"
||
lowerword
==
"fua"
)
{
...
...
@@ -610,8 +615,6 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
Options
|=
EOptionDefaultDesktop
;
break
;
case
'e'
:
// HLSL todo: entry point handle needs much more sophistication.
// This is okay for one compilation unit with one entry point.
entryPointName
=
argv
[
1
];
if
(
argc
<=
1
)
Error
(
"no <name> provided for -e"
);
...
...
@@ -840,7 +843,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
const
auto
&
compUnit
=
*
it
;
glslang
::
TShader
*
shader
=
new
glslang
::
TShader
(
compUnit
.
stage
);
shader
->
setStringsWithLengthsAndNames
(
compUnit
.
text
,
NULL
,
compUnit
.
fileNameList
,
compUnit
.
count
);
if
(
entryPointName
)
// HLSL todo: this needs to be tracked per compUnits
if
(
entryPointName
)
shader
->
setEntryPoint
(
entryPointName
);
if
(
sourceEntryPointName
)
{
if
(
entryPointName
==
nullptr
)
...
...
@@ -1352,7 +1355,8 @@ void usage()
" creates the default configuration file (redirect to a .conf file)
\n
"
" -d default to desktop (#version 110) when there is no shader #version
\n
"
" (default is ES version 100)
\n
"
" -e <name> specify <name> as the entry-point name
\n
"
" --entry-point <name>
\n
"
" -e <name> specify <name> as the entry-point function name
\n
"
" -f{hlsl_functionality1}
\n
"
" 'hlsl_functionality1' enables use of the
\n
"
" SPV_GOOGLE_hlsl_functionality1 extension
\n
"
...
...
Test/runtests
View file @
640bd096
...
...
@@ -56,7 +56,7 @@ fi
# entry point renaming tests
#
echo
Running entry-point renaming tests
$EXE
-i
-H
-V
-D
-Od
-
e
main_in_spv
--ku
--source-entrypoint
main
-Od
hlsl.entry.rename.frag
>
$TARGETDIR
/hlsl.entry.rename.frag.out
$EXE
-i
-H
-V
-D
-Od
-
-entry-point
main_in_spv
--ku
--source-entrypoint
main
-Od
hlsl.entry.rename.frag
>
$TARGETDIR
/hlsl.entry.rename.frag.out
diff
-b
$BASEDIR
/hlsl.entry.rename.frag.out
$TARGETDIR
/hlsl.entry.rename.frag.out
||
HASERROR
=
1
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment