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
fc618919
Commit
fc618919
authored
Sep 09, 2015
by
Rex Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPIRV: Add the support of missing image functions #72
parent
d4782c10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+0
-0
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+10
-0
SpvBuilder.h
SPIRV/SpvBuilder.h
+6
-0
Constant.cpp
glslang/MachineIndependent/Constant.cpp
+1
-1
No files found.
SPIRV/GlslangToSpv.cpp
View file @
fc618919
This diff is collapsed.
Click to expand it.
SPIRV/SpvBuilder.cpp
View file @
fc618919
...
@@ -822,6 +822,7 @@ Id Builder::createVariable(StorageClass storageClass, Id type, const char* name)
...
@@ -822,6 +822,7 @@ Id Builder::createVariable(StorageClass storageClass, Id type, const char* name)
case
StorageClassWorkgroupLocal
:
case
StorageClassWorkgroupLocal
:
case
StorageClassPrivateGlobal
:
case
StorageClassPrivateGlobal
:
case
StorageClassWorkgroupGlobal
:
case
StorageClassWorkgroupGlobal
:
case
StorageClassAtomicCounter
:
constantsTypesGlobals
.
push_back
(
inst
);
constantsTypesGlobals
.
push_back
(
inst
);
module
.
mapInstruction
(
inst
);
module
.
mapInstruction
(
inst
);
break
;
break
;
...
@@ -975,6 +976,15 @@ void Builder::createNoResultOp(Op opCode, Id operand)
...
@@ -975,6 +976,15 @@ void Builder::createNoResultOp(Op opCode, Id operand)
buildPoint
->
addInstruction
(
op
);
buildPoint
->
addInstruction
(
op
);
}
}
// An opcode that has one operand, no result id, and no type
void
Builder
::
createNoResultOp
(
Op
opCode
,
const
std
::
vector
<
Id
>&
operands
)
{
Instruction
*
op
=
new
Instruction
(
opCode
);
for
(
auto
operand
:
operands
)
op
->
addIdOperand
(
operand
);
buildPoint
->
addInstruction
(
op
);
}
void
Builder
::
createControlBarrier
(
Scope
execution
,
Scope
memory
,
MemorySemanticsMask
semantics
)
void
Builder
::
createControlBarrier
(
Scope
execution
,
Scope
memory
,
MemorySemanticsMask
semantics
)
{
{
Instruction
*
op
=
new
Instruction
(
OpControlBarrier
);
Instruction
*
op
=
new
Instruction
(
OpControlBarrier
);
...
...
SPIRV/SpvBuilder.h
View file @
fc618919
...
@@ -137,6 +137,11 @@ public:
...
@@ -137,6 +137,11 @@ public:
bool
isConstantScalar
(
Id
resultId
)
const
{
return
getOpCode
(
resultId
)
==
OpConstant
;
}
bool
isConstantScalar
(
Id
resultId
)
const
{
return
getOpCode
(
resultId
)
==
OpConstant
;
}
unsigned
int
getConstantScalar
(
Id
resultId
)
const
{
return
module
.
getInstruction
(
resultId
)
->
getImmediateOperand
(
0
);
}
unsigned
int
getConstantScalar
(
Id
resultId
)
const
{
return
module
.
getInstruction
(
resultId
)
->
getImmediateOperand
(
0
);
}
bool
isSignedType
(
Id
typeId
)
const
{
assert
(
getTypeClass
(
typeId
)
==
OpTypeInt
);
return
module
.
getInstruction
(
typeId
)
->
getImmediateOperand
(
1
)
==
0u
;
}
int
getTypeNumColumns
(
Id
typeId
)
const
int
getTypeNumColumns
(
Id
typeId
)
const
{
{
...
@@ -241,6 +246,7 @@ public:
...
@@ -241,6 +246,7 @@ public:
void
createNoResultOp
(
Op
);
void
createNoResultOp
(
Op
);
void
createNoResultOp
(
Op
,
Id
operand
);
void
createNoResultOp
(
Op
,
Id
operand
);
void
createNoResultOp
(
Op
,
const
std
::
vector
<
Id
>&
operands
);
void
createControlBarrier
(
Scope
execution
,
Scope
memory
,
MemorySemanticsMask
);
void
createControlBarrier
(
Scope
execution
,
Scope
memory
,
MemorySemanticsMask
);
void
createMemoryBarrier
(
unsigned
executionScope
,
unsigned
memorySemantics
);
void
createMemoryBarrier
(
unsigned
executionScope
,
unsigned
memorySemantics
);
Id
createUnaryOp
(
Op
,
Id
typeId
,
Id
operand
);
Id
createUnaryOp
(
Op
,
Id
typeId
,
Id
operand
);
...
...
glslang/MachineIndependent/Constant.cpp
View file @
fc618919
...
@@ -768,7 +768,7 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
...
@@ -768,7 +768,7 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
}
}
break
;
break
;
case
EOpReflect
:
case
EOpReflect
:
// I 2 * dot(N, I) * N: Arguments are (I, N).
// I
-
2 * dot(N, I) * N: Arguments are (I, N).
dot
=
childConstUnions
[
0
].
dot
(
childConstUnions
[
1
]);
dot
=
childConstUnions
[
0
].
dot
(
childConstUnions
[
1
]);
dot
*=
2.0
;
dot
*=
2.0
;
for
(
int
comp
=
0
;
comp
<
numComps
;
++
comp
)
for
(
int
comp
=
0
;
comp
<
numComps
;
++
comp
)
...
...
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