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
61d9fb90
Commit
61d9fb90
authored
Dec 13, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Semantics: 'invocations' defaults to 1, not 0.
'invocations' was using 0 as the "shader never set" flag and as the default. Formalize this and explicit set to 1 and link time.
parent
04bb8a01
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
34 additions
and
26 deletions
+34
-26
410.geom.out
Test/baseResults/410.geom.out
+2
-2
420.geom.out
Test/baseResults/420.geom.out
+2
-2
420_size_gl_in.geom.out
Test/baseResults/420_size_gl_in.geom.out
+2
-2
450.geom.out
Test/baseResults/450.geom.out
+2
-2
mains1.frag.out
Test/baseResults/mains1.frag.out
+3
-3
max_vertices_0.geom.out
Test/baseResults/max_vertices_0.geom.out
+2
-2
spv.150.geom.out
Test/baseResults/spv.150.geom.out
+1
-1
spv.330.geom.out
Test/baseResults/spv.330.geom.out
+1
-1
Types.h
glslang/Include/Types.h
+3
-3
revision.h
glslang/Include/revision.h
+2
-2
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+6
-3
linkValidate.cpp
glslang/MachineIndependent/linkValidate.cpp
+5
-1
localintermediate.h
glslang/MachineIndependent/localintermediate.h
+3
-2
No files found.
Test/baseResults/410.geom.out
View file @
61d9fb90
...
...
@@ -12,7 +12,7 @@ ERROR: 7 compilation errors. No code generated.
Shader version: 410
invocations =
0
invocations =
-1
max_vertices = -1
input primitive = none
output primitive = none
...
...
@@ -65,7 +65,7 @@ ERROR: Linking geometry stage: At least one shader must specify an output layout
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
Shader version: 410
invocations =
0
invocations =
1
max_vertices = -1
input primitive = none
output primitive = none
...
...
Test/baseResults/420.geom.out
View file @
61d9fb90
...
...
@@ -10,7 +10,7 @@ ERROR: 6 compilation errors. No code generated.
Shader version: 420
invocations =
0
invocations =
-1
max_vertices = -1
input primitive = triangles
output primitive = none
...
...
@@ -137,7 +137,7 @@ ERROR: Linking geometry stage: At least one shader must specify an output layout
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
Shader version: 420
invocations =
0
invocations =
1
max_vertices = -1
input primitive = triangles
output primitive = none
...
...
Test/baseResults/420_size_gl_in.geom.out
View file @
61d9fb90
...
...
@@ -5,7 +5,7 @@ ERROR: 1 compilation errors. No code generated.
Shader version: 420
invocations =
0
invocations =
-1
max_vertices = -1
input primitive = triangles
output primitive = none
...
...
@@ -44,7 +44,7 @@ ERROR: Linking geometry stage: At least one shader must specify an output layout
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
Shader version: 420
invocations =
0
invocations =
1
max_vertices = -1
input primitive = triangles
output primitive = none
...
...
Test/baseResults/450.geom.out
View file @
61d9fb90
...
...
@@ -2,7 +2,7 @@
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
Shader version: 450
invocations =
0
invocations =
-1
max_vertices = -1
input primitive = none
output primitive = none
...
...
@@ -40,7 +40,7 @@ ERROR: Linking geometry stage: At least one shader must specify an output layout
ERROR: Linking geometry stage: At least one shader must specify a layout(max_vertices = value)
Shader version: 450
invocations =
0
invocations =
1
max_vertices = -1
input primitive = none
output primitive = none
...
...
Test/baseResults/mains1.frag.out
View file @
61d9fb90
...
...
@@ -18,7 +18,7 @@ ERROR: 1 compilation errors. No code generated.
Shader version: 150
invocations =
0
invocations =
-1
max_vertices = -1
input primitive = none
output primitive = points
...
...
@@ -29,7 +29,7 @@ ERROR: node is still EOpNull!
noMain2.geom
Shader version: 150
invocations =
0
invocations =
-1
max_vertices = -1
input primitive = none
output primitive = line_strip
...
...
@@ -52,7 +52,7 @@ ERROR: Linking fragment stage: Multiple function bodies in multiple compilation
main(
Shader version: 150
invocations =
0
invocations =
1
max_vertices = -1
input primitive = none
output primitive = points
...
...
Test/baseResults/max_vertices_0.geom.out
View file @
61d9fb90
max_vertices_0.geom
Shader version: 330
invocations =
0
invocations =
-1
max_vertices = 0
input primitive = points
output primitive = triangle_strip
...
...
@@ -19,7 +19,7 @@ Linked geometry stage:
Shader version: 330
invocations =
0
invocations =
1
max_vertices = 0
input primitive = points
output primitive = triangle_strip
...
...
Test/baseResults/spv.150.geom.out
View file @
61d9fb90
...
...
@@ -12,7 +12,7 @@ Linked geometry stage:
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 18 70 10 29 33
ExecutionMode 4 InputTrianglesAdjacency
ExecutionMode 4 Invocations
0
ExecutionMode 4 Invocations
1
ExecutionMode 4 OutputTriangleStrip
ExecutionMode 4 OutputVertices 30
Source GLSL 150
...
...
Test/baseResults/spv.330.geom.out
View file @
61d9fb90
...
...
@@ -12,7 +12,7 @@ Linked geometry stage:
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 20 13
ExecutionMode 4 Triangles
ExecutionMode 4 Invocations
0
ExecutionMode 4 Invocations
1
ExecutionMode 4 OutputTriangleStrip
ExecutionMode 4 OutputVertices 3
Source GLSL 330
...
...
glslang/Include/Types.h
View file @
61d9fb90
...
...
@@ -775,7 +775,7 @@ struct TShaderQualifiers {
TLayoutGeometry
geometry
;
// geometry/tessellation shader in/out primitives
bool
pixelCenterInteger
;
// fragment shader
bool
originUpperLeft
;
// fragment shader
int
invocations
;
// 0 means no declaration
int
invocations
;
int
vertices
;
// both for tessellation "vertices" and geometry "max_vertices"
TVertexSpacing
spacing
;
TVertexOrder
order
;
...
...
@@ -790,7 +790,7 @@ struct TShaderQualifiers {
geometry
=
ElgNone
;
originUpperLeft
=
false
;
pixelCenterInteger
=
false
;
invocations
=
0
;
// 0 means no declaration
invocations
=
TQualifier
::
layoutNotSet
;
vertices
=
TQualifier
::
layoutNotSet
;
spacing
=
EvsNone
;
order
=
EvoNone
;
...
...
@@ -813,7 +813,7 @@ struct TShaderQualifiers {
pixelCenterInteger
=
src
.
pixelCenterInteger
;
if
(
src
.
originUpperLeft
)
originUpperLeft
=
src
.
originUpperLeft
;
if
(
src
.
invocations
!=
0
)
if
(
src
.
invocations
!=
TQualifier
::
layoutNotSet
)
invocations
=
src
.
invocations
;
if
(
src
.
vertices
!=
TQualifier
::
layoutNotSet
)
vertices
=
src
.
vertices
;
...
...
glslang/Include/revision.h
View file @
61d9fb90
...
...
@@ -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 "SPIRV99.84
1
"
#define GLSLANG_DATE "1
2
-Dec-2015"
#define GLSLANG_REVISION "SPIRV99.84
2
"
#define GLSLANG_DATE "1
3
-Dec-2015"
glslang/MachineIndependent/ParseHelper.cpp
View file @
61d9fb90
...
...
@@ -3889,7 +3889,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
case
EShLangGeometry
:
if
(
id
==
"invocations"
)
{
profileRequires
(
loc
,
ECompatibilityProfile
|
ECoreProfile
,
400
,
nullptr
,
"invocations"
);
publicType
.
shaderQualifiers
.
invocations
=
value
;
if
(
value
==
0
)
error
(
loc
,
"must be at least 1"
,
"invocations"
,
""
);
else
publicType
.
shaderQualifiers
.
invocations
=
value
;
return
;
}
if
(
id
==
"max_vertices"
)
{
...
...
@@ -4276,7 +4279,7 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua
if
(
shaderQualifiers
.
geometry
!=
ElgNone
)
error
(
loc
,
message
,
TQualifier
::
getGeometryString
(
shaderQualifiers
.
geometry
),
""
);
if
(
shaderQualifiers
.
invocations
>
0
)
if
(
shaderQualifiers
.
invocations
!=
TQualifier
::
layoutNotSet
)
error
(
loc
,
message
,
"invocations"
,
""
);
if
(
shaderQualifiers
.
vertices
!=
TQualifier
::
layoutNotSet
)
{
if
(
language
==
EShLangGeometry
)
...
...
@@ -5453,7 +5456,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
if
(
language
==
EShLangTessControl
)
checkIoArraysConsistency
(
loc
);
}
if
(
publicType
.
shaderQualifiers
.
invocations
)
{
if
(
publicType
.
shaderQualifiers
.
invocations
!=
TQualifier
::
layoutNotSet
)
{
if
(
publicType
.
qualifier
.
storage
!=
EvqVaryingIn
)
error
(
loc
,
"can only apply to 'in'"
,
"invocations"
,
""
);
if
(
!
intermediate
.
setInvocations
(
publicType
.
shaderQualifiers
.
invocations
))
...
...
glslang/MachineIndependent/linkValidate.cpp
View file @
61d9fb90
...
...
@@ -359,6 +359,10 @@ void TIntermediate::finalCheck(TInfoSink& infoSink)
// overlap/alias/missing I/O, etc.
inOutLocationCheck
(
infoSink
);
// invocations
if
(
invocations
==
TQualifier
::
layoutNotSet
)
invocations
=
1
;
if
(
inIoAccessed
(
"gl_ClipDistance"
)
&&
inIoAccessed
(
"gl_ClipVertex"
))
error
(
infoSink
,
"Can only use one of gl_ClipDistance or gl_ClipVertex (gl_ClipDistance is preferred)"
);
...
...
@@ -561,7 +565,7 @@ void TIntermediate::inOutLocationCheck(TInfoSink& infoSink)
if
(
profile
==
EEsProfile
)
{
if
(
numFragOut
>
1
&&
fragOutWithNoLocation
)
error
(
infoSink
,
"when more than one fragment shader output, all must have location qualifiers"
);
}
}
}
TIntermSequence
&
TIntermediate
::
findLinkerObjects
()
const
...
...
glslang/MachineIndependent/localintermediate.h
View file @
61d9fb90
...
...
@@ -126,7 +126,8 @@ class TIntermediate {
public
:
explicit
TIntermediate
(
EShLanguage
l
,
int
v
=
0
,
EProfile
p
=
ENoProfile
)
:
language
(
l
),
treeRoot
(
0
),
profile
(
p
),
version
(
v
),
spv
(
0
),
numMains
(
0
),
numErrors
(
0
),
recursive
(
false
),
invocations
(
0
),
vertices
(
TQualifier
::
layoutNotSet
),
inputPrimitive
(
ElgNone
),
outputPrimitive
(
ElgNone
),
pixelCenterInteger
(
false
),
originUpperLeft
(
false
),
invocations
(
TQualifier
::
layoutNotSet
),
vertices
(
TQualifier
::
layoutNotSet
),
inputPrimitive
(
ElgNone
),
outputPrimitive
(
ElgNone
),
pixelCenterInteger
(
false
),
originUpperLeft
(
false
),
vertexSpacing
(
EvsNone
),
vertexOrder
(
EvoNone
),
pointMode
(
false
),
earlyFragmentTests
(
false
),
depthLayout
(
EldNone
),
depthReplacing
(
false
),
blendEquations
(
0
),
xfbMode
(
false
)
{
localSize
[
0
]
=
1
;
...
...
@@ -204,7 +205,7 @@ public:
bool
setInvocations
(
int
i
)
{
if
(
invocations
>
0
)
if
(
invocations
!=
TQualifier
::
layoutNotSet
)
return
invocations
==
i
;
invocations
=
i
;
return
true
;
...
...
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