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
8bb3ee53
Commit
8bb3ee53
authored
Jan 04, 2017
by
t.jung
Committed by
Tiemo Jung
Feb 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added semantic handling and support for remapping variables with semantics
Change-Id: I3c6b5fc1d4f1da6ec6f436fea72849453a13559d
parent
7225a1cb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
182 additions
and
35 deletions
+182
-35
Types.h
glslang/Include/Types.h
+9
-0
iomapper.cpp
glslang/MachineIndependent/iomapper.cpp
+148
-31
localintermediate.h
glslang/MachineIndependent/localintermediate.h
+6
-0
ShaderLang.h
glslang/Public/ShaderLang.h
+18
-4
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+1
-0
No files found.
glslang/Include/Types.h
View file @
8bb3ee53
...
...
@@ -392,6 +392,7 @@ public:
void
clear
()
{
semanticName
=
nullptr
;
precision
=
EpqNone
;
invariant
=
false
;
noContraction
=
false
;
...
...
@@ -401,6 +402,7 @@ public:
// drop qualifiers that don't belong in a temporary variable
void
makeTemporary
()
{
semanticName
=
nullptr
;
storage
=
EvqTemporary
;
builtIn
=
EbvNone
;
clearInterstage
();
...
...
@@ -445,10 +447,17 @@ public:
// If A, then nothing should change, if B, then everything should change, but this is half way.
void
makePartialTemporary
()
{
semanticName
=
nullptr
;
storage
=
EvqTemporary
;
specConstant
=
false
;
}
bool
hasSemantic
()
const
{
return
semanticName
!=
nullptr
;
}
const
char
*
semanticName
;
TStorageQualifier
storage
:
6
;
TBuiltInVariable
builtIn
:
8
;
TPrecisionQualifier
precision
:
3
;
...
...
glslang/MachineIndependent/iomapper.cpp
View file @
8bb3ee53
This diff is collapsed.
Click to expand it.
glslang/MachineIndependent/localintermediate.h
View file @
8bb3ee53
...
...
@@ -420,6 +420,11 @@ public:
bool
getGeoPassthroughEXT
()
const
{
return
geoPassthroughEXT
;
}
#endif
const
char
*
addSemanticName
(
const
TString
&
name
)
{
return
semanticNameSet
.
insert
(
name
).
first
->
c_str
();
}
protected
:
TIntermSymbol
*
addSymbol
(
int
Id
,
const
TString
&
,
const
TType
&
,
const
TConstUnionArray
&
,
TIntermTyped
*
subtree
,
const
TSourceLoc
&
);
void
error
(
TInfoSink
&
infoSink
,
const
char
*
);
...
...
@@ -497,6 +502,7 @@ protected:
std
::
vector
<
TOffsetRange
>
usedAtomics
;
// sets of bindings used by atomic counters
std
::
vector
<
TXfbBuffer
>
xfbBuffers
;
// all the data we need to track per xfb buffer
std
::
unordered_set
<
int
>
usedConstantId
;
// specialization constant ids used
std
::
set
<
TString
>
semanticNameSet
;
private
:
void
operator
=
(
TIntermediate
&
);
// prevent assignments
...
...
glslang/Public/ShaderLang.h
View file @
8bb3ee53
...
...
@@ -459,10 +459,12 @@ class TIoMapper;
// and resolveSet are invoked to resolve the binding and descriptor
// set index respectively.
// Invocations happen in a particular order:
// 1) var with binding and set already defined
// 2) var with binding but no set defined
// 3) var with set but no binding defined
// 4) var with no binding and no set defined
// 1) all shader inputs
// 2) all shader outputs
// 3) all uniforms with binding and set already defined
// 4) all uniforms with binding but no set defined
// 5) all uniforms with set but no binding defined
// 6) all uniforms with no binding and no set defined
//
// NOTE: that still limit checks are applied to bindings and sets
// and may result in an error.
...
...
@@ -480,6 +482,18 @@ public:
// Should return a value >= 0 if the current set should be overriden.
// Return -1 if the current set (including no set) should be kept.
virtual
int
resolveSet
(
EShLanguage
stage
,
const
char
*
name
,
const
TType
&
type
,
bool
is_live
)
=
0
;
// Should return true if the resuling/current setup would be ok.
// Basic idea is to do aliasing checks and reject invalid semantic names.
virtual
bool
validateInOut
(
EShLanguage
stage
,
const
char
*
name
,
const
TType
&
type
,
bool
is_live
)
=
0
;
// Should return a value >= 0 if the current location should be overriden.
// Return -1 if the current location (including no location) should be kept.
virtual
int
resolveInOutLocation
(
EShLanguage
stage
,
const
char
*
name
,
const
TType
&
type
,
bool
is_live
)
=
0
;
// Should return a value >= 0 if the current component index should be overriden.
// Return -1 if the current component index (including no index) should be kept.
virtual
int
resolveInOutComponent
(
EShLanguage
stage
,
const
char
*
name
,
const
TType
&
type
,
bool
is_live
)
=
0
;
// Should return a value >= 0 if the current color index should be overriden.
// Return -1 if the current color index (including no index) should be kept.
virtual
int
resolveInOutIndex
(
EShLanguage
stage
,
const
char
*
name
,
const
TType
&
type
,
bool
is_live
)
=
0
;
};
// Make one TProgram per set of shaders that will get linked together. Add all
...
...
hlsl/hlslParseHelper.cpp
View file @
8bb3ee53
...
...
@@ -3808,6 +3808,7 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con
// 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
qualifier
.
semanticName
=
intermediate
.
addSemanticName
(
semanticUpperCase
);
bool
bParseDX9
=
false
;
if
(
bParseDX9
)
{
...
...
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