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
b249f2fc
Commit
b249f2fc
authored
Aug 11, 2016
by
steve-lunarg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPIRV: allow 64 bit literals in OperandVariableLiteralId class iteration.
parent
28660bb5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
53 deletions
+108
-53
SPVRemapper.cpp
SPIRV/SPVRemapper.cpp
+94
-41
SPVRemapper.h
SPIRV/SPVRemapper.h
+14
-12
No files found.
SPIRV/SPVRemapper.cpp
View file @
b249f2fc
This diff is collapsed.
Click to expand it.
SPIRV/SPVRemapper.h
View file @
b249f2fc
...
@@ -162,13 +162,15 @@ private:
...
@@ -162,13 +162,15 @@ private:
// handle error
// handle error
void
error
(
const
std
::
string
&
txt
)
const
{
errorHandler
(
txt
);
}
void
error
(
const
std
::
string
&
txt
)
const
{
errorHandler
(
txt
);
}
bool
isConstOp
(
spv
::
Op
opCode
)
const
;
bool
isConstOp
(
spv
::
Op
opCode
)
const
;
bool
isTypeOp
(
spv
::
Op
opCode
)
const
;
bool
isTypeOp
(
spv
::
Op
opCode
)
const
;
bool
isStripOp
(
spv
::
Op
opCode
)
const
;
bool
isStripOp
(
spv
::
Op
opCode
)
const
;
bool
isFlowCtrl
(
spv
::
Op
opCode
)
const
;
bool
isFlowCtrl
(
spv
::
Op
opCode
)
const
;
range_t
literalRange
(
spv
::
Op
opCode
)
const
;
range_t
literalRange
(
spv
::
Op
opCode
)
const
;
range_t
typeRange
(
spv
::
Op
opCode
)
const
;
range_t
typeRange
(
spv
::
Op
opCode
)
const
;
range_t
constRange
(
spv
::
Op
opCode
)
const
;
range_t
constRange
(
spv
::
Op
opCode
)
const
;
unsigned
typeSizeInWords
(
spv
::
Id
id
)
const
;
unsigned
idTypeSizeInWords
(
spv
::
Id
id
)
const
;
spv
::
Id
&
asId
(
unsigned
word
)
{
return
spv
[
word
];
}
spv
::
Id
&
asId
(
unsigned
word
)
{
return
spv
[
word
];
}
const
spv
::
Id
&
asId
(
unsigned
word
)
const
{
return
spv
[
word
];
}
const
spv
::
Id
&
asId
(
unsigned
word
)
const
{
return
spv
[
word
];
}
...
@@ -177,10 +179,10 @@ private:
...
@@ -177,10 +179,10 @@ private:
spv
::
Decoration
asDecoration
(
unsigned
word
)
const
{
return
spv
::
Decoration
(
spv
[
word
]);
}
spv
::
Decoration
asDecoration
(
unsigned
word
)
const
{
return
spv
::
Decoration
(
spv
[
word
]);
}
unsigned
asWordCount
(
unsigned
word
)
const
{
return
opWordCount
(
spv
[
word
]);
}
unsigned
asWordCount
(
unsigned
word
)
const
{
return
opWordCount
(
spv
[
word
]);
}
spv
::
Id
asTypeConstId
(
unsigned
word
)
const
{
return
asId
(
word
+
(
isTypeOp
(
asOpCode
(
word
))
?
1
:
2
));
}
spv
::
Id
asTypeConstId
(
unsigned
word
)
const
{
return
asId
(
word
+
(
isTypeOp
(
asOpCode
(
word
))
?
1
:
2
));
}
unsigned
typePos
(
spv
::
Id
id
)
const
;
unsigned
idPos
(
spv
::
Id
id
)
const
;
static
unsigned
opWordCount
(
spirword_t
data
)
{
return
data
>>
spv
::
WordCountShift
;
}
static
unsigned
opWordCount
(
spirword_t
data
)
{
return
data
>>
spv
::
WordCountShift
;
}
static
spv
::
Op
opOpCode
(
spirword_t
data
)
{
return
spv
::
Op
(
data
&
spv
::
OpCodeMask
);
}
static
spv
::
Op
opOpCode
(
spirword_t
data
)
{
return
spv
::
Op
(
data
&
spv
::
OpCodeMask
);
}
// Header access & set methods
// Header access & set methods
spirword_t
magic
()
const
{
return
spv
[
0
];
}
// return magic number
spirword_t
magic
()
const
{
return
spv
[
0
];
}
// return magic number
...
@@ -263,8 +265,8 @@ private:
...
@@ -263,8 +265,8 @@ private:
// Which functions are called, anywhere in the module, with a call count
// Which functions are called, anywhere in the module, with a call count
std
::
unordered_map
<
spv
::
Id
,
int
>
fnCalls
;
std
::
unordered_map
<
spv
::
Id
,
int
>
fnCalls
;
posmap_t
typeConstPos
;
// word positions that define types & consts (ordered)
posmap_t
typeConstPos
;
// word positions that define types & consts (ordered)
posmap_rev_t
typeConstPosR
;
// reverse map from IDs to positions
posmap_rev_t
idPosR
;
// reverse map from IDs to positions
std
::
vector
<
spv
::
Id
>
idMapL
;
// ID {M}ap from {L}ocal to {G}lobal IDs
std
::
vector
<
spv
::
Id
>
idMapL
;
// ID {M}ap from {L}ocal to {G}lobal IDs
...
...
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