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
3d9165fd
Commit
3d9165fd
authored
May 19, 2016
by
Rex Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parser: Redeclaration of gl_CullDistance is disallowed mistakenly.
parent
9af54c33
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
6 deletions
+59
-6
450.frag
Test/450.frag
+7
-0
450.frag.out
Test/baseResults/450.frag.out
+44
-4
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+6
-2
linkValidate.cpp
glslang/MachineIndependent/linkValidate.cpp
+2
-0
No files found.
Test/450.frag
View file @
3d9165fd
...
@@ -47,3 +47,10 @@ void foo()
...
@@ -47,3 +47,10 @@ void foo()
s
+=
imageSamples
(
i2dmsa
);
s
+=
imageSamples
(
i2dmsa
);
float
f
=
imageAtomicExchange
(
i2dmsa
,
ivec3
(
in3
),
2
,
4
.
5
);
float
f
=
imageAtomicExchange
(
i2dmsa
,
ivec3
(
in3
),
2
,
4
.
5
);
}
}
in
float
gl_CullDistance
[
6
];
float
cull
(
int
i
)
{
return
(
i
>=
6
)
?
gl_CullDistance
[
5
]
:
gl_CullDistance
[
i
];
}
Test/baseResults/450.frag.out
View file @
3d9165fd
...
@@ -51,7 +51,7 @@ Shader version: 450
...
@@ -51,7 +51,7 @@ Shader version: 450
0:18 move second child to first child (temp float)
0:18 move second child to first child (temp float)
0:18 'cull' (temp float)
0:18 'cull' (temp float)
0:18 direct index (smooth temp float CullDistance)
0:18 direct index (smooth temp float CullDistance)
0:18 'gl_CullDistance' (smooth in
implicitly-sized
array of float CullDistance)
0:18 'gl_CullDistance' (smooth in
6-element
array of float CullDistance)
0:18 Constant:
0:18 Constant:
0:18 2 (const int)
0:18 2 (const int)
0:19 Sequence
0:19 Sequence
...
@@ -130,12 +130,32 @@ Shader version: 450
...
@@ -130,12 +130,32 @@ Shader version: 450
0:48 2 (const int)
0:48 2 (const int)
0:48 Constant:
0:48 Constant:
0:48 4.500000
0:48 4.500000
0:53 Function Definition: cull(i1; (global float)
0:53 Function Parameters:
0:53 'i' (in int)
0:55 Sequence
0:55 Branch: Return with expression
0:55 Test condition and select (temp float)
0:55 Condition
0:55 Compare Greater Than or Equal (temp bool)
0:55 'i' (in int)
0:55 Constant:
0:55 6 (const int)
0:55 true case
0:55 direct index (smooth temp float CullDistance)
0:55 'gl_CullDistance' (smooth in 6-element array of float CullDistance)
0:55 Constant:
0:55 5 (const int)
0:55 false case
0:55 indirect index (smooth temp float CullDistance)
0:55 'gl_CullDistance' (smooth in 6-element array of float CullDistance)
0:55 'i' (in int)
0:? Linker Objects
0:? Linker Objects
0:? 'in1' (smooth in float)
0:? 'in1' (smooth in float)
0:? 'in2' (smooth in 2-component vector of float)
0:? 'in2' (smooth in 2-component vector of float)
0:? 'in3' (smooth in 3-component vector of float)
0:? 'in3' (smooth in 3-component vector of float)
0:? 'in4' (smooth in 4-component vector of float)
0:? 'in4' (smooth in 4-component vector of float)
0:? 'gl_CullDistance' (smooth in
implicitly-sized
array of float CullDistance)
0:? 'gl_CullDistance' (smooth in
6-element
array of float CullDistance)
0:? 's2dms' (uniform sampler2DMS)
0:? 's2dms' (uniform sampler2DMS)
0:? 'us2dmsa' (uniform usampler2DMSArray)
0:? 'us2dmsa' (uniform usampler2DMSArray)
0:? 'ii2dms' (layout(rgba32i ) uniform iimage2DMS)
0:? 'ii2dms' (layout(rgba32i ) uniform iimage2DMS)
...
@@ -195,7 +215,7 @@ Shader version: 450
...
@@ -195,7 +215,7 @@ Shader version: 450
0:18 move second child to first child (temp float)
0:18 move second child to first child (temp float)
0:18 'cull' (temp float)
0:18 'cull' (temp float)
0:18 direct index (smooth temp float CullDistance)
0:18 direct index (smooth temp float CullDistance)
0:18 'gl_CullDistance' (smooth in
3
-element array of float CullDistance)
0:18 'gl_CullDistance' (smooth in
6
-element array of float CullDistance)
0:18 Constant:
0:18 Constant:
0:18 2 (const int)
0:18 2 (const int)
0:19 Sequence
0:19 Sequence
...
@@ -274,12 +294,32 @@ Shader version: 450
...
@@ -274,12 +294,32 @@ Shader version: 450
0:48 2 (const int)
0:48 2 (const int)
0:48 Constant:
0:48 Constant:
0:48 4.500000
0:48 4.500000
0:53 Function Definition: cull(i1; (global float)
0:53 Function Parameters:
0:53 'i' (in int)
0:55 Sequence
0:55 Branch: Return with expression
0:55 Test condition and select (temp float)
0:55 Condition
0:55 Compare Greater Than or Equal (temp bool)
0:55 'i' (in int)
0:55 Constant:
0:55 6 (const int)
0:55 true case
0:55 direct index (smooth temp float CullDistance)
0:55 'gl_CullDistance' (smooth in 6-element array of float CullDistance)
0:55 Constant:
0:55 5 (const int)
0:55 false case
0:55 indirect index (smooth temp float CullDistance)
0:55 'gl_CullDistance' (smooth in 6-element array of float CullDistance)
0:55 'i' (in int)
0:? Linker Objects
0:? Linker Objects
0:? 'in1' (smooth in float)
0:? 'in1' (smooth in float)
0:? 'in2' (smooth in 2-component vector of float)
0:? 'in2' (smooth in 2-component vector of float)
0:? 'in3' (smooth in 3-component vector of float)
0:? 'in3' (smooth in 3-component vector of float)
0:? 'in4' (smooth in 4-component vector of float)
0:? 'in4' (smooth in 4-component vector of float)
0:? 'gl_CullDistance' (smooth in
3
-element array of float CullDistance)
0:? 'gl_CullDistance' (smooth in
6
-element array of float CullDistance)
0:? 's2dms' (uniform sampler2DMS)
0:? 's2dms' (uniform sampler2DMS)
0:? 'us2dmsa' (uniform usampler2DMSArray)
0:? 'us2dmsa' (uniform usampler2DMSArray)
0:? 'ii2dms' (layout(rgba32i ) uniform iimage2DMS)
0:? 'ii2dms' (layout(rgba32i ) uniform iimage2DMS)
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
3d9165fd
...
@@ -3268,6 +3268,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
...
@@ -3268,6 +3268,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
(
identifier
==
"gl_FragDepth"
&&
((
nonEsRedecls
&&
version
>=
420
)
||
esRedecls
))
||
(
identifier
==
"gl_FragDepth"
&&
((
nonEsRedecls
&&
version
>=
420
)
||
esRedecls
))
||
(
identifier
==
"gl_FragCoord"
&&
((
nonEsRedecls
&&
version
>=
150
)
||
esRedecls
))
||
(
identifier
==
"gl_FragCoord"
&&
((
nonEsRedecls
&&
version
>=
150
)
||
esRedecls
))
||
identifier
==
"gl_ClipDistance"
||
identifier
==
"gl_ClipDistance"
||
identifier
==
"gl_CullDistance"
||
identifier
==
"gl_FrontColor"
||
identifier
==
"gl_FrontColor"
||
identifier
==
"gl_BackColor"
||
identifier
==
"gl_BackColor"
||
identifier
==
"gl_FrontSecondaryColor"
||
identifier
==
"gl_FrontSecondaryColor"
||
...
@@ -3320,8 +3321,9 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
...
@@ -3320,8 +3321,9 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
error
(
loc
,
"cannot apply layout qualifier to"
,
"redeclaration"
,
symbol
->
getName
().
c_str
());
error
(
loc
,
"cannot apply layout qualifier to"
,
"redeclaration"
,
symbol
->
getName
().
c_str
());
if
(
qualifier
.
isMemory
()
||
qualifier
.
isAuxiliary
()
||
symbol
->
getType
().
getQualifier
().
storage
!=
qualifier
.
storage
)
if
(
qualifier
.
isMemory
()
||
qualifier
.
isAuxiliary
()
||
symbol
->
getType
().
getQualifier
().
storage
!=
qualifier
.
storage
)
error
(
loc
,
"cannot change storage, memory, or auxiliary qualification of"
,
"redeclaration"
,
symbol
->
getName
().
c_str
());
error
(
loc
,
"cannot change storage, memory, or auxiliary qualification of"
,
"redeclaration"
,
symbol
->
getName
().
c_str
());
}
else
if
(
identifier
==
"gl_TexCoord"
||
}
else
if
(
identifier
==
"gl_TexCoord"
||
identifier
==
"gl_ClipDistance"
)
{
identifier
==
"gl_ClipDistance"
||
identifier
==
"gl_CullDistance"
)
{
if
(
qualifier
.
hasLayout
()
||
qualifier
.
isMemory
()
||
qualifier
.
isAuxiliary
()
||
if
(
qualifier
.
hasLayout
()
||
qualifier
.
isMemory
()
||
qualifier
.
isAuxiliary
()
||
qualifier
.
nopersp
!=
symbolQualifier
.
nopersp
||
qualifier
.
flat
!=
symbolQualifier
.
flat
||
qualifier
.
nopersp
!=
symbolQualifier
.
nopersp
||
qualifier
.
flat
!=
symbolQualifier
.
flat
||
symbolQualifier
.
storage
!=
qualifier
.
storage
)
symbolQualifier
.
storage
!=
qualifier
.
storage
)
...
@@ -3744,6 +3746,8 @@ void TParseContext::arrayLimitCheck(const TSourceLoc& loc, const TString& identi
...
@@ -3744,6 +3746,8 @@ void TParseContext::arrayLimitCheck(const TSourceLoc& loc, const TString& identi
limitCheck
(
loc
,
size
,
"gl_MaxTextureCoords"
,
"gl_TexCoord array size"
);
limitCheck
(
loc
,
size
,
"gl_MaxTextureCoords"
,
"gl_TexCoord array size"
);
else
if
(
identifier
.
compare
(
"gl_ClipDistance"
)
==
0
)
else
if
(
identifier
.
compare
(
"gl_ClipDistance"
)
==
0
)
limitCheck
(
loc
,
size
,
"gl_MaxClipDistances"
,
"gl_ClipDistance array size"
);
limitCheck
(
loc
,
size
,
"gl_MaxClipDistances"
,
"gl_ClipDistance array size"
);
else
if
(
identifier
.
compare
(
"gl_CullDistance"
)
==
0
)
limitCheck
(
loc
,
size
,
"gl_MaxCullDistances"
,
"gl_CullDistance array size"
);
}
}
// See if the provided value is less than the symbol indicated by limit,
// See if the provided value is less than the symbol indicated by limit,
...
...
glslang/MachineIndependent/linkValidate.cpp
View file @
3d9165fd
...
@@ -392,6 +392,8 @@ void TIntermediate::finalCheck(TInfoSink& infoSink)
...
@@ -392,6 +392,8 @@ void TIntermediate::finalCheck(TInfoSink& infoSink)
if
(
inIoAccessed
(
"gl_ClipDistance"
)
&&
inIoAccessed
(
"gl_ClipVertex"
))
if
(
inIoAccessed
(
"gl_ClipDistance"
)
&&
inIoAccessed
(
"gl_ClipVertex"
))
error
(
infoSink
,
"Can only use one of gl_ClipDistance or gl_ClipVertex (gl_ClipDistance is preferred)"
);
error
(
infoSink
,
"Can only use one of gl_ClipDistance or gl_ClipVertex (gl_ClipDistance is preferred)"
);
if
(
inIoAccessed
(
"gl_CullDistance"
)
&&
inIoAccessed
(
"gl_ClipVertex"
))
error
(
infoSink
,
"Can only use one of gl_CullDistance or gl_ClipVertex (gl_ClipDistance is preferred)"
);
if
(
userOutputUsed
()
&&
(
inIoAccessed
(
"gl_FragColor"
)
||
inIoAccessed
(
"gl_FragData"
)))
if
(
userOutputUsed
()
&&
(
inIoAccessed
(
"gl_FragColor"
)
||
inIoAccessed
(
"gl_FragData"
)))
error
(
infoSink
,
"Cannot use gl_FragColor or gl_FragData when using user-defined outputs"
);
error
(
infoSink
,
"Cannot use gl_FragColor or gl_FragData when using user-defined outputs"
);
...
...
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