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
8985fc91
Commit
8985fc91
authored
Mar 03, 2020
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix long lines in the SPIR-V generator, retrigger bots.
parent
bbbd9a2a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+0
-0
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+22
-11
SpvBuilder.h
SPIRV/SpvBuilder.h
+0
-0
No files found.
SPIRV/GlslangToSpv.cpp
View file @
8985fc91
This diff is collapsed.
Click to expand it.
SPIRV/SpvBuilder.cpp
View file @
8985fc91
...
@@ -496,7 +496,8 @@ Id Builder::makeFunctionType(Id returnType, const std::vector<Id>& paramTypes)
...
@@ -496,7 +496,8 @@ Id Builder::makeFunctionType(Id returnType, const std::vector<Id>& paramTypes)
return
type
->
getResultId
();
return
type
->
getResultId
();
}
}
Id
Builder
::
makeImageType
(
Id
sampledType
,
Dim
dim
,
bool
depth
,
bool
arrayed
,
bool
ms
,
unsigned
sampled
,
ImageFormat
format
)
Id
Builder
::
makeImageType
(
Id
sampledType
,
Dim
dim
,
bool
depth
,
bool
arrayed
,
bool
ms
,
unsigned
sampled
,
ImageFormat
format
)
{
{
assert
(
sampled
==
1
||
sampled
==
2
);
assert
(
sampled
==
1
||
sampled
==
2
);
...
@@ -1270,7 +1271,8 @@ Function* Builder::makeEntryPoint(const char* entryPoint)
...
@@ -1270,7 +1271,8 @@ Function* Builder::makeEntryPoint(const char* entryPoint)
// Comments in header
// Comments in header
Function
*
Builder
::
makeFunctionEntry
(
Decoration
precision
,
Id
returnType
,
const
char
*
name
,
Function
*
Builder
::
makeFunctionEntry
(
Decoration
precision
,
Id
returnType
,
const
char
*
name
,
const
std
::
vector
<
Id
>&
paramTypes
,
const
std
::
vector
<
std
::
vector
<
Decoration
>>&
decorations
,
Block
**
entry
)
const
std
::
vector
<
Id
>&
paramTypes
,
const
std
::
vector
<
std
::
vector
<
Decoration
>>&
decorations
,
Block
**
entry
)
{
{
// Make the function and initial instructions in it
// Make the function and initial instructions in it
Id
typeId
=
makeFunctionType
(
returnType
,
paramTypes
);
Id
typeId
=
makeFunctionType
(
returnType
,
paramTypes
);
...
@@ -1373,7 +1375,8 @@ Id Builder::createUndefined(Id type)
...
@@ -1373,7 +1375,8 @@ Id Builder::createUndefined(Id type)
}
}
// av/vis/nonprivate are unnecessary and illegal for some storage classes.
// av/vis/nonprivate are unnecessary and illegal for some storage classes.
spv
::
MemoryAccessMask
Builder
::
sanitizeMemoryAccessForStorageClass
(
spv
::
MemoryAccessMask
memoryAccess
,
StorageClass
sc
)
const
spv
::
MemoryAccessMask
Builder
::
sanitizeMemoryAccessForStorageClass
(
spv
::
MemoryAccessMask
memoryAccess
,
StorageClass
sc
)
const
{
{
switch
(
sc
)
{
switch
(
sc
)
{
case
spv
:
:
StorageClassUniform
:
case
spv
:
:
StorageClassUniform
:
...
@@ -1392,7 +1395,8 @@ spv::MemoryAccessMask Builder::sanitizeMemoryAccessForStorageClass(spv::MemoryAc
...
@@ -1392,7 +1395,8 @@ spv::MemoryAccessMask Builder::sanitizeMemoryAccessForStorageClass(spv::MemoryAc
}
}
// Comments in header
// Comments in header
void
Builder
::
createStore
(
Id
rValue
,
Id
lValue
,
spv
::
MemoryAccessMask
memoryAccess
,
spv
::
Scope
scope
,
unsigned
int
alignment
)
void
Builder
::
createStore
(
Id
rValue
,
Id
lValue
,
spv
::
MemoryAccessMask
memoryAccess
,
spv
::
Scope
scope
,
unsigned
int
alignment
)
{
{
Instruction
*
store
=
new
Instruction
(
OpStore
);
Instruction
*
store
=
new
Instruction
(
OpStore
);
store
->
addIdOperand
(
lValue
);
store
->
addIdOperand
(
lValue
);
...
@@ -1495,7 +1499,8 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index)
...
@@ -1495,7 +1499,8 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index)
// Generate code for spec constants if in spec constant operation
// Generate code for spec constants if in spec constant operation
// generation mode.
// generation mode.
if
(
generatingOpCodeForSpecConst
)
{
if
(
generatingOpCodeForSpecConst
)
{
return
createSpecConstantOp
(
OpCompositeExtract
,
typeId
,
std
::
vector
<
Id
>
(
1
,
composite
),
std
::
vector
<
Id
>
(
1
,
index
));
return
createSpecConstantOp
(
OpCompositeExtract
,
typeId
,
std
::
vector
<
Id
>
(
1
,
composite
),
std
::
vector
<
Id
>
(
1
,
index
));
}
}
Instruction
*
extract
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpCompositeExtract
);
Instruction
*
extract
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpCompositeExtract
);
extract
->
addIdOperand
(
composite
);
extract
->
addIdOperand
(
composite
);
...
@@ -1697,7 +1702,8 @@ Id Builder::createOp(Op opCode, Id typeId, const std::vector<IdImmediate>& opera
...
@@ -1697,7 +1702,8 @@ Id Builder::createOp(Op opCode, Id typeId, const std::vector<IdImmediate>& opera
return
op
->
getResultId
();
return
op
->
getResultId
();
}
}
Id
Builder
::
createSpecConstantOp
(
Op
opCode
,
Id
typeId
,
const
std
::
vector
<
Id
>&
operands
,
const
std
::
vector
<
unsigned
>&
literals
)
Id
Builder
::
createSpecConstantOp
(
Op
opCode
,
Id
typeId
,
const
std
::
vector
<
Id
>&
operands
,
const
std
::
vector
<
unsigned
>&
literals
)
{
{
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpSpecConstantOp
);
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpSpecConstantOp
);
op
->
addImmediateOperand
((
unsigned
)
opCode
);
op
->
addImmediateOperand
((
unsigned
)
opCode
);
...
@@ -2187,7 +2193,8 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b
...
@@ -2187,7 +2193,8 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b
if
(
constituent
==
0
)
if
(
constituent
==
0
)
resultId
=
subResultId
;
resultId
=
subResultId
;
else
else
resultId
=
setPrecision
(
createBinOp
(
equal
?
OpLogicalAnd
:
OpLogicalOr
,
boolType
,
resultId
,
subResultId
),
precision
);
resultId
=
setPrecision
(
createBinOp
(
equal
?
OpLogicalAnd
:
OpLogicalOr
,
boolType
,
resultId
,
subResultId
),
precision
);
}
}
return
resultId
;
return
resultId
;
...
@@ -2196,7 +2203,8 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b
...
@@ -2196,7 +2203,8 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b
// OpCompositeConstruct
// OpCompositeConstruct
Id
Builder
::
createCompositeConstruct
(
Id
typeId
,
const
std
::
vector
<
Id
>&
constituents
)
Id
Builder
::
createCompositeConstruct
(
Id
typeId
,
const
std
::
vector
<
Id
>&
constituents
)
{
{
assert
(
isAggregateType
(
typeId
)
||
(
getNumTypeConstituents
(
typeId
)
>
1
&&
getNumTypeConstituents
(
typeId
)
==
(
int
)
constituents
.
size
()));
assert
(
isAggregateType
(
typeId
)
||
(
getNumTypeConstituents
(
typeId
)
>
1
&&
getNumTypeConstituents
(
typeId
)
==
(
int
)
constituents
.
size
()));
if
(
generatingOpCodeForSpecConst
)
{
if
(
generatingOpCodeForSpecConst
)
{
// Sometime, even in spec-constant-op mode, the constant composite to be
// Sometime, even in spec-constant-op mode, the constant composite to be
...
@@ -2609,7 +2617,8 @@ void Builder::clearAccessChain()
...
@@ -2609,7 +2617,8 @@ void Builder::clearAccessChain()
}
}
// Comments in header
// Comments in header
void
Builder
::
accessChainPushSwizzle
(
std
::
vector
<
unsigned
>&
swizzle
,
Id
preSwizzleBaseType
,
AccessChain
::
CoherentFlags
coherentFlags
,
unsigned
int
alignment
)
void
Builder
::
accessChainPushSwizzle
(
std
::
vector
<
unsigned
>&
swizzle
,
Id
preSwizzleBaseType
,
AccessChain
::
CoherentFlags
coherentFlags
,
unsigned
int
alignment
)
{
{
accessChain
.
coherentFlags
|=
coherentFlags
;
accessChain
.
coherentFlags
|=
coherentFlags
;
accessChain
.
alignment
|=
alignment
;
accessChain
.
alignment
|=
alignment
;
...
@@ -2663,7 +2672,8 @@ void Builder::accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess, sp
...
@@ -2663,7 +2672,8 @@ void Builder::accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess, sp
}
}
// Comments in header
// Comments in header
Id
Builder
::
accessChainLoad
(
Decoration
precision
,
Decoration
nonUniform
,
Id
resultType
,
spv
::
MemoryAccessMask
memoryAccess
,
spv
::
Scope
scope
,
unsigned
int
alignment
)
Id
Builder
::
accessChainLoad
(
Decoration
precision
,
Decoration
nonUniform
,
Id
resultType
,
spv
::
MemoryAccessMask
memoryAccess
,
spv
::
Scope
scope
,
unsigned
int
alignment
)
{
{
Id
id
;
Id
id
;
...
@@ -3075,7 +3085,8 @@ void Builder::dumpSourceInstructions(std::vector<unsigned int>& out) const
...
@@ -3075,7 +3085,8 @@ void Builder::dumpSourceInstructions(std::vector<unsigned int>& out) const
dumpSourceInstructions
(
iItr
->
first
,
*
iItr
->
second
,
out
);
dumpSourceInstructions
(
iItr
->
first
,
*
iItr
->
second
,
out
);
}
}
void
Builder
::
dumpInstructions
(
std
::
vector
<
unsigned
int
>&
out
,
const
std
::
vector
<
std
::
unique_ptr
<
Instruction
>
>&
instructions
)
const
void
Builder
::
dumpInstructions
(
std
::
vector
<
unsigned
int
>&
out
,
const
std
::
vector
<
std
::
unique_ptr
<
Instruction
>
>&
instructions
)
const
{
{
for
(
int
i
=
0
;
i
<
(
int
)
instructions
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
(
int
)
instructions
.
size
();
++
i
)
{
instructions
[
i
]
->
dump
(
out
);
instructions
[
i
]
->
dump
(
out
);
...
...
SPIRV/SpvBuilder.h
View file @
8985fc91
This diff is collapsed.
Click to expand it.
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