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
1323bf8e
Unverified
Commit
1323bf8e
authored
Aug 20, 2018
by
John Kessenich
Committed by
GitHub
Aug 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1480 from dneto0/stringify
Use our own SPIRV-Tools message stringifier
parents
93dbbdee
9fd2a8cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
8 deletions
+31
-8
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+31
-8
No files found.
SPIRV/GlslangToSpv.cpp
View file @
1323bf8e
...
@@ -56,7 +56,6 @@ namespace spv {
...
@@ -56,7 +56,6 @@ namespace spv {
#if ENABLE_OPT
#if ENABLE_OPT
#include "spirv-tools/optimizer.hpp"
#include "spirv-tools/optimizer.hpp"
#include "message.h"
#endif
#endif
#if ENABLE_OPT
#if ENABLE_OPT
...
@@ -7032,13 +7031,37 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
...
@@ -7032,13 +7031,37 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
spv_target_env
target_env
=
SPV_ENV_UNIVERSAL_1_2
;
spv_target_env
target_env
=
SPV_ENV_UNIVERSAL_1_2
;
spvtools
::
Optimizer
optimizer
(
target_env
);
spvtools
::
Optimizer
optimizer
(
target_env
);
optimizer
.
SetMessageConsumer
([](
spv_message_level_t
level
,
optimizer
.
SetMessageConsumer
(
const
char
*
source
,
[](
spv_message_level_t
level
,
const
char
*
source
,
const
spv_position_t
&
position
,
const
char
*
message
)
{
const
spv_position_t
&
position
,
auto
&
out
=
std
::
cerr
;
const
char
*
message
)
{
switch
(
level
)
std
::
cerr
<<
StringifyMessage
(
level
,
source
,
position
,
message
)
{
<<
std
::
endl
;
case
SPV_MSG_FATAL
:
});
case
SPV_MSG_INTERNAL_ERROR
:
case
SPV_MSG_ERROR
:
out
<<
"error: "
;
break
;
case
SPV_MSG_WARNING
:
out
<<
"warning: "
;
break
;
case
SPV_MSG_INFO
:
case
SPV_MSG_DEBUG
:
out
<<
"info: "
;
break
;
default
:
break
;
}
if
(
source
)
{
out
<<
source
<<
":"
;
}
out
<<
position
.
line
<<
":"
<<
position
.
column
<<
":"
<<
position
.
index
<<
":"
;
if
(
message
)
{
out
<<
" "
<<
message
;
}
out
<<
std
::
endl
;
});
optimizer
.
RegisterPass
(
CreateMergeReturnPass
());
optimizer
.
RegisterPass
(
CreateMergeReturnPass
());
optimizer
.
RegisterPass
(
CreateInlineExhaustivePass
());
optimizer
.
RegisterPass
(
CreateInlineExhaustivePass
());
...
...
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