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
e5c394bc
Commit
e5c394bc
authored
Jul 02, 2019
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Standalone: Fix #1814: Check that linkage was specified for reflection.
parent
974a5866
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
StandAlone.cpp
StandAlone/StandAlone.cpp
+12
-3
ShaderLang.cpp
glslang/MachineIndependent/ShaderLang.cpp
+4
-6
ShaderLang.h
glslang/Public/ShaderLang.h
+1
-1
No files found.
StandAlone/StandAlone.cpp
View file @
e5c394bc
...
@@ -772,8 +772,17 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
...
@@ -772,8 +772,17 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
Error
(
"must provide -S when --stdin is given"
);
Error
(
"must provide -S when --stdin is given"
);
// Make sure that -E is not specified alongside linking (which includes SPV generation)
// Make sure that -E is not specified alongside linking (which includes SPV generation)
if
((
Options
&
EOptionOutputPreprocessed
)
&&
(
Options
&
EOptionLinkProgram
))
// Or things that require linking
Error
(
"can't use -E when linking is selected"
);
if
(
Options
&
EOptionOutputPreprocessed
)
{
if
(
Options
&
EOptionLinkProgram
)
Error
(
"can't use -E when linking is selected"
);
if
(
Options
&
EOptionDumpReflection
)
Error
(
"reflection requires linking, which can't be used when -E when is selected"
);
}
// reflection requires linking
if
((
Options
&
EOptionDumpReflection
)
&&
!
(
Options
&
EOptionLinkProgram
))
Error
(
"reflection requires -l for linking"
);
// -o or -x makes no sense if there is no target binary
// -o or -x makes no sense if there is no target binary
if
(
binaryFileName
&&
(
Options
&
EOptionSpv
)
==
0
)
if
(
binaryFileName
&&
(
Options
&
EOptionSpv
)
==
0
)
...
@@ -1512,7 +1521,7 @@ void usage()
...
@@ -1512,7 +1521,7 @@ void usage()
" -l link all input files together to form a single module
\n
"
" -l link all input files together to form a single module
\n
"
" -m memory leak mode
\n
"
" -m memory leak mode
\n
"
" -o <file> save binary to <file>, requires a binary option (e.g., -V)
\n
"
" -o <file> save binary to <file>, requires a binary option (e.g., -V)
\n
"
" -q dump reflection query database
\n
"
" -q dump reflection query database
; requires -l for linking
\n
"
" -r | --relaxed-errors"
" -r | --relaxed-errors"
" relaxed GLSL semantic error-checking mode
\n
"
" relaxed GLSL semantic error-checking mode
\n
"
" -s silence syntax and semantic error reporting
\n
"
" -s silence syntax and semantic error reporting
\n
"
...
...
glslang/MachineIndependent/ShaderLang.cpp
View file @
e5c394bc
...
@@ -1984,7 +1984,7 @@ const char* TProgram::getInfoDebugLog()
...
@@ -1984,7 +1984,7 @@ const char* TProgram::getInfoDebugLog()
bool
TProgram
::
buildReflection
(
int
opts
)
bool
TProgram
::
buildReflection
(
int
opts
)
{
{
if
(
!
linked
||
reflection
)
if
(
!
linked
||
reflection
!=
nullptr
)
return
false
;
return
false
;
int
firstStage
=
EShLangVertex
,
lastStage
=
EShLangFragment
;
int
firstStage
=
EShLangVertex
,
lastStage
=
EShLangFragment
;
...
@@ -2014,9 +2014,8 @@ bool TProgram::buildReflection(int opts)
...
@@ -2014,9 +2014,8 @@ bool TProgram::buildReflection(int opts)
return
true
;
return
true
;
}
}
unsigned
TProgram
::
getLocalSize
(
int
dim
)
const
{
return
reflection
->
getLocalSize
(
dim
);
}
unsigned
TProgram
::
getLocalSize
(
int
dim
)
const
{
return
reflection
->
getLocalSize
(
dim
);
}
int
TProgram
::
getReflectionIndex
(
const
char
*
name
)
const
{
return
reflection
->
getIndex
(
name
);
}
int
TProgram
::
getReflectionIndex
(
const
char
*
name
)
const
{
return
reflection
->
getIndex
(
name
);
}
int
TProgram
::
getNumUniformVariables
()
const
{
return
reflection
->
getNumUniforms
();
}
int
TProgram
::
getNumUniformVariables
()
const
{
return
reflection
->
getNumUniforms
();
}
const
TObjectReflection
&
TProgram
::
getUniform
(
int
index
)
const
{
return
reflection
->
getUniform
(
index
);
}
const
TObjectReflection
&
TProgram
::
getUniform
(
int
index
)
const
{
return
reflection
->
getUniform
(
index
);
}
int
TProgram
::
getNumUniformBlocks
()
const
{
return
reflection
->
getNumUniformBlocks
();
}
int
TProgram
::
getNumUniformBlocks
()
const
{
return
reflection
->
getNumUniformBlocks
();
}
...
@@ -2031,8 +2030,7 @@ int TProgram::getNumBufferBlocks() const { return r
...
@@ -2031,8 +2030,7 @@ int TProgram::getNumBufferBlocks() const { return r
const
TObjectReflection
&
TProgram
::
getBufferBlock
(
int
index
)
const
{
return
reflection
->
getStorageBufferBlock
(
index
);
}
const
TObjectReflection
&
TProgram
::
getBufferBlock
(
int
index
)
const
{
return
reflection
->
getStorageBufferBlock
(
index
);
}
int
TProgram
::
getNumAtomicCounters
()
const
{
return
reflection
->
getNumAtomicCounters
();
}
int
TProgram
::
getNumAtomicCounters
()
const
{
return
reflection
->
getNumAtomicCounters
();
}
const
TObjectReflection
&
TProgram
::
getAtomicCounter
(
int
index
)
const
{
return
reflection
->
getAtomicCounter
(
index
);
}
const
TObjectReflection
&
TProgram
::
getAtomicCounter
(
int
index
)
const
{
return
reflection
->
getAtomicCounter
(
index
);
}
void
TProgram
::
dumpReflection
()
{
if
(
reflection
!=
nullptr
)
reflection
->
dump
();
}
void
TProgram
::
dumpReflection
()
{
reflection
->
dump
();
}
//
//
// I/O mapping implementation.
// I/O mapping implementation.
...
...
glslang/Public/ShaderLang.h
View file @
e5c394bc
...
@@ -737,7 +737,7 @@ public:
...
@@ -737,7 +737,7 @@ public:
// Reflection Interface
// Reflection Interface
// 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
);
bool
buildReflection
(
int
opts
=
EShReflectionDefault
);
unsigned
getLocalSize
(
int
dim
)
const
;
// return dim'th local size
unsigned
getLocalSize
(
int
dim
)
const
;
// return dim'th local size
int
getReflectionIndex
(
const
char
*
name
)
const
;
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