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
101ca388
Unverified
Commit
101ca388
authored
Oct 12, 2019
by
John Kessenich
Committed by
GitHub
Oct 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1880 from georgeouzou/master
Add support for GL_ARB_explicit_uniform_location
parents
469d27f2
01a50473
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
7 deletions
+52
-7
130.frag
Test/130.frag
+9
-0
330.frag
Test/330.frag
+14
-2
130.frag.out
Test/baseResults/130.frag.out
+10
-1
330.frag.out
Test/baseResults/330.frag.out
+11
-1
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+5
-3
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+2
-0
Versions.h
glslang/MachineIndependent/Versions.h
+1
-0
No files found.
Test/130.frag
View file @
101ca388
...
@@ -167,3 +167,12 @@ void qux2()
...
@@ -167,3 +167,12 @@ void qux2()
}
}
layout
(
early_fragment_tests
)
out
;
// ERROR
layout
(
early_fragment_tests
)
out
;
// ERROR
#extension GL_ARB_explicit_uniform_location : enable
layout
(
location
=
3
)
uniform
vec4
ucolor0
;
// ERROR: explicit attrib location is also required for version < 330
#extension GL_ARB_explicit_attrib_location : enable
layout
(
location
=
4
)
uniform
vec4
ucolor1
;
Test/330.frag
View file @
101ca388
...
@@ -149,4 +149,17 @@ void fooKeyMem()
...
@@ -149,4 +149,17 @@ void fooKeyMem()
KeyMem
.
precise
;
KeyMem
.
precise
;
}
}
layout
(
location
=
28
,
index
=
2
)
out
vec4
outIndex2
;
// ERROR index out of range
layout
(
location
=
28
,
index
=
2
)
out
vec4
outIndex2
;
// ERROR index out of range
\ No newline at end of file
layout
(
location
=
4
)
uniform
vec4
ucolor0
;
// ERROR: extension is not enabled
#extension GL_ARB_explicit_uniform_location : enable
layout
(
location
=
5
)
uniform
vec4
ucolor1
;
layout
(
location
=
6
)
uniform
ColorsBuffer
// ERROR: location cannot be applied in uniform buffer block
{
vec4
colors
[
128
];
}
colorsBuffer
;
Test/baseResults/130.frag.out
View file @
101ca388
...
@@ -29,10 +29,13 @@ ERROR: 0:153: 'early_fragment_tests' : not supported for this version or the ena
...
@@ -29,10 +29,13 @@ ERROR: 0:153: 'early_fragment_tests' : not supported for this version or the ena
ERROR: 0:154: 'image load store' : not supported for this version or the enabled extensions
ERROR: 0:154: 'image load store' : not supported for this version or the enabled extensions
ERROR: 0:154: 'iimage2D' : Reserved word.
ERROR: 0:154: 'iimage2D' : Reserved word.
ERROR: 0:169: 'early_fragment_tests' : can only apply to 'in'
ERROR: 0:169: 'early_fragment_tests' : can only apply to 'in'
ERROR: 28 compilation errors. No code generated.
ERROR: 0:173: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions
ERROR: 29 compilation errors. No code generated.
Shader version: 130
Shader version: 130
Requested GL_ARB_explicit_attrib_location
Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_gpu_shader5
Requested GL_ARB_gpu_shader5
Requested GL_ARB_separate_shader_objects
Requested GL_ARB_separate_shader_objects
Requested GL_ARB_shader_image_load_store
Requested GL_ARB_shader_image_load_store
...
@@ -402,12 +405,16 @@ ERROR: node is still EOpNull!
...
@@ -402,12 +405,16 @@ ERROR: node is still EOpNull!
0:? 'gl_FogFragCoord' ( smooth in float)
0:? 'gl_FogFragCoord' ( smooth in float)
0:? 'iimg2Dbad' (layout( r32i) uniform iimage2D)
0:? 'iimg2Dbad' (layout( r32i) uniform iimage2D)
0:? 'iimg2D' (layout( r32i) uniform iimage2D)
0:? 'iimg2D' (layout( r32i) uniform iimage2D)
0:? 'ucolor0' (layout( location=3) uniform 4-component vector of float)
0:? 'ucolor1' (layout( location=4) uniform 4-component vector of float)
Linked fragment stage:
Linked fragment stage:
Shader version: 130
Shader version: 130
Requested GL_ARB_explicit_attrib_location
Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_gpu_shader5
Requested GL_ARB_gpu_shader5
Requested GL_ARB_separate_shader_objects
Requested GL_ARB_separate_shader_objects
Requested GL_ARB_shader_image_load_store
Requested GL_ARB_shader_image_load_store
...
@@ -457,4 +464,6 @@ ERROR: node is still EOpNull!
...
@@ -457,4 +464,6 @@ ERROR: node is still EOpNull!
0:? 'gl_FogFragCoord' ( smooth in float)
0:? 'gl_FogFragCoord' ( smooth in float)
0:? 'iimg2Dbad' (layout( r32i) uniform iimage2D)
0:? 'iimg2Dbad' (layout( r32i) uniform iimage2D)
0:? 'iimg2D' (layout( r32i) uniform iimage2D)
0:? 'iimg2D' (layout( r32i) uniform iimage2D)
0:? 'ucolor0' (layout( location=3) uniform 4-component vector of float)
0:? 'ucolor1' (layout( location=4) uniform 4-component vector of float)
Test/baseResults/330.frag.out
View file @
101ca388
...
@@ -40,11 +40,14 @@ ERROR: 0:140: 'assign' : cannot convert from ' const float' to ' temp 2-compone
...
@@ -40,11 +40,14 @@ ERROR: 0:140: 'assign' : cannot convert from ' const float' to ' temp 2-compone
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: 0:152: 'index' : value must be 0 or 1
ERROR: 0:152: 'index' : value must be 0 or 1
ERROR: 41 compilation errors. No code generated.
ERROR: 0:154: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions
ERROR: 0:160: 'location' : cannot apply to uniform or buffer block
ERROR: 43 compilation errors. No code generated.
Shader version: 330
Shader version: 330
Requested GL_ARB_enhanced_layouts
Requested GL_ARB_enhanced_layouts
Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_separate_shader_objects
Requested GL_ARB_separate_shader_objects
ERROR: node is still EOpNull!
ERROR: node is still EOpNull!
0:8 Function Definition: main( ( global void)
0:8 Function Definition: main( ( global void)
...
@@ -126,6 +129,9 @@ ERROR: node is still EOpNull!
...
@@ -126,6 +129,9 @@ ERROR: node is still EOpNull!
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)
0:? 'outIndex2' (layout( location=28 index=0) out 4-component vector of float)
0:? 'ucolor0' (layout( location=4) uniform 4-component vector of float)
0:? 'ucolor1' (layout( location=5) uniform 4-component vector of float)
0:? 'colorsBuffer' (layout( location=6 column_major shared) uniform block{layout( column_major shared) uniform 128-element array of 4-component vector of float colors})
Linked fragment stage:
Linked fragment stage:
...
@@ -135,6 +141,7 @@ ERROR: Linking fragment stage: Cannot use both gl_FragColor and gl_FragData
...
@@ -135,6 +141,7 @@ ERROR: Linking fragment stage: Cannot use both gl_FragColor and gl_FragData
Shader version: 330
Shader version: 330
Requested GL_ARB_enhanced_layouts
Requested GL_ARB_enhanced_layouts
Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_separate_shader_objects
Requested GL_ARB_separate_shader_objects
ERROR: node is still EOpNull!
ERROR: node is still EOpNull!
0:8 Function Definition: main( ( global void)
0:8 Function Definition: main( ( global void)
...
@@ -191,4 +198,7 @@ ERROR: node is still EOpNull!
...
@@ -191,4 +198,7 @@ ERROR: node is still EOpNull!
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)
0:? 'outIndex2' (layout( location=28 index=0) out 4-component vector of float)
0:? 'ucolor0' (layout( location=4) uniform 4-component vector of float)
0:? 'ucolor1' (layout( location=5) uniform 4-component vector of float)
0:? 'colorsBuffer' (layout( location=6 column_major shared) uniform block{layout( column_major shared) uniform 128-element array of 4-component vector of float colors})
glslang/MachineIndependent/ParseHelper.cpp
View file @
101ca388
...
@@ -5149,7 +5149,8 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
...
@@ -5149,7 +5149,8 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
return
;
return
;
}
else
if
(
id
==
"location"
)
{
}
else
if
(
id
==
"location"
)
{
profileRequires
(
loc
,
EEsProfile
,
300
,
nullptr
,
"location"
);
profileRequires
(
loc
,
EEsProfile
,
300
,
nullptr
,
"location"
);
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
};
// GL_ARB_explicit_uniform_location requires 330 or GL_ARB_explicit_attrib_location we do not need to add it here
profileRequires
(
loc
,
~
EEsProfile
,
330
,
2
,
exts
,
"location"
);
profileRequires
(
loc
,
~
EEsProfile
,
330
,
2
,
exts
,
"location"
);
if
((
unsigned
int
)
value
>=
TQualifier
::
layoutLocationEnd
)
if
((
unsigned
int
)
value
>=
TQualifier
::
layoutLocationEnd
)
error
(
loc
,
"location is too large"
,
id
.
c_str
(),
""
);
error
(
loc
,
"location is too large"
,
id
.
c_str
(),
""
);
...
@@ -5909,8 +5910,9 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier
...
@@ -5909,8 +5910,9 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier
case
EvqBuffer
:
case
EvqBuffer
:
{
{
const
char
*
feature
=
"location qualifier on uniform or buffer"
;
const
char
*
feature
=
"location qualifier on uniform or buffer"
;
requireProfile
(
loc
,
EEsProfile
|
ECoreProfile
|
ECompatibilityProfile
,
feature
);
requireProfile
(
loc
,
EEsProfile
|
ECoreProfile
|
ECompatibilityProfile
|
ENoProfile
,
feature
);
profileRequires
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
430
,
nullptr
,
feature
);
profileRequires
(
loc
,
~
EEsProfile
,
330
,
E_GL_ARB_explicit_attrib_location
,
feature
);
profileRequires
(
loc
,
~
EEsProfile
,
430
,
E_GL_ARB_explicit_uniform_location
,
feature
);
profileRequires
(
loc
,
EEsProfile
,
310
,
nullptr
,
feature
);
profileRequires
(
loc
,
EEsProfile
,
310
,
nullptr
,
feature
);
break
;
break
;
}
}
...
...
glslang/MachineIndependent/Versions.cpp
View file @
101ca388
...
@@ -174,6 +174,7 @@ void TParseVersions::initializeExtensionBehavior()
...
@@ -174,6 +174,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior
[
E_GL_ARB_texture_cube_map_array
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_texture_cube_map_array
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_texture_lod
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_texture_lod
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_explicit_attrib_location
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_explicit_attrib_location
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_explicit_uniform_location
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_image_load_store
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_image_load_store
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_atomic_counters
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_atomic_counters
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_draw_parameters
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_draw_parameters
]
=
EBhDisable
;
...
@@ -378,6 +379,7 @@ void TParseVersions::getPreamble(std::string& preamble)
...
@@ -378,6 +379,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_ARB_texture_cube_map_array 1
\n
"
"#define GL_ARB_texture_cube_map_array 1
\n
"
"#define GL_ARB_shader_texture_lod 1
\n
"
"#define GL_ARB_shader_texture_lod 1
\n
"
"#define GL_ARB_explicit_attrib_location 1
\n
"
"#define GL_ARB_explicit_attrib_location 1
\n
"
"#define GL_ARB_explicit_uniform_location 1
\n
"
"#define GL_ARB_shader_image_load_store 1
\n
"
"#define GL_ARB_shader_image_load_store 1
\n
"
"#define GL_ARB_shader_atomic_counters 1
\n
"
"#define GL_ARB_shader_atomic_counters 1
\n
"
"#define GL_ARB_shader_draw_parameters 1
\n
"
"#define GL_ARB_shader_draw_parameters 1
\n
"
...
...
glslang/MachineIndependent/Versions.h
View file @
101ca388
...
@@ -126,6 +126,7 @@ const char* const E_GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layou
...
@@ -126,6 +126,7 @@ const char* const E_GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layou
const
char
*
const
E_GL_ARB_texture_cube_map_array
=
"GL_ARB_texture_cube_map_array"
;
const
char
*
const
E_GL_ARB_texture_cube_map_array
=
"GL_ARB_texture_cube_map_array"
;
const
char
*
const
E_GL_ARB_shader_texture_lod
=
"GL_ARB_shader_texture_lod"
;
const
char
*
const
E_GL_ARB_shader_texture_lod
=
"GL_ARB_shader_texture_lod"
;
const
char
*
const
E_GL_ARB_explicit_attrib_location
=
"GL_ARB_explicit_attrib_location"
;
const
char
*
const
E_GL_ARB_explicit_attrib_location
=
"GL_ARB_explicit_attrib_location"
;
const
char
*
const
E_GL_ARB_explicit_uniform_location
=
"GL_ARB_explicit_uniform_location"
;
const
char
*
const
E_GL_ARB_shader_image_load_store
=
"GL_ARB_shader_image_load_store"
;
const
char
*
const
E_GL_ARB_shader_image_load_store
=
"GL_ARB_shader_image_load_store"
;
const
char
*
const
E_GL_ARB_shader_atomic_counters
=
"GL_ARB_shader_atomic_counters"
;
const
char
*
const
E_GL_ARB_shader_atomic_counters
=
"GL_ARB_shader_atomic_counters"
;
const
char
*
const
E_GL_ARB_shader_draw_parameters
=
"GL_ARB_shader_draw_parameters"
;
const
char
*
const
E_GL_ARB_shader_draw_parameters
=
"GL_ARB_shader_draw_parameters"
;
...
...
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