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
6d477858
Commit
6d477858
authored
Jan 29, 2019
by
baldurk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add options to control how reflection information is built
parent
1dc5dcf0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
StandAlone.cpp
StandAlone/StandAlone.cpp
+2
-1
ShaderLang.cpp
glslang/MachineIndependent/ShaderLang.cpp
+2
-2
reflection.h
glslang/MachineIndependent/reflection.h
+3
-1
ShaderLang.h
glslang/Public/ShaderLang.h
+10
-1
No files found.
StandAlone/StandAlone.cpp
View file @
6d477858
...
...
@@ -152,6 +152,7 @@ void ProcessConfigFile()
}
}
int
ReflectOptions
=
EShReflectionDefault
;
int
Options
=
0
;
const
char
*
ExecutableName
=
nullptr
;
const
char
*
binaryFileName
=
nullptr
;
...
...
@@ -1051,7 +1052,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
// Reflect
if
(
Options
&
EOptionDumpReflection
)
{
program
.
buildReflection
();
program
.
buildReflection
(
ReflectOptions
);
program
.
dumpReflection
();
}
...
...
glslang/MachineIndependent/ShaderLang.cpp
View file @
6d477858
...
...
@@ -1966,12 +1966,12 @@ const char* TProgram::getInfoDebugLog()
// Reflection implementation.
//
bool
TProgram
::
buildReflection
()
bool
TProgram
::
buildReflection
(
int
opts
)
{
if
(
!
linked
||
reflection
)
return
false
;
reflection
=
new
TReflection
;
reflection
=
new
TReflection
((
EShReflectionOptions
)
opts
)
;
for
(
int
s
=
0
;
s
<
EShLangCount
;
++
s
)
{
if
(
intermediate
[
s
])
{
...
...
glslang/MachineIndependent/reflection.h
View file @
6d477858
...
...
@@ -55,7 +55,7 @@ class TReflectionTraverser;
// The full reflection database
class
TReflection
{
public
:
TReflection
(
)
:
badReflection
(
TObjectReflection
::
badReflection
())
TReflection
(
EShReflectionOptions
opts
)
:
options
(
opts
),
badReflection
(
TObjectReflection
::
badReflection
())
{
for
(
int
dim
=
0
;
dim
<
3
;
++
dim
)
localSize
[
dim
]
=
0
;
...
...
@@ -125,6 +125,8 @@ protected:
typedef
std
::
map
<
std
::
string
,
int
>
TNameToIndex
;
typedef
std
::
vector
<
TObjectReflection
>
TMapIndexToReflection
;
EShReflectionOptions
options
;
TObjectReflection
badReflection
;
// return for queries of -1 or generally out of range; has expected descriptions with in it for this
TNameToIndex
nameToIndex
;
// maps names to indexes; can hold all types of data: uniform/buffer and which function names have been processed
TMapIndexToReflection
indexToUniform
;
...
...
glslang/Public/ShaderLang.h
View file @
6d477858
...
...
@@ -240,6 +240,13 @@ enum EShMessages {
};
//
// Options for building reflection
//
typedef
enum
{
EShReflectionDefault
=
0
,
// default is original behaviour before options were added
}
EShReflectionOptions
;
//
// Build a table for bindings. This can be used for locating
// attributes, uniforms, globals, etc., as needed.
//
...
...
@@ -717,7 +724,9 @@ public:
TIntermediate
*
getIntermediate
(
EShLanguage
stage
)
const
{
return
intermediate
[
stage
];
}
// Reflection Interface
bool
buildReflection
();
// call first, to do liveness analysis, index mapping, etc.; returns false on failure
// call first, to do liveness analysis, index mapping, etc.; returns false on failure
bool
buildReflection
(
int
opts
=
EShReflectionDefault
);
unsigned
getLocalSize
(
int
dim
)
const
;
// return dim'th local size
int
getReflectionIndex
(
const
char
*
name
)
const
;
...
...
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