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
98f164ec
Commit
98f164ec
authored
Aug 23, 2016
by
John Kessenich
Committed by
GitHub
Aug 23, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #461 from dankbaker/Error_Message_Fixes_for_HLSL
HLSL: Better error message for when HLSL translation fails
parents
6577a0e2
afe6e9c4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
StandAlone.cpp
StandAlone/StandAlone.cpp
+20
-1
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+6
-3
No files found.
StandAlone/StandAlone.cpp
View file @
98f164ec
...
...
@@ -413,6 +413,25 @@ struct ShaderCompUnit {
EShLanguage
stage
;
std
::
string
fileName
;
char
**
text
;
// memory owned/managed externally
const
char
*
fileNameList
[
1
];
//Need to have a special constructors to adjust the fileNameList, since back end needs a list of ptrs
ShaderCompUnit
(
EShLanguage
istage
,
std
::
string
&
ifileName
,
char
**
itext
)
{
stage
=
istage
;
fileName
=
ifileName
;
text
=
itext
;
fileNameList
[
0
]
=
fileName
.
c_str
();
}
ShaderCompUnit
(
const
ShaderCompUnit
&
rhs
)
{
stage
=
rhs
.
stage
;
fileName
=
rhs
.
fileName
;
text
=
rhs
.
text
;
fileNameList
[
0
]
=
fileName
.
c_str
();
}
};
//
...
...
@@ -439,7 +458,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
for
(
auto
it
=
compUnits
.
cbegin
();
it
!=
compUnits
.
cend
();
++
it
)
{
const
auto
&
compUnit
=
*
it
;
glslang
::
TShader
*
shader
=
new
glslang
::
TShader
(
compUnit
.
stage
);
shader
->
setStrings
(
compUnit
.
tex
t
,
1
);
shader
->
setStrings
WithLengthsAndNames
(
compUnit
.
text
,
NULL
,
compUnit
.
fileNameLis
t
,
1
);
if
(
entryPointName
)
// HLSL todo: this needs to be tracked per compUnits
shader
->
setEntryPoint
(
entryPointName
);
shaders
.
push_back
(
shader
);
...
...
hlsl/hlslParseHelper.cpp
View file @
98f164ec
...
...
@@ -116,9 +116,12 @@ bool HlslParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner&
HlslScanContext
scanContext
(
*
this
,
ppContext
);
HlslGrammar
grammar
(
scanContext
,
*
this
);
if
(
!
grammar
.
parse
())
printf
(
"HLSL translation failed.
\n
"
);
if
(
!
grammar
.
parse
())
{
//Print out a nicer error message that should be formated such that if you click on the message it will take you right to the line through most UIs
const
glslang
::
TSourceLoc
&
sourceLoc
=
input
.
getSourceLoc
();
printf
(
"
\n
%s(%i): error at column %i, HLSL translation failed.
\n
"
,
sourceLoc
.
name
,
sourceLoc
.
line
,
sourceLoc
.
column
);
}
return
numErrors
==
0
;
}
...
...
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