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
fca82621
Commit
fca82621
authored
Nov 26, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always correctly terminate main. Issue #588, PR #600.
parent
1c573fbc
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
24 additions
and
15 deletions
+24
-15
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+13
-13
hlsl.array.implicit-size.frag.out
Test/baseResults/hlsl.array.implicit-size.frag.out
+1
-0
hlsl.float1.frag.out
Test/baseResults/hlsl.float1.frag.out
+1
-0
hlsl.float4.frag.out
Test/baseResults/hlsl.float4.frag.out
+1
-0
hlsl.intrinsics.vert.out
Test/baseResults/hlsl.intrinsics.vert.out
+1
-0
hlsl.layout.frag.out
Test/baseResults/hlsl.layout.frag.out
+1
-0
hlsl.matType.frag.out
Test/baseResults/hlsl.matType.frag.out
+1
-0
hlsl.shapeConv.frag.out
Test/baseResults/hlsl.shapeConv.frag.out
+1
-0
hlsl.swizzle.frag.out
Test/baseResults/hlsl.swizzle.frag.out
+1
-0
hlsl.typedef.frag.out
Test/baseResults/hlsl.typedef.frag.out
+1
-0
revision.h
glslang/Include/revision.h
+2
-2
No files found.
SPIRV/GlslangToSpv.cpp
View file @
fca82621
...
...
@@ -99,7 +99,7 @@ private:
class
TGlslangToSpvTraverser
:
public
glslang
::
TIntermTraverser
{
public
:
TGlslangToSpvTraverser
(
const
glslang
::
TIntermediate
*
,
spv
::
SpvBuildLogger
*
logger
);
virtual
~
TGlslangToSpvTraverser
()
;
virtual
~
TGlslangToSpvTraverser
()
{
}
bool
visitAggregate
(
glslang
::
TVisit
,
glslang
::
TIntermAggregate
*
);
bool
visitBinary
(
glslang
::
TVisit
,
glslang
::
TIntermBinary
*
);
...
...
@@ -111,6 +111,7 @@ public:
bool
visitLoop
(
glslang
::
TVisit
,
glslang
::
TIntermLoop
*
);
bool
visitBranch
(
glslang
::
TVisit
visit
,
glslang
::
TIntermBranch
*
);
void
finishSpv
();
void
dumpSpv
(
std
::
vector
<
unsigned
int
>&
out
);
protected
:
...
...
@@ -896,27 +897,27 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
default
:
break
;
}
}
// Finish
everything and dump
void
TGlslangToSpvTraverser
::
dumpSpv
(
std
::
vector
<
unsigned
int
>&
out
)
// Finish
creating SPV, after the traversal is complete.
void
TGlslangToSpvTraverser
::
finishSpv
(
)
{
if
(
!
mainTerminated
)
{
builder
.
setBuildPoint
(
shaderEntry
->
getLastBlock
());
builder
.
leaveFunction
();
}
// finish off the entry-point SPV instruction by adding the Input/Output <id>
for
(
auto
it
=
iOSet
.
cbegin
();
it
!=
iOSet
.
cend
();
++
it
)
entryPoint
->
addIdOperand
(
*
it
);
builder
.
eliminateDeadDecorations
();
builder
.
dump
(
out
);
}
TGlslangToSpvTraverser
::~
TGlslangToSpvTraverser
()
// Write the SPV into 'out'.
void
TGlslangToSpvTraverser
::
dumpSpv
(
std
::
vector
<
unsigned
int
>&
out
)
{
if
(
!
mainTerminated
)
{
spv
::
Block
*
lastMainBlock
=
shaderEntry
->
getLastBlock
();
builder
.
setBuildPoint
(
lastMainBlock
);
builder
.
leaveFunction
();
}
builder
.
dump
(
out
);
}
//
...
...
@@ -5120,9 +5121,8 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
glslang
::
GetThreadPoolAllocator
().
push
();
TGlslangToSpvTraverser
it
(
&
intermediate
,
logger
);
root
->
traverse
(
&
it
);
it
.
finishSpv
();
it
.
dumpSpv
(
spirv
);
glslang
::
GetThreadPoolAllocator
().
pop
();
...
...
Test/baseResults/hlsl.array.implicit-size.frag.out
View file @
fca82621
...
...
@@ -234,6 +234,7 @@ gl_FragCoord origin is upper left
Store 18(g_array) 24
Store 28(g_array_unused) 31
Store 37(g_mystruct) 42
Return
FunctionEnd
12(main(struct-PS_OUTPUT-vf41;): 2 Function None 10
11(ps_output): 9(ptr) FunctionParameter
...
...
Test/baseResults/hlsl.float1.frag.out
View file @
fca82621
...
...
@@ -92,6 +92,7 @@ gl_FragCoord origin is upper left
5: Label
Store 14(f1) 15
Store 16(scalar) 17
Return
FunctionEnd
11(ShaderFunction(vf1;f1;): 6(float) Function None 8
9(inFloat1): 7(ptr) FunctionParameter
...
...
Test/baseResults/hlsl.float4.frag.out
View file @
fca82621
...
...
@@ -82,6 +82,7 @@ gl_FragCoord origin is upper left
20: TypePointer Uniform 7(fvec4)
4(PixelShaderFunction): 2 Function None 3
5: Label
Return
FunctionEnd
11(ShaderFunction(vf4;): 7(fvec4) Function None 9
10(input): 8(ptr) FunctionParameter
...
...
Test/baseResults/hlsl.intrinsics.vert.out
View file @
fca82621
...
...
@@ -3011,6 +3011,7 @@ Shader version: 450
1059: 76 ConstantComposite 1058 1058 1058 1058
4(VertexShaderFunction): 2 Function None 3
5: Label
Return
FunctionEnd
16(VertexShaderFunctionS(f1;f1;f1;u1;u1;): 6(float) Function None 10
11(inF0): 7(ptr) FunctionParameter
...
...
Test/baseResults/hlsl.layout.frag.out
View file @
fca82621
...
...
@@ -119,6 +119,7 @@ gl_FragCoord origin is upper left
38: 17(int) SpecConstant 10
4(main): 2 Function None 3
5: Label
Return
FunctionEnd
11(PixelShaderFunction(vf4;): 7(fvec4) Function None 9
10(input): 8(ptr) FunctionParameter
...
...
Test/baseResults/hlsl.matType.frag.out
View file @
fca82621
...
...
@@ -90,6 +90,7 @@ gl_FragCoord origin is upper left
29: 28(ptr) Variable Uniform
4(PixelShaderFunction): 2 Function None 3
5: Label
Return
FunctionEnd
11(ShaderFunction(vf1;f1;): 6(float) Function None 8
9(inFloat1): 7(ptr) FunctionParameter
...
...
Test/baseResults/hlsl.shapeConv.frag.out
View file @
fca82621
...
...
@@ -282,6 +282,7 @@ gl_FragCoord origin is upper left
62: TypeVector 41(bool) 4
4(main): 2 Function None 3
5: Label
Return
FunctionEnd
13(PixelShaderFunction(vf4;f1;): 7(fvec4) Function None 10
11(input): 8(ptr) FunctionParameter
...
...
Test/baseResults/hlsl.swizzle.frag.out
View file @
fca82621
...
...
@@ -106,6 +106,7 @@ gl_FragCoord origin is upper left
4(PixelShaderFunction): 2 Function None 3
5: Label
Store 14(AmbientColor) 18
Return
FunctionEnd
11(ShaderFunction(vf4;): 7(fvec4) Function None 9
10(input): 8(ptr) FunctionParameter
...
...
Test/baseResults/hlsl.typedef.frag.out
View file @
fca82621
...
...
@@ -106,6 +106,7 @@ gl_FragCoord origin is upper left
20: 9(int) Constant 2
4(PixelShaderFunction): 2 Function None 3
5: Label
Return
FunctionEnd
14(ShaderFunction(vf4;i1;): 7(fvec4) Function None 11
12(input): 8(ptr) FunctionParameter
...
...
glslang/Include/revision.h
View file @
fca82621
...
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.165
0
"
#define GLSLANG_DATE "
14
-Nov-2016"
#define GLSLANG_REVISION "Overload400-PrecQual.165
9
"
#define GLSLANG_DATE "
26
-Nov-2016"
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