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
63eed386
Commit
63eed386
authored
Apr 10, 2013
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional layout-related error checking.
git-svn-id:
https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21108
e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent
bcd79fe5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
18 deletions
+27
-18
300layout.frag
Test/300layout.frag
+4
-18
300layout.vert
Test/300layout.vert
+6
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+17
-0
No files found.
Test/300layout.frag
View file @
63eed386
#version 300 es
#version 300 es
in
vec4
pos
;
in
vec4
pos
;
in
vec4
color
;
layout
(
location
=
2
)
in
vec4
color
;
// ERROR
layout
(
location
=
7
)
out
vec4
c
;
layout
(
location
=
1
)
out
vec4
c
;
layout
(
location
=
3
)
out
vec4
p
;
layout
(
location
=
3
)
out
vec4
p
;
layout
(
location
=
4
)
out
vec4
q
[
2
];
//layout(std140) uniform Transform { // layout of this block is std140
// mat4 M1; // row_major
// layout(column_major) mat4 M2; // column major
// mat3 N1; // row_major
//};
//
//uniform T2 { // layout of this block is shared
//...
//};
//
//layout(column_major) uniform T3 { // shared and column_major
// mat4 M3; // column_major
// layout(row_major) mat4 m4; // row major
// mat3 N2; // column_major
//};
void
main
()
void
main
()
{
{
c
=
color
;
c
=
color
;
p
=
pos
;
p
=
pos
;
q
[
1
]
=
pos
;
}
}
Test/300layout.vert
View file @
63eed386
#version 300 es
#version 300 es
struct
s
{
vec4
v
;
};
layout
(
location
=
7
)
in
vec3
c
;
layout
(
location
=
7
)
in
vec3
c
;
layout
(
LocatioN
=
3
)
in
vec4
p
;
layout
(
LocatioN
=
3
)
in
vec4
p
;
layout
(
LocatioN
=
9
)
in
vec4
q
[
4
];
// ERROR, no array
layout
(
LocatioN
=
10
)
in
s
r
[
4
];
// ERROR, no struct
out
vec4
pos
;
out
vec4
pos
;
out
vec3
color
;
out
vec3
color
;
...
@@ -32,6 +36,8 @@ out badout { // ERROR
...
@@ -32,6 +36,8 @@ out badout { // ERROR
float
f
;
float
f
;
};
};
layout
(
location
=
10
)
out
vec4
badout
;
// ERROR
void
main
()
void
main
()
{
{
pos
=
p
*
(
tblock
.
M1
+
tblock
.
M2
+
M4
+
M3
+
t2m
);
pos
=
p
*
(
tblock
.
M1
+
tblock
.
M2
+
M4
+
M3
+
t2m
);
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
63eed386
...
@@ -886,6 +886,11 @@ bool TParseContext::arrayQualifierErrorCheck(int line, const TPublicType& type)
...
@@ -886,6 +886,11 @@ bool TParseContext::arrayQualifierErrorCheck(int line, const TPublicType& type)
if
(
type
.
qualifier
.
storage
==
EvqConst
)
if
(
type
.
qualifier
.
storage
==
EvqConst
)
profileRequires
(
line
,
ENoProfile
,
120
,
"GL_3DL_array_objects"
,
"const array"
);
profileRequires
(
line
,
ENoProfile
,
120
,
"GL_3DL_array_objects"
,
"const array"
);
if
(
type
.
qualifier
.
storage
==
EvqVaryingIn
&&
language
==
EShLangVertex
)
{
requireProfile
(
line
,
(
EProfileMask
)
~
EEsProfileMask
,
"vertex input arrays"
);
profileRequires
(
line
,
ENoProfile
,
150
,
0
,
"vertex input arrays"
);
}
return
false
;
return
false
;
}
}
...
@@ -1135,6 +1140,10 @@ void TParseContext::setLayoutQualifier(int line, TPublicType& publicType, TStrin
...
@@ -1135,6 +1140,10 @@ void TParseContext::setLayoutQualifier(int line, TPublicType& publicType, TStrin
error
(
line
,
"not supported"
,
"binding"
,
""
);
error
(
line
,
"not supported"
,
"binding"
,
""
);
else
else
error
(
line
,
"there is no such layout identifier taking an assigned value"
,
id
.
c_str
(),
""
);
error
(
line
,
"there is no such layout identifier taking an assigned value"
,
id
.
c_str
(),
""
);
// TODO: error check: make sure locations are non-overlapping across the whole stage
// TODO: error check: if more than one fragment output, all must have a location
// TODO: error check: output arrays can only be indexed with a constant (es 300)
}
}
// Merge any layout qualifier information from src into dst, leaving everything else in dst alone
// Merge any layout qualifier information from src into dst, leaving everything else in dst alone
...
@@ -1569,6 +1578,14 @@ void TParseContext::updateDefaults(int line, const TPublicType& publicType, cons
...
@@ -1569,6 +1578,14 @@ void TParseContext::updateDefaults(int line, const TPublicType& publicType, cons
cantHaveId
=
true
;
cantHaveId
=
true
;
defaultGlobalQualification
.
layoutPacking
=
qualifier
.
layoutPacking
;
defaultGlobalQualification
.
layoutPacking
=
qualifier
.
layoutPacking
;
}
}
}
else
if
(
qualifier
.
storage
==
EvqVaryingIn
)
{
if
(
qualifier
.
hasLayout
()
&&
language
!=
EShLangVertex
)
{
error
(
line
,
"can only use location layout qualifier on a vertex input or fragment output"
,
id
->
c_str
(),
""
);
}
}
else
if
(
qualifier
.
storage
==
EvqVaryingOut
)
{
if
(
qualifier
.
hasLayout
()
&&
language
!=
EShLangFragment
)
{
error
(
line
,
"can only use location layout qualifier on a vertex input or fragment output"
,
id
->
c_str
(),
""
);
}
}
}
if
(
cantHaveId
&&
id
)
{
if
(
cantHaveId
&&
id
)
{
...
...
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