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
302fe97e
Commit
302fe97e
authored
Jul 23, 2019
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge pull request #1792 from Roy-AMD/automapping-opengl-location"
This reverts commit
50ada66c
, reversing changes made to
3464b6f5
.
parent
50ada66c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
64 deletions
+52
-64
ShaderLang.cpp
glslang/MachineIndependent/ShaderLang.cpp
+9
-11
iomapper.cpp
glslang/MachineIndependent/iomapper.cpp
+0
-0
iomapper.h
glslang/MachineIndependent/iomapper.h
+0
-0
ShaderLang.h
glslang/Public/ShaderLang.h
+43
-53
No files found.
glslang/MachineIndependent/ShaderLang.cpp
View file @
302fe97e
...
...
@@ -1852,7 +1852,7 @@ const char* TShader::getInfoDebugLog()
return
infoSink
->
debug
.
c_str
();
}
TProgram
::
TProgram
()
:
reflection
(
0
),
linked
(
false
)
TProgram
::
TProgram
()
:
reflection
(
0
),
ioMapper
(
nullptr
),
linked
(
false
)
{
pool
=
new
TPoolAllocator
;
infoSink
=
new
TInfoSink
;
...
...
@@ -1864,6 +1864,7 @@ TProgram::TProgram() : reflection(0), linked(false)
TProgram
::~
TProgram
()
{
delete
ioMapper
;
delete
infoSink
;
delete
reflection
;
...
...
@@ -2034,24 +2035,21 @@ void TProgram::dumpReflection() { if (reflection != nullptr) reflection->dump();
//
// I/O mapping implementation.
//
bool
TProgram
::
mapIO
(
TIoMapResolver
*
pResolver
,
TIoMapper
*
pIoMapp
er
)
bool
TProgram
::
mapIO
(
TIoMapResolver
*
resolv
er
)
{
if
(
!
linked
)
if
(
!
linked
||
ioMapper
)
return
false
;
TIoMapper
*
ioMapper
=
nullptr
;
TIoMapper
defaultIOMapper
;
if
(
pIoMapper
==
nullptr
)
ioMapper
=
&
defaultIOMapper
;
else
ioMapper
=
pIoMapper
;
ioMapper
=
new
TIoMapper
;
for
(
int
s
=
0
;
s
<
EShLangCount
;
++
s
)
{
if
(
intermediate
[
s
])
{
if
(
!
ioMapper
->
addStage
((
EShLanguage
)
s
,
*
intermediate
[
s
],
*
infoSink
,
pR
esolver
))
if
(
!
ioMapper
->
addStage
((
EShLanguage
)
s
,
*
intermediate
[
s
],
*
infoSink
,
r
esolver
))
return
false
;
}
}
return
ioMapper
->
doMap
(
pResolver
,
*
infoSink
)
;
return
true
;
}
}
// end namespace glslang
glslang/MachineIndependent/iomapper.cpp
View file @
302fe97e
This diff is collapsed.
Click to expand it.
glslang/MachineIndependent/iomapper.h
View file @
302fe97e
This diff is collapsed.
Click to expand it.
glslang/Public/ShaderLang.h
View file @
302fe97e
...
...
@@ -646,9 +646,8 @@ protected:
const
TType
*
type
;
};
class
TReflection
;
class
TIoMapper
;
struct
TVarEntryInfo
;
class
TReflection
;
class
TIoMapper
;
// Allows to customize the binding layout after linking.
// All used uniform variables will invoke at least validateBinding.
...
...
@@ -669,61 +668,51 @@ struct TVarEntryInfo;
// notifiy callbacks, this phase ends with a call to endNotifications.
// Phase two starts directly after the call to endNotifications
// and calls all other callbacks to validate and to get the
// bindings, sets, locations, component and color indices.
// bindings, sets, locations, component and color indices.
//
// NOTE: that still limit checks are applied to bindings and sets
// and may result in an error.
class
TIoMapResolver
{
public
:
virtual
~
TIoMapResolver
()
{}
// Should return true if the resulting/current binding would be okay.
// Basic idea is to do aliasing binding checks with this.
virtual
bool
validateBinding
(
EShLanguage
stage
,
TVarEntryInfo
&
ent
)
=
0
;
// Should return a value >= 0 if the current binding should be overridden.
// Return -1 if the current binding (including no binding) should be kept.
virtual
int
resolveBinding
(
EShLanguage
stage
,
TVarEntryInfo
&
ent
)
=
0
;
// Should return a value >= 0 if the current set should be overridden.
// Return -1 if the current set (including no set) should be kept.
virtual
int
resolveSet
(
EShLanguage
stage
,
TVarEntryInfo
&
ent
)
=
0
;
// Should return a value >= 0 if the current location should be overridden.
// Return -1 if the current location (including no location) should be kept.
virtual
int
resolveUniformLocation
(
EShLanguage
stage
,
TVarEntryInfo
&
ent
)
=
0
;
// Should return true if the resulting/current setup would be okay.
// Basic idea is to do aliasing checks and reject invalid semantic names.
virtual
bool
validateInOut
(
EShLanguage
stage
,
TVarEntryInfo
&
ent
)
=
0
;
// Should return a value >= 0 if the current location should be overridden.
// Return -1 if the current location (including no location) should be kept.
virtual
int
resolveInOutLocation
(
EShLanguage
stage
,
TVarEntryInfo
&
ent
)
=
0
;
// Should return a value >= 0 if the current component index should be overridden.
// Return -1 if the current component index (including no index) should be kept.
virtual
int
resolveInOutComponent
(
EShLanguage
stage
,
TVarEntryInfo
&
ent
)
=
0
;
// Should return a value >= 0 if the current color index should be overridden.
// Return -1 if the current color index (including no index) should be kept.
virtual
int
resolveInOutIndex
(
EShLanguage
stage
,
TVarEntryInfo
&
ent
)
=
0
;
// Notification of a uniform variable
virtual
void
notifyBinding
(
EShLanguage
stage
,
TVarEntryInfo
&
ent
)
=
0
;
// Notification of a in or out variable
virtual
void
notifyInOut
(
EShLanguage
stage
,
TVarEntryInfo
&
ent
)
=
0
;
// Called by mapIO when it starts its notify pass for the given stage
virtual
void
beginNotifications
(
EShLanguage
stage
)
=
0
;
// Called by mapIO when it has finished the notify pass
virtual
void
endNotifications
(
EShLanguage
stage
)
=
0
;
// Called by mipIO when it starts its resolve pass for the given stage
virtual
void
beginResolve
(
EShLanguage
stage
)
=
0
;
// Called by mapIO when it has finished the resolve pass
virtual
void
endResolve
(
EShLanguage
stage
)
=
0
;
// Called by mapIO when it starts its symbol collect for teh given stage
virtual
void
beginCollect
(
EShLanguage
stage
)
=
0
;
// Called by mapIO when it has finished the symbol collect
virtual
void
endCollect
(
EShLanguage
stage
)
=
0
;
// Called by TSlotCollector to resolve storage locations or bindings
virtual
void
reserverStorageSlot
(
TVarEntryInfo
&
ent
,
TInfoSink
&
infoSink
)
=
0
;
// Called by TSlotCollector to resolve resource locations or bindings
virtual
void
reserverResourceSlot
(
TVarEntryInfo
&
ent
,
TInfoSink
&
infoSink
)
=
0
;
// Called by mapIO.addStage to set shader stage mask to mark a stage be added to this pipeline
virtual
void
addStage
(
EShLanguage
stage
)
=
0
;
virtual
~
TIoMapResolver
()
{}
// Should return true if the resulting/current binding would be okay.
// Basic idea is to do aliasing binding checks with this.
virtual
bool
validateBinding
(
EShLanguage
stage
,
const
char
*
name
,
const
TType
&
type
,
bool
is_live
)
=
0
;
// Should return a value >= 0 if the current binding should be overridden.
// Return -1 if the current binding (including no binding) should be kept.
virtual
int
resolveBinding
(
EShLanguage
stage
,
const
char
*
name
,
const
TType
&
type
,
bool
is_live
)
=
0
;
// Should return a value >= 0 if the current set should be overridden.
// 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 a value >= 0 if the current location should be overridden.
// Return -1 if the current location (including no location) should be kept.
virtual
int
resolveUniformLocation
(
EShLanguage
stage
,
const
char
*
name
,
const
TType
&
type
,
bool
is_live
)
=
0
;
// Should return true if the resulting/current setup would be okay.
// 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 overridden.
// 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 overridden.
// 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 overridden.
// 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
;
// Notification of a uniform variable
virtual
void
notifyBinding
(
EShLanguage
stage
,
const
char
*
name
,
const
TType
&
type
,
bool
is_live
)
=
0
;
// Notification of a in or out variable
virtual
void
notifyInOut
(
EShLanguage
stage
,
const
char
*
name
,
const
TType
&
type
,
bool
is_live
)
=
0
;
// Called by mapIO when it has finished the notify pass
virtual
void
endNotifications
(
EShLanguage
stage
)
=
0
;
// Called by mapIO when it starts its notify pass for the given stage
virtual
void
beginNotifications
(
EShLanguage
stage
)
=
0
;
// Called by mipIO when it starts its resolve pass for the given stage
virtual
void
beginResolve
(
EShLanguage
stage
)
=
0
;
// Called by mapIO when it has finished the resolve pass
virtual
void
endResolve
(
EShLanguage
stage
)
=
0
;
};
// Make one TProgram per set of shaders that will get linked together. Add all
...
...
@@ -835,7 +824,7 @@ public:
// I/O mapping: apply base offsets and map live unbound variables
// If resolver is not provided it uses the previous approach
// and respects auto assignment and offsets.
bool
mapIO
(
TIoMapResolver
*
pResolver
=
nullptr
,
TIoMapper
*
pIoMapper
=
nullptr
);
bool
mapIO
(
TIoMapResolver
*
resolver
=
NULL
);
protected
:
bool
linkStage
(
EShLanguage
,
EShMessages
);
...
...
@@ -846,6 +835,7 @@ protected:
bool
newedIntermediate
[
EShLangCount
];
// track which intermediate were "new" versus reusing a singleton unit in a stage
TInfoSink
*
infoSink
;
TReflection
*
reflection
;
TIoMapper
*
ioMapper
;
bool
linked
;
private
:
...
...
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