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
26aa8a4b
Commit
26aa8a4b
authored
Aug 25, 2016
by
Dan Baker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Format updates and some minor adjustments to SV_ handling
parent
deec03cf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+12
-15
No files found.
hlsl/hlslParseHelper.cpp
View file @
26aa8a4b
...
...
@@ -756,18 +756,14 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l
if
(
inEntrypoint
)
{
// parameters are actually shader-level inputs
unsigned
int
inCount
=
0
,
outCount
=
0
;
for
(
int
i
=
0
;
i
<
function
.
getParamCount
();
i
++
)
{
for
(
int
i
=
0
;
i
<
function
.
getParamCount
();
i
++
)
{
// Fragment programs do not use ordering for the output layout position, rather it is
// embedded in the semantic
if
(
function
[
i
].
type
->
getQualifier
().
isParamOutput
()
&&
language
!=
EShLangFragment
)
{
if
(
function
[
i
].
type
->
getQualifier
().
builtIn
==
EbvNone
)
if
(
function
[
i
].
type
->
getQualifier
().
isParamOutput
()
)
{
if
(
function
[
i
].
type
->
getQualifier
().
builtIn
==
EbvNone
&&
language
!=
EShLangFragment
)
function
[
i
].
type
->
getQualifier
().
layoutLocation
=
outCount
++
;
function
[
i
].
type
->
getQualifier
().
storage
=
EvqVaryingOut
;
}
else
{
}
else
{
if
(
function
[
i
].
type
->
getQualifier
().
builtIn
==
EbvNone
)
function
[
i
].
type
->
getQualifier
().
layoutLocation
=
inCount
++
;
function
[
i
].
type
->
getQualifier
().
storage
=
EvqVaryingIn
;
...
...
@@ -2277,6 +2273,8 @@ void HlslParseContext::handleSemantic(TType& type, const TString& semantic)
// The following sketches what needs to be done, but can't be right
// without taking into account stage and input/output.
TString
semanticUpperCase
=
semantic
;
std
::
transform
(
semanticUpperCase
.
begin
(),
semanticUpperCase
.
end
(),
semanticUpperCase
.
begin
(),
::
toupper
);
// in DX9, all outputs had to have a semantic associated with them, that was either consumed
// by the system or was a specific register assignment
// in DX10+, only semantics with the SV_ prefix have any meaning beyond decoration
...
...
@@ -2284,24 +2282,23 @@ void HlslParseContext::handleSemantic(TType& type, const TString& semantic)
// Also, in DX10 if a SV value is present as the input of a stage, but isn't appropriate for that
// stage, it would just be ignored as it is likely there as part of an output struct from one stage
// to the next
bool
bParseDX9
=
false
;
bool
bParseDX9
=
false
;
if
(
bParseDX9
)
{
if
(
semantic
==
"PSIZE"
)
if
(
semantic
UpperCase
==
"PSIZE"
)
type
.
getQualifier
().
builtIn
=
EbvPointSize
;
else
if
(
semantic
==
"FOG"
)
type
.
getQualifier
().
builtIn
=
EbvFogFragCoord
;
else
if
(
semantic
==
"DEPTH"
||
semantic
==
"SV_Depth
"
)
else
if
(
semantic
UpperCase
==
"DEPTH
"
)
type
.
getQualifier
().
builtIn
=
EbvFragDepth
;
else
if
(
semantic
==
"VFACE"
||
semantic
==
"SV_IsFrontFace
"
)
else
if
(
semantic
UpperCase
==
"VFACE
"
)
type
.
getQualifier
().
builtIn
=
EbvFace
;
else
if
(
semantic
==
"VPOS"
||
semantic
==
"SV_Position
"
)
else
if
(
semantic
UpperCase
==
"VPOS
"
)
type
.
getQualifier
().
builtIn
=
EbvFragCoord
;
}
TString
semanticUpperCase
=
semantic
;
std
::
transform
(
semanticUpperCase
.
begin
(),
semanticUpperCase
.
end
(),
semanticUpperCase
.
begin
(),
::
toupper
);
{
//SV Position has a different meaning in vertex vs fragment
if
(
semanticUpperCase
==
"SV_POSITION"
&&
language
!=
EShLangFragment
)
...
...
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