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
0dfbe3f9
Commit
0dfbe3f9
authored
Apr 02, 2016
by
baldurk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change {parameter} lists into explicit std::vector temporaries
parent
a42533ec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+9
-5
No files found.
SPIRV/SpvBuilder.cpp
View file @
0dfbe3f9
...
@@ -1067,7 +1067,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index)
...
@@ -1067,7 +1067,7 @@ 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
,
{
composite
},
{
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
);
...
@@ -1082,7 +1082,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, std::vector<unsigned
...
@@ -1082,7 +1082,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, std::vector<unsigned
// 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
,
{
composite
}
,
indexes
);
return
createSpecConstantOp
(
OpCompositeExtract
,
typeId
,
std
::
vector
<
Id
>
(
1
,
composite
)
,
indexes
);
}
}
Instruction
*
extract
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpCompositeExtract
);
Instruction
*
extract
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpCompositeExtract
);
extract
->
addIdOperand
(
composite
);
extract
->
addIdOperand
(
composite
);
...
@@ -1184,7 +1184,7 @@ Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand)
...
@@ -1184,7 +1184,7 @@ Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand)
// 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
(
opCode
,
typeId
,
{
operand
},
{}
);
return
createSpecConstantOp
(
opCode
,
typeId
,
std
::
vector
<
Id
>
(
1
,
operand
),
std
::
vector
<
Id
>
()
);
}
}
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
opCode
);
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
opCode
);
op
->
addIdOperand
(
operand
);
op
->
addIdOperand
(
operand
);
...
@@ -1198,7 +1198,9 @@ Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right)
...
@@ -1198,7 +1198,9 @@ Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right)
// 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
(
opCode
,
typeId
,
{
left
,
right
},
{});
std
::
vector
<
Id
>
operands
(
2
);
operands
[
0
]
=
left
;
operands
[
1
]
=
right
;
return
createSpecConstantOp
(
opCode
,
typeId
,
operands
,
std
::
vector
<
Id
>
());
}
}
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
opCode
);
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
opCode
);
op
->
addIdOperand
(
left
);
op
->
addIdOperand
(
left
);
...
@@ -1261,7 +1263,9 @@ Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, std:
...
@@ -1261,7 +1263,9 @@ Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, std:
return
setPrecision
(
createCompositeExtract
(
source
,
typeId
,
channels
.
front
()),
precision
);
return
setPrecision
(
createCompositeExtract
(
source
,
typeId
,
channels
.
front
()),
precision
);
if
(
generatingOpCodeForSpecConst
)
{
if
(
generatingOpCodeForSpecConst
)
{
return
setPrecision
(
createSpecConstantOp
(
OpVectorShuffle
,
typeId
,
{
source
,
source
},
channels
),
precision
);
std
::
vector
<
Id
>
operands
(
2
);
operands
[
0
]
=
operands
[
1
]
=
source
;
return
setPrecision
(
createSpecConstantOp
(
OpVectorShuffle
,
typeId
,
operands
,
channels
),
precision
);
}
}
Instruction
*
swizzle
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpVectorShuffle
);
Instruction
*
swizzle
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpVectorShuffle
);
assert
(
isVector
(
source
));
assert
(
isVector
(
source
));
...
...
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