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
7bfd08d2
Commit
7bfd08d2
authored
May 25, 2016
by
Thomas Perl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for linking multiple ES shaders to the same stage
parent
0bb546f8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
168 deletions
+21
-168
empty.frag.out
Test/baseResults/empty.frag.out
+1
-10
es-link1.frag.out
Test/baseResults/es-link1.frag.out
+1
-22
link1.frag.out
Test/baseResults/link1.frag.out
+1
-132
ShaderLang.cpp
glslang/MachineIndependent/ShaderLang.cpp
+17
-0
linkValidate.cpp
glslang/MachineIndependent/linkValidate.cpp
+0
-4
Link.FromFile.cpp
gtests/Link.FromFile.cpp
+1
-0
No files found.
Test/baseResults/empty.frag.out
View file @
7bfd08d2
...
@@ -13,14 +13,5 @@ Shader version: 110
...
@@ -13,14 +13,5 @@ Shader version: 110
0:? Sequence
0:? Sequence
0:? Linker Objects
0:? Linker Objects
ERROR: Cannot mix ES profile with non-ES profile shaders
Linked fragment stage:
ERROR: Linking fragment stage: Cannot mix ES profile with non-ES profile shaders
ERROR: Linking fragment stage: Missing entry point: Each stage requires one "void main()" entry point
Shader version: 110
0:? Sequence
0:? Linker Objects
Test/baseResults/es-link1.frag.out
View file @
7bfd08d2
...
@@ -23,26 +23,5 @@ Shader version: 100
...
@@ -23,26 +23,5 @@ Shader version: 100
0:? Linker Objects
0:? Linker Objects
0:? 'varyingColor' (smooth in mediump 4-component vector of float)
0:? 'varyingColor' (smooth in mediump 4-component vector of float)
ERROR: Cannot attach multiple ES shaders of the same type to a single program
Linked fragment stage:
Shader version: 100
0:? Sequence
0:5 Function Definition: main( (global void)
0:5 Function Parameters:
0:7 Sequence
0:7 move second child to first child (temp mediump 4-component vector of float)
0:7 'gl_FragColor' (fragColor mediump 4-component vector of float FragColor)
0:7 Function Call: calculateColor( (global mediump 4-component vector of float)
0:5 Function Definition: calculateColor( (global mediump 4-component vector of float)
0:5 Function Parameters:
0:7 Sequence
0:7 Branch: Return with expression
0:7 vector-scale (temp mediump 4-component vector of float)
0:7 'varyingColor' (smooth in mediump 4-component vector of float)
0:7 Constant:
0:7 0.500000
0:? Linker Objects
0:? 'varyingColor' (smooth in mediump 4-component vector of float)
Test/baseResults/link1.frag.out
View file @
7bfd08d2
...
@@ -158,136 +158,5 @@ Requested GL_OES_texture_3D
...
@@ -158,136 +158,5 @@ Requested GL_OES_texture_3D
0:? Linker Objects
0:? Linker Objects
0:? 'iv3' (smooth in highp 2-component vector of float)
0:? 'iv3' (smooth in highp 2-component vector of float)
ERROR: Cannot mix ES profile with non-ES profile shaders
Linked fragment stage:
ERROR: Linking fragment stage: Types must match:
glass: "uniform 3-component vector of float" versus "uniform 2-component vector of float"
ERROR: Linking fragment stage: Interpolation and auxiliary storage qualifiers must match:
cup: "smooth in 4-component vector of float" versus "flat in 4-component vector of float"
ERROR: Linking fragment stage: Initializers must match:
cv3e
ERROR: Linking fragment stage: Initializers must match:
um2e
ERROR: Linking fragment stage: Initializers must match:
se
ERROR: Linking fragment stage: Cannot mix ES profile with non-ES profile shaders
ERROR: Linking fragment stage: Types must match:
ERROR: Linking fragment stage: Precision qualifiers must match:
iv3: "smooth in 3-component vector of float" versus "smooth in highp 2-component vector of float"
Shader version: 300
Requested GL_OES_EGL_image_external
Requested GL_OES_standard_derivatives
Requested GL_OES_texture_3D
0:? Sequence
0:8 Sequence
0:8 move second child to first child (temp 4-component vector of float)
0:8 'a' (global 4-component vector of float)
0:8 vector-scale (temp 4-component vector of float)
0:8 Constant:
0:8 8.000000
0:8 'uv4' (uniform 4-component vector of float)
0:13 Function Definition: main( (global void)
0:13 Function Parameters:
0:17 Sequence
0:17 move second child to first child (temp 4-component vector of float)
0:17 'b' (global 4-component vector of float)
0:17 vector-scale (temp 4-component vector of float)
0:17 Constant:
0:17 8.000000
0:17 'a' (global 4-component vector of float)
0:19 Function Definition: foo(mf22; (global 2-component vector of int)
0:19 Function Parameters:
0:19 'm' (in 2X2 matrix of float)
0:21 Sequence
0:21 Branch: Return with expression
0:21 Convert float to int (temp 2-component vector of int)
0:21 direct index (temp 2-component vector of float)
0:21 'm' (in 2X2 matrix of float)
0:21 Constant:
0:21 0 (const int)
0:24 Sequence
0:24 move second child to first child (temp 4-component vector of float)
0:24 'c' (global 4-component vector of float)
0:24 component-wise multiply (temp 4-component vector of float)
0:24 'b' (global 4-component vector of float)
0:24 'b' (global 4-component vector of float)
0:8 Sequence
0:8 move second child to first child (temp 4-component vector of float)
0:8 'd' (global 4-component vector of float)
0:8 vector-scale (temp 4-component vector of float)
0:8 Constant:
0:8 8.000000
0:8 'uv4' (uniform 4-component vector of float)
0:13 Sequence
0:13 move second child to first child (temp 4-component vector of float)
0:13 'e' (global 4-component vector of float)
0:13 vector-scale (temp 4-component vector of float)
0:13 Constant:
0:13 8.000000
0:13 'd' (global 4-component vector of float)
0:15 Function Definition: foo( (global 2-component vector of int)
0:15 Function Parameters:
0:17 Sequence
0:17 Branch: Return with expression
0:17 Constant:
0:17 2 (const int)
0:17 2 (const int)
0:20 Sequence
0:20 move second child to first child (temp 4-component vector of float)
0:20 'f' (global 4-component vector of float)
0:20 component-wise multiply (temp 4-component vector of float)
0:20 'e' (global 4-component vector of float)
0:20 'e' (global 4-component vector of float)
0:? Linker Objects
0:? 'uv4' (uniform 4-component vector of float)
0:? 'glass' (uniform 3-component vector of float)
0:? 'ci' (const int)
0:? 8 (const int)
0:? 'a' (global 4-component vector of float)
0:? 'iv3' (smooth in 3-component vector of float)
0:? 'cup' (smooth in 4-component vector of float)
0:? 'b' (global 4-component vector of float)
0:? 'c' (global 4-component vector of float)
0:? 'cv3' (const 3-component vector of float)
0:? 43.000000
0:? 0.340000
0:? 9.900000
0:? 'cv3n' (const 3-component vector of float)
0:? 43.000000
0:? 0.340000
0:? 9.900000
0:? 'cv3e' (const 3-component vector of float)
0:? 43.000000
0:? 0.340000
0:? 9.900000
0:? 'um2' (uniform 2X2 matrix of float)
0:? 4.000000
0:? 0.000000
0:? 0.000000
0:? 4.000000
0:? 'um2n' (uniform 2X2 matrix of float)
0:? 4.000000
0:? 0.000000
0:? 0.000000
0:? 4.000000
0:? 'um2e' (uniform 2X2 matrix of float)
0:? 4.000000
0:? 0.000000
0:? 0.000000
0:? 4.000000
0:? 's' (uniform structure{global int a, global float b})
0:? 82 (const int)
0:? 3.900000
0:? 'sn' (uniform structure{global int a, global float b})
0:? 82 (const int)
0:? 3.900000
0:? 'se' (uniform structure{global int a, global float b})
0:? 82 (const int)
0:? 3.900000
0:? 'd' (global 4-component vector of float)
0:? 'e' (global 4-component vector of float)
0:? 'f' (global 4-component vector of float)
glslang/MachineIndependent/ShaderLang.cpp
View file @
7bfd08d2
...
@@ -1526,6 +1526,23 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
...
@@ -1526,6 +1526,23 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
if
(
stages
[
stage
].
size
()
==
0
)
if
(
stages
[
stage
].
size
()
==
0
)
return
true
;
return
true
;
int
numEsShaders
=
0
,
numNonEsShaders
=
0
;
for
(
auto
it
=
stages
[
stage
].
begin
();
it
!=
stages
[
stage
].
end
();
++
it
)
{
if
((
*
it
)
->
intermediate
->
getProfile
()
==
EEsProfile
)
{
numEsShaders
++
;
}
else
{
numNonEsShaders
++
;
}
}
if
(
numEsShaders
>
0
&&
numNonEsShaders
>
0
)
{
infoSink
->
info
.
message
(
EPrefixError
,
"Cannot mix ES profile with non-ES profile shaders"
);
return
false
;
}
else
if
(
numEsShaders
>
1
)
{
infoSink
->
info
.
message
(
EPrefixError
,
"Cannot attach multiple ES shaders of the same type to a single program"
);
return
false
;
}
//
//
// Be efficient for the common single compilation unit per stage case,
// Be efficient for the common single compilation unit per stage case,
// reusing it's TIntermediate instead of merging into a new one.
// reusing it's TIntermediate instead of merging into a new one.
...
...
glslang/MachineIndependent/linkValidate.cpp
View file @
7bfd08d2
...
@@ -86,10 +86,6 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit)
...
@@ -86,10 +86,6 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit)
numPushConstants
+=
unit
.
numPushConstants
;
numPushConstants
+=
unit
.
numPushConstants
;
callGraph
.
insert
(
callGraph
.
end
(),
unit
.
callGraph
.
begin
(),
unit
.
callGraph
.
end
());
callGraph
.
insert
(
callGraph
.
end
(),
unit
.
callGraph
.
begin
(),
unit
.
callGraph
.
end
());
if
((
profile
!=
EEsProfile
&&
unit
.
profile
==
EEsProfile
)
||
(
profile
==
EEsProfile
&&
unit
.
profile
!=
EEsProfile
))
error
(
infoSink
,
"Cannot mix ES profile with non-ES profile shaders
\n
"
);
if
(
originUpperLeft
!=
unit
.
originUpperLeft
||
pixelCenterInteger
!=
unit
.
pixelCenterInteger
)
if
(
originUpperLeft
!=
unit
.
originUpperLeft
||
pixelCenterInteger
!=
unit
.
pixelCenterInteger
)
error
(
infoSink
,
"gl_FragCoord redeclarations must match across shaders
\n
"
);
error
(
infoSink
,
"gl_FragCoord redeclarations must match across shaders
\n
"
);
...
...
gtests/Link.FromFile.cpp
View file @
7bfd08d2
...
@@ -99,6 +99,7 @@ INSTANTIATE_TEST_CASE_P(
...
@@ -99,6 +99,7 @@ INSTANTIATE_TEST_CASE_P(
{
"empty.frag"
,
"empty2.frag"
,
"empty3.frag"
},
{
"empty.frag"
,
"empty2.frag"
,
"empty3.frag"
},
{
"150.tesc"
,
"150.tese"
,
"400.tesc"
,
"400.tese"
,
"410.tesc"
,
"420.tesc"
,
"420.tese"
},
{
"150.tesc"
,
"150.tese"
,
"400.tesc"
,
"400.tese"
,
"410.tesc"
,
"420.tesc"
,
"420.tese"
},
{
"max_vertices_0.geom"
},
{
"max_vertices_0.geom"
},
{
"es-link1.frag"
,
"es-link2.frag"
},
})),
})),
);
);
// clang-format on
// clang-format on
...
...
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