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
f34cdc70
Unverified
Commit
f34cdc70
authored
Nov 07, 2019
by
John Kessenich
Committed by
GitHub
Nov 07, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1968 from dneto0/reclaim-web-codespace
SPIR-V postprocessing: WEB case only needs CFG mods
parents
44f5c625
e43e8ba9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
SpvBuilder.h
SPIRV/SpvBuilder.h
+7
-0
SpvPostProcess.cpp
SPIRV/SpvPostProcess.cpp
+16
-1
No files found.
SPIRV/SpvBuilder.h
View file @
f34cdc70
...
...
@@ -687,10 +687,17 @@ public:
// based on the resulting SPIR-V.
void
postProcess
();
// Prune unreachable blocks in the CFG and remove unneeded decorations.
void
postProcessCFG
();
#ifndef GLSLANG_WEB
// Add capabilities, extensions based on instructions in the module.
void
postProcessFeatures
();
// Hook to visit each instruction in a block in a function
void
postProcess
(
Instruction
&
);
// Hook to visit each non-32-bit sized float/int operation in a block.
void
postProcessType
(
const
Instruction
&
,
spv
::
Id
typeId
);
#endif
void
dump
(
std
::
vector
<
unsigned
int
>&
)
const
;
...
...
SPIRV/SpvPostProcess.cpp
View file @
f34cdc70
...
...
@@ -58,6 +58,7 @@ namespace spv {
namespace
spv
{
#ifndef GLSLANG_WEB
// Hook to visit each operand type and result type of an instruction.
// Will be called multiple times for one instruction, once for each typed
// operand and the result.
...
...
@@ -319,9 +320,10 @@ void Builder::postProcess(Instruction& inst)
}
}
}
#endif
// comment in header
void
Builder
::
postProcess
()
void
Builder
::
postProcess
CFG
()
{
// reachableBlocks is the set of blockss reached via control flow, or which are
// unreachable continue targert or unreachable merge.
...
...
@@ -377,7 +379,11 @@ void Builder::postProcess()
return
unreachableDefinitions
.
count
(
decoration_id
)
!=
0
;
}),
decorations
.
end
());
}
#ifndef GLSLANG_WEB
// comment in header
void
Builder
::
postProcessFeatures
()
{
// Add per-instruction capabilities, extensions, etc.,
// Look for any 8/16 bit type in physical storage buffer class, and set the
...
...
@@ -431,5 +437,14 @@ void Builder::postProcess()
}
}
}
#endif
// comment in header
void
Builder
::
postProcess
()
{
postProcessCFG
();
#ifndef GLSLANG_WEB
postProcessFeatures
();
#endif
}
};
// end spv namespace
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