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
133253b6
Commit
133253b6
authored
Jun 05, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Front-end: Fix issue #147: ensure layout(index=N) has N in [0,1].
parent
119f8f69
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
330.frag
Test/330.frag
+3
-0
330.frag.out
Test/baseResults/330.frag.out
+4
-1
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+7
-0
No files found.
Test/330.frag
View file @
133253b6
...
@@ -148,3 +148,5 @@ void fooKeyMem()
...
@@ -148,3 +148,5 @@ void fooKeyMem()
{
{
KeyMem
.
precise
;
KeyMem
.
precise
;
}
}
layout
(
location
=
28
,
index
=
2
)
out
vec4
outIndex2
;
// ERROR index out of range
\ No newline at end of file
Test/baseResults/330.frag.out
View file @
133253b6
...
@@ -37,7 +37,8 @@ ERROR: 0:140: 'textureQueryLod' : no matching overloaded function found
...
@@ -37,7 +37,8 @@ ERROR: 0:140: 'textureQueryLod' : no matching overloaded function found
ERROR: 0:140: 'assign' : cannot convert from 'const float' to 'temp 2-component vector of float'
ERROR: 0:140: 'assign' : cannot convert from 'const float' to 'temp 2-component vector of float'
ERROR: 0:141: 'textureQueryLod' : no matching overloaded function found
ERROR: 0:141: 'textureQueryLod' : no matching overloaded function found
ERROR: 0:141: 'assign' : cannot convert from 'const float' to 'temp 2-component vector of float'
ERROR: 0:141: 'assign' : cannot convert from 'const float' to 'temp 2-component vector of float'
ERROR: 38 compilation errors. No code generated.
ERROR: 0:152: 'index' : value must be 0 or 1
ERROR: 39 compilation errors. No code generated.
Shader version: 330
Shader version: 330
...
@@ -122,6 +123,7 @@ ERROR: node is still EOpNull!
...
@@ -122,6 +123,7 @@ ERROR: node is still EOpNull!
0:? 'samp2Ds' (uniform sampler2DShadow)
0:? 'samp2Ds' (uniform sampler2DShadow)
0:? 'precise' (global int)
0:? 'precise' (global int)
0:? 'KeyMem' (global structure{global int precise})
0:? 'KeyMem' (global structure{global int precise})
0:? 'outIndex2' (layout(location=28 index=0 ) out 4-component vector of float)
Linked fragment stage:
Linked fragment stage:
...
@@ -211,4 +213,5 @@ ERROR: node is still EOpNull!
...
@@ -211,4 +213,5 @@ ERROR: node is still EOpNull!
0:? 'samp2Ds' (uniform sampler2DShadow)
0:? 'samp2Ds' (uniform sampler2DShadow)
0:? 'precise' (global int)
0:? 'precise' (global int)
0:? 'KeyMem' (global structure{global int precise})
0:? 'KeyMem' (global structure{global int precise})
0:? 'outIndex2' (layout(location=28 index=0 ) out 4-component vector of float)
glslang/MachineIndependent/ParseHelper.cpp
View file @
133253b6
...
@@ -4225,6 +4225,13 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
...
@@ -4225,6 +4225,13 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
requireProfile
(
loc
,
ECompatibilityProfile
|
ECoreProfile
,
"index layout qualifier on fragment output"
);
requireProfile
(
loc
,
ECompatibilityProfile
|
ECoreProfile
,
"index layout qualifier on fragment output"
);
const
char
*
exts
[
2
]
=
{
E_GL_ARB_separate_shader_objects
,
E_GL_ARB_explicit_attrib_location
};
const
char
*
exts
[
2
]
=
{
E_GL_ARB_separate_shader_objects
,
E_GL_ARB_explicit_attrib_location
};
profileRequires
(
loc
,
ECompatibilityProfile
|
ECoreProfile
,
330
,
2
,
exts
,
"index layout qualifier on fragment output"
);
profileRequires
(
loc
,
ECompatibilityProfile
|
ECoreProfile
,
330
,
2
,
exts
,
"index layout qualifier on fragment output"
);
// "It is also a compile-time error if a fragment shader sets a layout index to less than 0 or greater than 1."
if
(
value
<
0
||
value
>
1
)
{
value
=
0
;
error
(
loc
,
"value must be 0 or 1"
,
"index"
,
""
);
}
publicType
.
qualifier
.
layoutIndex
=
value
;
publicType
.
qualifier
.
layoutIndex
=
value
;
return
;
return
;
}
}
...
...
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