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
f2d8a5c5
Commit
f2d8a5c5
authored
Mar 03, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Use heuristic to avoid geometry multi-streams when possible.
parent
2ac71dfb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
6 deletions
+14
-6
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+2
-2
spv.330.geom.out
Test/baseResults/spv.330.geom.out
+0
-3
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+7
-0
localintermediate.h
glslang/MachineIndependent/localintermediate.h
+5
-1
No files found.
SPIRV/GlslangToSpv.cpp
View file @
f2d8a5c5
...
@@ -1803,7 +1803,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
...
@@ -1803,7 +1803,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
// Decorate the structure
// Decorate the structure
addDecoration
(
spvType
,
TranslateLayoutDecoration
(
type
,
qualifier
.
layoutMatrix
));
addDecoration
(
spvType
,
TranslateLayoutDecoration
(
type
,
qualifier
.
layoutMatrix
));
addDecoration
(
spvType
,
TranslateBlockDecoration
(
type
));
addDecoration
(
spvType
,
TranslateBlockDecoration
(
type
));
if
(
type
.
getQualifier
().
hasStream
())
{
if
(
type
.
getQualifier
().
hasStream
()
&&
glslangIntermediate
->
isMultiStream
()
)
{
builder
.
addCapability
(
spv
::
CapabilityGeometryStreams
);
builder
.
addCapability
(
spv
::
CapabilityGeometryStreams
);
builder
.
addDecoration
(
spvType
,
spv
::
DecorationStream
,
type
.
getQualifier
().
layoutStream
);
builder
.
addDecoration
(
spvType
,
spv
::
DecorationStream
,
type
.
getQualifier
().
layoutStream
);
}
}
...
@@ -3599,7 +3599,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
...
@@ -3599,7 +3599,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
}
}
addDecoration
(
id
,
TranslateInvariantDecoration
(
symbol
->
getType
().
getQualifier
()));
addDecoration
(
id
,
TranslateInvariantDecoration
(
symbol
->
getType
().
getQualifier
()));
if
(
symbol
->
getQualifier
().
hasStream
())
{
if
(
symbol
->
getQualifier
().
hasStream
()
&&
glslangIntermediate
->
isMultiStream
()
)
{
builder
.
addCapability
(
spv
::
CapabilityGeometryStreams
);
builder
.
addCapability
(
spv
::
CapabilityGeometryStreams
);
builder
.
addDecoration
(
id
,
spv
::
DecorationStream
,
symbol
->
getQualifier
().
layoutStream
);
builder
.
addDecoration
(
id
,
spv
::
DecorationStream
,
symbol
->
getQualifier
().
layoutStream
);
}
}
...
...
Test/baseResults/spv.330.geom.out
View file @
f2d8a5c5
...
@@ -9,7 +9,6 @@ Linked geometry stage:
...
@@ -9,7 +9,6 @@ Linked geometry stage:
Capability Geometry
Capability Geometry
Capability ClipDistance
Capability ClipDistance
Capability GeometryStreams
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 13 20
EntryPoint Geometry 4 "main" 13 20
...
@@ -31,8 +30,6 @@ Linked geometry stage:
...
@@ -31,8 +30,6 @@ Linked geometry stage:
MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 11(gl_PerVertex) 1 BuiltIn ClipDistance
MemberDecorate 11(gl_PerVertex) 1 BuiltIn ClipDistance
Decorate 11(gl_PerVertex) Block
Decorate 11(gl_PerVertex) Block
Decorate 11(gl_PerVertex) Stream 0
Decorate 13 Stream 0
MemberDecorate 16(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 16(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 16(gl_PerVertex) 1 BuiltIn ClipDistance
MemberDecorate 16(gl_PerVertex) 1 BuiltIn ClipDistance
Decorate 16(gl_PerVertex) Block
Decorate 16(gl_PerVertex) Block
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
f2d8a5c5
...
@@ -1524,6 +1524,11 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
...
@@ -1524,6 +1524,11 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
}
}
break
;
break
;
case
EOpEmitStreamVertex
:
case
EOpEndStreamPrimitive
:
intermediate
.
setMultiStream
();
break
;
default
:
default
:
break
;
break
;
}
}
...
@@ -4050,6 +4055,8 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
...
@@ -4050,6 +4055,8 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
if
(
id
==
"stream"
)
{
if
(
id
==
"stream"
)
{
requireProfile
(
loc
,
~
EEsProfile
,
"selecting output stream"
);
requireProfile
(
loc
,
~
EEsProfile
,
"selecting output stream"
);
publicType
.
qualifier
.
layoutStream
=
value
;
publicType
.
qualifier
.
layoutStream
=
value
;
if
(
value
>
0
)
intermediate
.
setMultiStream
();
return
;
return
;
}
}
break
;
break
;
...
...
glslang/MachineIndependent/localintermediate.h
View file @
f2d8a5c5
...
@@ -128,7 +128,8 @@ public:
...
@@ -128,7 +128,8 @@ public:
numMains
(
0
),
numErrors
(
0
),
numPushConstants
(
0
),
recursive
(
false
),
numMains
(
0
),
numErrors
(
0
),
numPushConstants
(
0
),
recursive
(
false
),
invocations
(
TQualifier
::
layoutNotSet
),
vertices
(
TQualifier
::
layoutNotSet
),
inputPrimitive
(
ElgNone
),
outputPrimitive
(
ElgNone
),
invocations
(
TQualifier
::
layoutNotSet
),
vertices
(
TQualifier
::
layoutNotSet
),
inputPrimitive
(
ElgNone
),
outputPrimitive
(
ElgNone
),
pixelCenterInteger
(
false
),
originUpperLeft
(
false
),
pixelCenterInteger
(
false
),
originUpperLeft
(
false
),
vertexSpacing
(
EvsNone
),
vertexOrder
(
EvoNone
),
pointMode
(
false
),
earlyFragmentTests
(
false
),
depthLayout
(
EldNone
),
depthReplacing
(
false
),
blendEquations
(
0
),
xfbMode
(
false
)
vertexSpacing
(
EvsNone
),
vertexOrder
(
EvoNone
),
pointMode
(
false
),
earlyFragmentTests
(
false
),
depthLayout
(
EldNone
),
depthReplacing
(
false
),
blendEquations
(
0
),
multiStream
(
false
),
xfbMode
(
false
)
{
{
localSize
[
0
]
=
1
;
localSize
[
0
]
=
1
;
localSize
[
1
]
=
1
;
localSize
[
1
]
=
1
;
...
@@ -271,6 +272,8 @@ public:
...
@@ -271,6 +272,8 @@ public:
void
setXfbMode
()
{
xfbMode
=
true
;
}
void
setXfbMode
()
{
xfbMode
=
true
;
}
bool
getXfbMode
()
const
{
return
xfbMode
;
}
bool
getXfbMode
()
const
{
return
xfbMode
;
}
void
setMultiStream
()
{
multiStream
=
true
;
}
bool
isMultiStream
()
const
{
return
multiStream
;
}
bool
setOutputPrimitive
(
TLayoutGeometry
p
)
bool
setOutputPrimitive
(
TLayoutGeometry
p
)
{
{
if
(
outputPrimitive
!=
ElgNone
)
if
(
outputPrimitive
!=
ElgNone
)
...
@@ -361,6 +364,7 @@ protected:
...
@@ -361,6 +364,7 @@ protected:
bool
depthReplacing
;
bool
depthReplacing
;
int
blendEquations
;
// an 'or'ing of masks of shifts of TBlendEquationShift
int
blendEquations
;
// an 'or'ing of masks of shifts of TBlendEquationShift
bool
xfbMode
;
bool
xfbMode
;
bool
multiStream
;
typedef
std
::
list
<
TCall
>
TGraph
;
typedef
std
::
list
<
TCall
>
TGraph
;
TGraph
callGraph
;
TGraph
callGraph
;
...
...
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