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
5743eed4
Unverified
Commit
5743eed4
authored
Aug 03, 2020
by
John Kessenich
Committed by
GitHub
Aug 03, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2362 from ShabbyX/optimize_for_angle
Use GLSLANG_ANGLE to strip features to what ANGLE requires
parents
928b7b26
1ef2e250
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
96 additions
and
50 deletions
+96
-50
BUILD.gn
BUILD.gn
+6
-1
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+3
-1
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+0
-0
ShaderLang.cpp
glslang/MachineIndependent/ShaderLang.cpp
+29
-14
SymbolTable.cpp
glslang/MachineIndependent/SymbolTable.cpp
+1
-1
SymbolTable.h
glslang/MachineIndependent/SymbolTable.h
+6
-6
intermOut.cpp
glslang/MachineIndependent/intermOut.cpp
+2
-2
iomapper.cpp
glslang/MachineIndependent/iomapper.cpp
+2
-2
iomapper.h
glslang/MachineIndependent/iomapper.h
+3
-3
linkValidate.cpp
glslang/MachineIndependent/linkValidate.cpp
+3
-3
localintermediate.h
glslang/MachineIndependent/localintermediate.h
+22
-3
parseVersions.h
glslang/MachineIndependent/parseVersions.h
+6
-1
reflection.cpp
glslang/MachineIndependent/reflection.cpp
+2
-2
reflection.h
glslang/MachineIndependent/reflection.h
+2
-2
ShaderLang.h
glslang/Public/ShaderLang.h
+5
-5
Link.FromFile.Vk.cpp
gtests/Link.FromFile.Vk.cpp
+1
-1
TestFixture.h
gtests/TestFixture.h
+3
-3
No files found.
BUILD.gn
View file @
5743eed4
...
...
@@ -109,7 +109,6 @@ template("glslang_sources_common") {
"SPIRV/SpvBuilder.cpp",
"SPIRV/SpvBuilder.h",
"SPIRV/SpvPostProcess.cpp",
"SPIRV/SpvTools.cpp",
"SPIRV/SpvTools.h",
"SPIRV/bitutils.h",
"SPIRV/disassemble.cpp",
...
...
@@ -208,8 +207,12 @@ template("glslang_sources_common") {
defines = []
if (invoker.enable_opt) {
sources += [ "SPIRV/SpvTools.cpp" ]
defines += [ "ENABLE_OPT=1" ]
}
if (invoker.is_angle) {
defines += [ "GLSLANG_ANGLE" ]
}
if (is_win) {
sources += [ "glslang/OSDependent/Windows/ossource.cpp" ]
...
...
@@ -257,11 +260,13 @@ template("glslang_sources_common") {
glslang_sources_common("glslang_lib_sources") {
enable_opt = !glslang_angle
enable_hlsl = !glslang_angle
is_angle = glslang_angle
}
glslang_sources_common("glslang_sources") {
enable_opt = true
enable_hlsl = true
is_angle = false
}
source_set("glslang_default_resource_limits_sources") {
...
...
SPIRV/GlslangToSpv.cpp
View file @
5743eed4
...
...
@@ -283,6 +283,8 @@ spv::SourceLanguage TranslateSourceLanguage(glslang::EShSource source, EProfile
{
#ifdef GLSLANG_WEB
return
spv
::
SourceLanguageESSL
;
#elif defined(GLSLANG_ANGLE)
return
spv
::
SourceLanguageGLSL
;
#endif
switch
(
source
)
{
...
...
@@ -8694,7 +8696,7 @@ void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName)
// Write SPIR-V out to a text file with 32-bit hexadecimal words
void
OutputSpvHex
(
const
std
::
vector
<
unsigned
int
>&
spirv
,
const
char
*
baseName
,
const
char
*
varName
)
{
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
std
::
ofstream
out
;
out
.
open
(
baseName
,
std
::
ios
::
binary
|
std
::
ios
::
out
);
if
(
out
.
fail
())
...
...
glslang/MachineIndependent/Initialize.cpp
View file @
5743eed4
This diff is collapsed.
Click to expand it.
glslang/MachineIndependent/ShaderLang.cpp
View file @
5743eed4
...
...
@@ -294,6 +294,9 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
#ifdef GLSLANG_WEB
profile
=
EEsProfile
;
version
=
310
;
#elif defined(GLSLANG_ANGLE)
profile
=
ECoreProfile
;
version
=
450
;
#endif
(
*
symbolTables
[
language
]).
adoptLevels
(
*
commonTable
[
CommonIndex
(
profile
,
language
)]);
...
...
@@ -315,6 +318,9 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
#ifdef GLSLANG_WEB
profile
=
EEsProfile
;
version
=
310
;
#elif defined(GLSLANG_ANGLE)
profile
=
ECoreProfile
;
version
=
450
;
#endif
std
::
unique_ptr
<
TBuiltInParseables
>
builtInParseables
(
CreateBuiltInParseables
(
infoSink
,
source
));
...
...
@@ -354,7 +360,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
(
profile
==
EEsProfile
&&
version
>=
310
))
InitializeStageSymbolTable
(
*
builtInParseables
,
version
,
profile
,
spvVersion
,
EShLangGeometry
,
source
,
infoSink
,
commonTable
,
symbolTables
);
#endif
// check for compute
if
((
profile
!=
EEsProfile
&&
version
>=
420
)
||
...
...
@@ -362,6 +367,7 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
InitializeStageSymbolTable
(
*
builtInParseables
,
version
,
profile
,
spvVersion
,
EShLangCompute
,
source
,
infoSink
,
commonTable
,
symbolTables
);
#ifndef GLSLANG_ANGLE
// check for ray tracing stages
if
(
profile
!=
EEsProfile
&&
version
>=
450
)
{
InitializeStageSymbolTable
(
*
builtInParseables
,
version
,
profile
,
spvVersion
,
EShLangRayGen
,
source
,
...
...
@@ -389,6 +395,8 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
(
profile
==
EEsProfile
&&
version
>=
320
))
InitializeStageSymbolTable
(
*
builtInParseables
,
version
,
profile
,
spvVersion
,
EShLangTaskNV
,
source
,
infoSink
,
commonTable
,
symbolTables
);
#endif // !GLSLANG_ANGLE
#endif // !GLSLANG_WEB
return
true
;
}
...
...
@@ -490,7 +498,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp
// Function to Print all builtins
void
DumpBuiltinSymbolTable
(
TInfoSink
&
infoSink
,
const
TSymbolTable
&
symbolTable
)
{
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
infoSink
.
debug
<<
"BuiltinSymbolTable {
\n
"
;
symbolTable
.
dump
(
infoSink
,
true
);
...
...
@@ -594,7 +602,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
break
;
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
// Correct for stage type...
switch
(
stage
)
{
case
EShLangGeometry
:
...
...
@@ -870,7 +878,7 @@ bool ProcessDeferred(
:
userInput
.
scanVersion
(
version
,
profile
,
versionNotFirstToken
);
bool
versionNotFound
=
version
==
0
;
if
(
forceDefaultVersionAndProfile
&&
source
==
EShSourceGlsl
)
{
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
if
(
!
(
messages
&
EShMsgSuppressWarnings
)
&&
!
versionNotFound
&&
(
version
!=
defaultVersion
||
profile
!=
defaultProfile
))
{
compiler
->
infoSink
.
info
<<
"Warning, (version, profile) forced to be ("
...
...
@@ -893,10 +901,13 @@ bool ProcessDeferred(
#ifdef GLSLANG_WEB
profile
=
EEsProfile
;
version
=
310
;
#elif defined(GLSLANG_ANGLE)
profile
=
ECoreProfile
;
version
=
450
;
#endif
bool
versionWillBeError
=
(
versionNotFound
||
(
profile
==
EEsProfile
&&
version
>=
300
&&
versionNotFirst
));
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
bool
warnVersionNotFirst
=
false
;
if
(
!
versionWillBeError
&&
versionNotFirstToken
)
{
if
(
messages
&
EShMsgRelaxedErrors
)
...
...
@@ -966,7 +977,7 @@ bool ProcessDeferred(
parseContext
->
setLimits
(
*
resources
);
if
(
!
goodVersion
)
parseContext
->
addError
();
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
if
(
warnVersionNotFirst
)
{
TSourceLoc
loc
;
loc
.
init
();
...
...
@@ -1003,7 +1014,7 @@ bool ProcessDeferred(
return
success
;
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
// Responsible for keeping track of the most recent source string and line in
// the preprocessor and outputting newlines appropriately if the source string
...
...
@@ -1226,14 +1237,16 @@ struct DoFullParse{
parseContext
.
infoSink
.
info
<<
parseContext
.
getNumErrors
()
<<
" compilation errors. No code generated.
\n\n
"
;
}
#ifndef GLSLANG_ANGLE
if
(
messages
&
EShMsgAST
)
intermediate
.
output
(
parseContext
.
infoSink
,
true
);
#endif
return
success
;
}
};
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
// Take a single compilation unit, and run the preprocessor on it.
// Return: True if there were no issues found in preprocessing,
// False if during preprocessing any unknown version, pragmas or
...
...
@@ -1873,7 +1886,7 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion
&
environment
);
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
// Fill in a string with the result of preprocessing ShaderStrings
// Returns true if all extensions, pragmas and version strings were valid.
//
...
...
@@ -1911,7 +1924,7 @@ const char* TShader::getInfoDebugLog()
}
TProgram
::
TProgram
()
:
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
reflection
(
0
),
#endif
linked
(
false
)
...
...
@@ -1927,7 +1940,7 @@ TProgram::TProgram() :
TProgram
::~
TProgram
()
{
delete
infoSink
;
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
delete
reflection
;
#endif
...
...
@@ -1974,7 +1987,7 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
if
(
stages
[
stage
].
size
()
==
0
)
return
true
;
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
int
numEsShaders
=
0
,
numNonEsShaders
=
0
;
for
(
auto
it
=
stages
[
stage
].
begin
();
it
!=
stages
[
stage
].
end
();
++
it
)
{
if
((
*
it
)
->
intermediate
->
getProfile
()
==
EEsProfile
)
{
...
...
@@ -2028,8 +2041,10 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
#endif
intermediate
[
stage
]
->
finalCheck
(
*
infoSink
,
(
messages
&
EShMsgKeepUncalled
)
!=
0
);
#ifndef GLSLANG_ANGLE
if
(
messages
&
EShMsgAST
)
intermediate
[
stage
]
->
output
(
*
infoSink
,
true
);
#endif
return
intermediate
[
stage
]
->
getNumErrors
()
==
0
;
}
...
...
@@ -2044,7 +2059,7 @@ const char* TProgram::getInfoDebugLog()
return
infoSink
->
debug
.
c_str
();
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
//
// Reflection implementation.
...
...
@@ -2126,6 +2141,6 @@ bool TProgram::mapIO(TIoMapResolver* pResolver, TIoMapper* pIoMapper)
return
ioMapper
->
doMap
(
pResolver
,
*
infoSink
);
}
#endif //
GLSLANG_WEB
#endif //
!GLSLANG_WEB && !GLSLANG_ANGLE
}
// end namespace glslang
glslang/MachineIndependent/SymbolTable.cpp
View file @
5743eed4
...
...
@@ -178,7 +178,7 @@ void TType::buildMangledName(TString& mangledName) const
}
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
//
// Dump functions.
...
...
glslang/MachineIndependent/SymbolTable.h
View file @
5743eed4
...
...
@@ -117,7 +117,7 @@ public:
virtual
int
getNumExtensions
()
const
{
return
extensions
==
nullptr
?
0
:
(
int
)
extensions
->
size
();
}
virtual
const
char
**
getExtensions
()
const
{
return
extensions
->
data
();
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
virtual
void
dump
(
TInfoSink
&
infoSink
,
bool
complete
=
false
)
const
=
0
;
void
dumpExtensions
(
TInfoSink
&
infoSink
)
const
;
#endif
...
...
@@ -196,7 +196,7 @@ public:
}
virtual
const
char
**
getMemberExtensions
(
int
member
)
const
{
return
(
*
memberExtensions
)[
member
].
data
();
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
virtual
void
dump
(
TInfoSink
&
infoSink
,
bool
complete
=
false
)
const
;
#endif
...
...
@@ -319,7 +319,7 @@ public:
virtual
TParameter
&
operator
[](
int
i
)
{
assert
(
writable
);
return
parameters
[
i
];
}
virtual
const
TParameter
&
operator
[](
int
i
)
const
{
return
parameters
[
i
];
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
virtual
void
dump
(
TInfoSink
&
infoSink
,
bool
complete
=
false
)
const
override
;
#endif
...
...
@@ -381,7 +381,7 @@ public:
virtual
const
char
**
getExtensions
()
const
override
{
return
anonContainer
.
getMemberExtensions
(
memberNumber
);
}
virtual
int
getAnonId
()
const
{
return
anonId
;
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
virtual
void
dump
(
TInfoSink
&
infoSink
,
bool
complete
=
false
)
const
override
;
#endif
...
...
@@ -551,7 +551,7 @@ public:
void
relateToOperator
(
const
char
*
name
,
TOperator
op
);
void
setFunctionExtensions
(
const
char
*
name
,
int
num
,
const
char
*
const
extensions
[]);
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
void
dump
(
TInfoSink
&
infoSink
,
bool
complete
=
false
)
const
;
#endif
TSymbolTableLevel
*
clone
()
const
;
...
...
@@ -854,7 +854,7 @@ public:
}
int
getMaxSymbolId
()
{
return
uniqueId
;
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
void
dump
(
TInfoSink
&
infoSink
,
bool
complete
=
false
)
const
;
#endif
void
copyTable
(
const
TSymbolTable
&
copyOf
);
...
...
glslang/MachineIndependent/intermOut.cpp
View file @
5743eed4
...
...
@@ -36,7 +36,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
#include "localintermediate.h"
#include "../Include/InfoSink.h"
...
...
@@ -1562,4 +1562,4 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
}
// end namespace glslang
#endif //
not GLSLANG_WEB
#endif //
!GLSLANG_WEB && !GLSLANG_ANGLE
glslang/MachineIndependent/iomapper.cpp
View file @
5743eed4
...
...
@@ -33,7 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
#include "../Include/Common.h"
#include "../Include/InfoSink.h"
...
...
@@ -1288,4 +1288,4 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
}
// end namespace glslang
#endif //
GLSLANG_WEB
#endif //
!GLSLANG_WEB && !GLSLANG_ANGLE
glslang/MachineIndependent/iomapper.h
View file @
5743eed4
...
...
@@ -33,7 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
#ifndef _IOMAPPER_INCLUDED
#define _IOMAPPER_INCLUDED
...
...
@@ -186,7 +186,7 @@ protected:
}
};
// Defaul
f
I/O resolver for OpenGL
// Defaul
t
I/O resolver for OpenGL
struct
TDefaultGlslIoResolver
:
public
TDefaultIoResolverBase
{
public
:
typedef
std
::
map
<
TString
,
int
>
TVarSlotMap
;
// <resourceName, location/binding>
...
...
@@ -299,4 +299,4 @@ public:
#endif // _IOMAPPER_INCLUDED
#endif //
GLSLANG_WEB
#endif //
!GLSLANG_WEB && !GLSLANG_ANGLE
glslang/MachineIndependent/linkValidate.cpp
View file @
5743eed4
...
...
@@ -82,7 +82,7 @@ void TIntermediate::warn(TInfoSink& infoSink, const char* message)
//
void
TIntermediate
::
merge
(
TInfoSink
&
infoSink
,
TIntermediate
&
unit
)
{
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
mergeCallGraphs
(
infoSink
,
unit
);
mergeModes
(
infoSink
,
unit
);
mergeTrees
(
infoSink
,
unit
);
...
...
@@ -104,7 +104,7 @@ void TIntermediate::mergeCallGraphs(TInfoSink& infoSink, TIntermediate& unit)
callGraph
.
insert
(
callGraph
.
end
(),
unit
.
callGraph
.
begin
(),
unit
.
callGraph
.
end
());
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
#define MERGE_MAX(member) member = std::max(member, unit.member)
#define MERGE_TRUE(member) if (unit.member) member = unit.member;
...
...
@@ -533,7 +533,7 @@ void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType)
//
void
TIntermediate
::
mergeErrorCheck
(
TInfoSink
&
infoSink
,
const
TIntermSymbol
&
symbol
,
const
TIntermSymbol
&
unitSymbol
,
bool
crossStage
)
{
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
bool
writeTypeComparison
=
false
;
// Types have to match
...
...
glslang/MachineIndependent/localintermediate.h
View file @
5743eed4
...
...
@@ -241,7 +241,10 @@ class TIntermediate {
public
:
explicit
TIntermediate
(
EShLanguage
l
,
int
v
=
0
,
EProfile
p
=
ENoProfile
)
:
language
(
l
),
profile
(
p
),
version
(
v
),
treeRoot
(
0
),
#ifndef GLSLANG_ANGLE
profile
(
p
),
version
(
v
),
#endif
treeRoot
(
0
),
numEntryPoints
(
0
),
numErrors
(
0
),
numPushConstants
(
0
),
recursive
(
false
),
invertY
(
false
),
useStorageBuffer
(
false
),
...
...
@@ -295,9 +298,20 @@ public:
#endif
}
void
setVersion
(
int
v
)
{
version
=
v
;
}
void
setVersion
(
int
v
)
{
#ifndef GLSLANG_ANGLE
version
=
v
;
#endif
}
void
setProfile
(
EProfile
p
)
{
#ifndef GLSLANG_ANGLE
profile
=
p
;
#endif
}
int
getVersion
()
const
{
return
version
;
}
void
setProfile
(
EProfile
p
)
{
profile
=
p
;
}
EProfile
getProfile
()
const
{
return
profile
;
}
void
setSpv
(
const
SpvVersion
&
s
)
{
...
...
@@ -929,8 +943,13 @@ protected:
typedef
std
::
list
<
TCall
>
TGraph
;
TGraph
callGraph
;
#ifdef GLSLANG_ANGLE
const
EProfile
profile
=
ECoreProfile
;
const
int
version
=
450
;
#else
EProfile
profile
;
// source profile
int
version
;
// source version
#endif
SpvVersion
spvVersion
;
TIntermNode
*
treeRoot
;
std
::
map
<
std
::
string
,
TExtensionBehavior
>
requestedExtensions
;
// cumulation of all enabled or required extensions; not connected to what subset of the shader used them
...
...
glslang/MachineIndependent/parseVersions.h
View file @
5743eed4
...
...
@@ -58,7 +58,7 @@ public:
const
SpvVersion
&
spvVersion
,
EShLanguage
language
,
TInfoSink
&
infoSink
,
bool
forwardCompatible
,
EShMessages
messages
)
:
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
forwardCompatible
(
forwardCompatible
),
profile
(
profile
),
#endif
...
...
@@ -117,8 +117,13 @@ public:
bool
suppressWarnings
()
const
{
return
true
;
}
bool
isForwardCompatible
()
const
{
return
false
;
}
#else
#ifdef GLSLANG_ANGLE
const
bool
forwardCompatible
=
true
;
const
EProfile
profile
=
ECoreProfile
;
#else
bool
forwardCompatible
;
// true if errors are to be given for use of deprecated features
EProfile
profile
;
// the declared profile in the shader (core by default)
#endif
bool
isEsProfile
()
const
{
return
profile
==
EEsProfile
;
}
void
requireProfile
(
const
TSourceLoc
&
loc
,
int
profileMask
,
const
char
*
featureDesc
);
void
profileRequires
(
const
TSourceLoc
&
loc
,
int
profileMask
,
int
minVersion
,
int
numExtensions
,
...
...
glslang/MachineIndependent/reflection.cpp
View file @
5743eed4
...
...
@@ -33,7 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
#include "../Include/Common.h"
#include "reflection.h"
...
...
@@ -1266,4 +1266,4 @@ void TReflection::dump()
}
// end namespace glslang
#endif //
GLSLANG_WEB
#endif //
!GLSLANG_WEB && !GLSLANG_ANGLE
glslang/MachineIndependent/reflection.h
View file @
5743eed4
...
...
@@ -33,7 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
#ifndef _REFLECTION_INCLUDED
#define _REFLECTION_INCLUDED
...
...
@@ -220,4 +220,4 @@ protected:
#endif // _REFLECTION_INCLUDED
#endif //
GLSLANG_WEB
#endif //
!GLSLANG_WEB && !GLSLANG_ANGLE
glslang/Public/ShaderLang.h
View file @
5743eed4
...
...
@@ -690,7 +690,7 @@ private:
TShader
&
operator
=
(
TShader
&
);
};
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
//
// A reflection database and its interface, consistent with the OpenGL API reflection queries.
...
...
@@ -808,7 +808,7 @@ public:
virtual
void
addStage
(
EShLanguage
stage
)
=
0
;
};
#endif //
GLSLANG_WEB
#endif //
!GLSLANG_WEB && !GLSLANG_ANGLE
// Make one TProgram per set of shaders that will get linked together. Add all
// the shaders that are to be linked together. After calling shader.parse()
...
...
@@ -829,7 +829,7 @@ public:
TIntermediate
*
getIntermediate
(
EShLanguage
stage
)
const
{
return
intermediate
[
stage
];
}
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
// Reflection Interface
...
...
@@ -923,7 +923,7 @@ public:
// If resolver is not provided it uses the previous approach
// and respects auto assignment and offsets.
GLSLANG_EXPORT
bool
mapIO
(
TIoMapResolver
*
pResolver
=
nullptr
,
TIoMapper
*
pIoMapper
=
nullptr
);
#endif
#endif
// !GLSLANG_WEB && !GLSLANG_ANGLE
protected
:
GLSLANG_EXPORT
bool
linkStage
(
EShLanguage
,
EShMessages
);
...
...
@@ -933,7 +933,7 @@ protected:
TIntermediate
*
intermediate
[
EShLangCount
];
bool
newedIntermediate
[
EShLangCount
];
// track which intermediate were "new" versus reusing a singleton unit in a stage
TInfoSink
*
infoSink
;
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
TReflection
*
reflection
;
#endif
bool
linked
;
...
...
gtests/Link.FromFile.Vk.cpp
View file @
5743eed4
...
...
@@ -75,7 +75,7 @@ TEST_P(LinkTestVulkan, FromFile)
result
.
linkingOutput
=
program
.
getInfoLog
();
result
.
linkingError
=
program
.
getInfoDebugLog
();
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
if
(
success
)
program
.
mapIO
();
#endif
...
...
gtests/TestFixture.h
View file @
5743eed4
...
...
@@ -253,7 +253,7 @@ public:
glslang
::
TProgram
program
;
program
.
addShader
(
&
shader
);
success
&=
program
.
link
(
controls
);
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
if
(
success
)
program
.
mapIO
();
#endif
...
...
@@ -315,7 +315,7 @@ public:
program
.
addShader
(
&
shader
);
success
&=
program
.
link
(
controls
);
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
if
(
success
)
program
.
mapIO
();
#endif
...
...
@@ -360,7 +360,7 @@ public:
glslang
::
TProgram
program
;
program
.
addShader
(
&
shader
);
success
&=
program
.
link
(
controls
);
#if
ndef GLSLANG_WEB
#if
!defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
if
(
success
)
program
.
mapIO
();
#endif
...
...
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