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
32084e88
Commit
32084e88
authored
Feb 23, 2016
by
rdb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compilation issues with MSVC 2010
(mostly by eliminating use of range-based for loops and std::tie)
parent
0967748f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
28 deletions
+28
-28
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+2
-2
InReadableOrder.cpp
SPIRV/InReadableOrder.cpp
+3
-2
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+8
-8
StandAlone.cpp
StandAlone/StandAlone.cpp
+4
-3
spirv-remap.cpp
StandAlone/spirv-remap.cpp
+4
-2
Common.h
glslang/Include/Common.h
+1
-1
intermOut.cpp
glslang/MachineIndependent/intermOut.cpp
+3
-7
Pp.cpp
glslang/MachineIndependent/preprocessor/Pp.cpp
+3
-3
No files found.
SPIRV/GlslangToSpv.cpp
View file @
32084e88
...
@@ -688,8 +688,8 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
...
@@ -688,8 +688,8 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
void
TGlslangToSpvTraverser
::
dumpSpv
(
std
::
vector
<
unsigned
int
>&
out
)
void
TGlslangToSpvTraverser
::
dumpSpv
(
std
::
vector
<
unsigned
int
>&
out
)
{
{
// finish off the entry-point SPV instruction by adding the Input/Output <id>
// finish off the entry-point SPV instruction by adding the Input/Output <id>
for
(
auto
it
:
iOSe
t
)
for
(
auto
it
=
iOSet
.
cbegin
();
it
!=
iOSet
.
cend
();
++
i
t
)
entryPoint
->
addIdOperand
(
it
);
entryPoint
->
addIdOperand
(
*
it
);
builder
.
dump
(
out
);
builder
.
dump
(
out
);
}
}
...
...
SPIRV/InReadableOrder.cpp
View file @
32084e88
...
@@ -91,8 +91,9 @@ public:
...
@@ -91,8 +91,9 @@ public:
delayed_
[
continueBlock
]
=
true
;
delayed_
[
continueBlock
]
=
true
;
}
}
}
}
for
(
const
auto
succ
:
block
->
getSuccessors
())
const
auto
successors
=
block
->
getSuccessors
();
visit
(
succ
);
for
(
auto
it
=
successors
.
cbegin
();
it
!=
successors
.
cend
();
++
it
)
visit
(
*
it
);
if
(
continueBlock
)
{
if
(
continueBlock
)
{
delayed_
[
continueBlock
]
=
false
;
delayed_
[
continueBlock
]
=
false
;
visit
(
continueBlock
);
visit
(
continueBlock
);
...
...
SPIRV/SpvBuilder.cpp
View file @
32084e88
...
@@ -1141,8 +1141,8 @@ void Builder::createNoResultOp(Op opCode, Id operand)
...
@@ -1141,8 +1141,8 @@ void Builder::createNoResultOp(Op opCode, Id operand)
void
Builder
::
createNoResultOp
(
Op
opCode
,
const
std
::
vector
<
Id
>&
operands
)
void
Builder
::
createNoResultOp
(
Op
opCode
,
const
std
::
vector
<
Id
>&
operands
)
{
{
Instruction
*
op
=
new
Instruction
(
opCode
);
Instruction
*
op
=
new
Instruction
(
opCode
);
for
(
auto
operand
:
operands
)
for
(
auto
it
=
operands
.
cbegin
();
it
!=
operands
.
cend
();
++
it
)
op
->
addIdOperand
(
operand
);
op
->
addIdOperand
(
*
it
);
buildPoint
->
addInstruction
(
std
::
unique_ptr
<
Instruction
>
(
op
));
buildPoint
->
addInstruction
(
std
::
unique_ptr
<
Instruction
>
(
op
));
}
}
...
@@ -1197,8 +1197,8 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3)
...
@@ -1197,8 +1197,8 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3)
Id
Builder
::
createOp
(
Op
opCode
,
Id
typeId
,
const
std
::
vector
<
Id
>&
operands
)
Id
Builder
::
createOp
(
Op
opCode
,
Id
typeId
,
const
std
::
vector
<
Id
>&
operands
)
{
{
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
opCode
);
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
opCode
);
for
(
auto
operand
:
operands
)
for
(
auto
it
=
operands
.
cbegin
();
it
!=
operands
.
cend
();
++
it
)
op
->
addIdOperand
(
operand
);
op
->
addIdOperand
(
*
it
);
buildPoint
->
addInstruction
(
std
::
unique_ptr
<
Instruction
>
(
op
));
buildPoint
->
addInstruction
(
std
::
unique_ptr
<
Instruction
>
(
op
));
return
op
->
getResultId
();
return
op
->
getResultId
();
...
@@ -2106,9 +2106,9 @@ Id Builder::accessChainGetInferredType()
...
@@ -2106,9 +2106,9 @@ Id Builder::accessChainGetInferredType()
type
=
getContainedTypeId
(
type
);
type
=
getContainedTypeId
(
type
);
// dereference each index
// dereference each index
for
(
auto
deref
:
accessChain
.
indexChain
)
{
for
(
auto
it
=
accessChain
.
indexChain
.
cbegin
();
it
!=
accessChain
.
indexChain
.
cend
();
++
it
)
{
if
(
isStructType
(
type
))
if
(
isStructType
(
type
))
type
=
getContainedTypeId
(
type
,
getConstantScalar
(
deref
));
type
=
getContainedTypeId
(
type
,
getConstantScalar
(
*
it
));
else
else
type
=
getContainedTypeId
(
type
);
type
=
getContainedTypeId
(
type
);
}
}
...
@@ -2136,9 +2136,9 @@ void Builder::dump(std::vector<unsigned int>& out) const
...
@@ -2136,9 +2136,9 @@ void Builder::dump(std::vector<unsigned int>& out) const
out
.
push_back
(
0
);
out
.
push_back
(
0
);
// Capabilities
// Capabilities
for
(
auto
cap
:
capabilities
)
{
for
(
auto
it
=
capabilities
.
cbegin
();
it
!=
capabilities
.
cend
();
++
it
)
{
Instruction
capInst
(
0
,
0
,
OpCapability
);
Instruction
capInst
(
0
,
0
,
OpCapability
);
capInst
.
addImmediateOperand
(
cap
);
capInst
.
addImmediateOperand
(
*
it
);
capInst
.
dump
(
out
);
capInst
.
dump
(
out
);
}
}
...
...
StandAlone/StandAlone.cpp
View file @
32084e88
...
@@ -689,7 +689,8 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
...
@@ -689,7 +689,8 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
//
//
glslang
::
TProgram
&
program
=
*
new
glslang
::
TProgram
;
glslang
::
TProgram
&
program
=
*
new
glslang
::
TProgram
;
for
(
auto
compUnit
:
compUnits
)
{
for
(
auto
it
=
compUnits
.
cbegin
();
it
!=
compUnits
.
cend
();
++
it
)
{
const
auto
&
compUnit
=
*
it
;
glslang
::
TShader
*
shader
=
new
glslang
::
TShader
(
compUnit
.
stage
);
glslang
::
TShader
*
shader
=
new
glslang
::
TShader
(
compUnit
.
stage
);
shader
->
setStrings
(
compUnit
.
text
,
1
);
shader
->
setStrings
(
compUnit
.
text
,
1
);
shaders
.
push_back
(
shader
);
shaders
.
push_back
(
shader
);
...
@@ -822,8 +823,8 @@ void CompileAndLinkShaderFiles()
...
@@ -822,8 +823,8 @@ void CompileAndLinkShaderFiles()
glslang
::
OS_DumpMemoryCounters
();
glslang
::
OS_DumpMemoryCounters
();
}
}
for
(
auto
c
:
compUnits
)
for
(
auto
it
=
compUnits
.
begin
();
it
!=
compUnits
.
end
();
++
it
)
FreeFileData
(
c
.
text
);
FreeFileData
(
it
->
text
);
}
}
int
C_DECL
main
(
int
argc
,
char
*
argv
[])
int
C_DECL
main
(
int
argc
,
char
*
argv
[])
...
...
StandAlone/spirv-remap.cpp
View file @
32084e88
...
@@ -120,7 +120,8 @@ namespace {
...
@@ -120,7 +120,8 @@ namespace {
if
(
fp
.
fail
())
if
(
fp
.
fail
())
errHandler
(
std
::
string
(
"error opening file for write: "
)
+
outFile
);
errHandler
(
std
::
string
(
"error opening file for write: "
)
+
outFile
);
for
(
auto
word
:
spv
)
{
for
(
auto
it
=
spv
.
cbegin
();
it
!=
spv
.
cend
();
++
it
)
{
SpvWord
word
=
*
it
;
fp
.
write
((
char
*
)
&
word
,
sizeof
(
word
));
fp
.
write
((
char
*
)
&
word
,
sizeof
(
word
));
if
(
fp
.
fail
())
if
(
fp
.
fail
())
errHandler
(
std
::
string
(
"error writing file: "
)
+
outFile
);
errHandler
(
std
::
string
(
"error writing file: "
)
+
outFile
);
...
@@ -157,7 +158,8 @@ namespace {
...
@@ -157,7 +158,8 @@ namespace {
void
execute
(
const
std
::
vector
<
std
::
string
>&
inputFile
,
const
std
::
string
&
outputDir
,
void
execute
(
const
std
::
vector
<
std
::
string
>&
inputFile
,
const
std
::
string
&
outputDir
,
int
opts
,
int
verbosity
)
int
opts
,
int
verbosity
)
{
{
for
(
const
auto
&
filename
:
inputFile
)
{
for
(
auto
it
=
inputFile
.
cbegin
();
it
!=
inputFile
.
cend
();
++
it
)
{
const
std
::
string
&
filename
=
*
it
;
std
::
vector
<
SpvWord
>
spv
;
std
::
vector
<
SpvWord
>
spv
;
read
(
spv
,
filename
,
verbosity
);
read
(
spv
,
filename
,
verbosity
);
spv
::
spirvbin_t
(
verbosity
).
remap
(
spv
,
opts
);
spv
::
spirvbin_t
(
verbosity
).
remap
(
spv
,
opts
);
...
...
glslang/Include/Common.h
View file @
32084e88
...
@@ -206,7 +206,7 @@ struct TSourceLoc {
...
@@ -206,7 +206,7 @@ struct TSourceLoc {
{
{
if
(
name
!=
nullptr
)
if
(
name
!=
nullptr
)
return
quoteStringName
?
(
"
\"
"
+
std
::
string
(
name
)
+
"
\"
"
)
:
name
;
return
quoteStringName
?
(
"
\"
"
+
std
::
string
(
name
)
+
"
\"
"
)
:
name
;
return
std
::
to_string
(
string
);
return
std
::
to_string
(
(
long
long
)
string
);
}
}
const
char
*
name
;
// descriptive name for this string
const
char
*
name
;
// descriptive name for this string
int
string
;
int
string
;
...
...
glslang/MachineIndependent/intermOut.cpp
View file @
32084e88
...
@@ -757,13 +757,9 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
...
@@ -757,13 +757,9 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
case
EShLangCompute
:
case
EShLangCompute
:
infoSink
.
debug
<<
"local_size = ("
<<
localSize
[
0
]
<<
", "
<<
localSize
[
1
]
<<
", "
<<
localSize
[
2
]
<<
")
\n
"
;
infoSink
.
debug
<<
"local_size = ("
<<
localSize
[
0
]
<<
", "
<<
localSize
[
1
]
<<
", "
<<
localSize
[
2
]
<<
")
\n
"
;
{
{
bool
dumpSpecIds
=
false
;
if
(
localSizeSpecId
[
0
]
!=
TQualifier
::
layoutNotSet
||
for
(
auto
c
:
localSizeSpecId
)
{
localSizeSpecId
[
1
]
!=
TQualifier
::
layoutNotSet
||
if
(
c
!=
TQualifier
::
layoutNotSet
)
localSizeSpecId
[
2
]
!=
TQualifier
::
layoutNotSet
)
{
dumpSpecIds
=
true
;
}
if
(
dumpSpecIds
)
{
infoSink
.
debug
<<
"local_size ids = ("
<<
infoSink
.
debug
<<
"local_size ids = ("
<<
localSizeSpecId
[
0
]
<<
", "
<<
localSizeSpecId
[
0
]
<<
", "
<<
localSizeSpecId
[
1
]
<<
", "
<<
localSizeSpecId
[
1
]
<<
", "
<<
...
...
glslang/MachineIndependent/preprocessor/Pp.cpp
View file @
32084e88
...
@@ -611,9 +611,9 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
...
@@ -611,9 +611,9 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
if
(
token
!=
'\n'
&&
token
!=
EndOfInput
)
{
if
(
token
!=
'\n'
&&
token
!=
EndOfInput
)
{
parseContext
.
ppError
(
ppToken
->
loc
,
"extra content after file designation"
,
"#include"
,
""
);
parseContext
.
ppError
(
ppToken
->
loc
,
"extra content after file designation"
,
"#include"
,
""
);
}
else
{
}
else
{
std
::
string
sourceName
;
auto
include
=
includer
.
include
(
filename
.
c_str
())
;
std
::
string
replacemen
t
;
std
::
string
sourceName
=
include
.
firs
t
;
std
::
tie
(
sourceName
,
replacement
)
=
includer
.
include
(
filename
.
c_str
())
;
std
::
string
replacement
=
include
.
second
;
if
(
!
sourceName
.
empty
())
{
if
(
!
sourceName
.
empty
())
{
if
(
!
replacement
.
empty
())
{
if
(
!
replacement
.
empty
())
{
const
bool
forNextLine
=
parseContext
.
lineDirectiveShouldSetNextLine
();
const
bool
forNextLine
=
parseContext
.
lineDirectiveShouldSetNextLine
();
...
...
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