Add link validation infrastructure for multiple compilation units per stage. Includes a new, straightforward, C++ interface to the front end.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22927 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-09-04 21:19:27 +00:00
parent 2f1eb37d82
commit 69f4b517c2
24 changed files with 655 additions and 161 deletions

View File

@@ -1,4 +1,4 @@
WARNING: 0:1: '#version' : statement missing: use #version on first line of shader
WARNING: #version: statement missing; use #version on first line of shader
0:? Sequence
0:4 Sequence
0:4 move second child to first child (highp float)

View File

@@ -1,4 +1,4 @@
WARNING: 0:1: '#version' : statement missing: use #version on first line of shader
WARNING: #version: statement missing; use #version on first line of shader
ERROR: 0:1: 'main' : function cannot take any parameter(s)
ERROR: 0:1: 'int' : main function cannot return a value
ERROR: 2 compilation errors. No code generated.

View File

@@ -0,0 +1,33 @@
mains1.frag
0:3Function Definition: main( (void)
0:3 Function Parameters:
mains2.frag
0:3Function Definition: main( (void)
0:3 Function Parameters:
noMain1.geom
ERROR: #version: geometry shaders require non-es profile and version 150 or above
ERROR: 1 compilation errors. No code generated.
0:3Function Definition: foo( (void)
0:3 Function Parameters:
noMain2.geom
0:3Function Definition: bar( (void)
0:3 Function Parameters:
Linked geometry stage:
ERROR: Missing entry point: Each stage requires one "void main()" entry point
Linked fragment stage:
ERROR: Too many entry points: Each stage can have at most one "void main()" entry point.

View File

@@ -0,0 +1,26 @@
noMain.vert
0:3Function Definition: foo( (void)
0:3 Function Parameters:
mains.frag
ERROR: 0:7: 'main' : function already has a body
ERROR: 1 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:3 Function Definition: main( (void)
0:3 Function Parameters:
0:7 Function Definition: main( (void)
0:7 Function Parameters:
Linked vertex stage:
ERROR: Missing entry point: Each stage requires one "void main()" entry point
Linked fragment stage:
ERROR: Too many entry points: Each stage can have at most one "void main()" entry point.

View File

@@ -1,4 +1,4 @@
WARNING: 0:1: '#version' : statement missing: use #version on first line of shader
WARNING: #version: statement missing; use #version on first line of shader
0:? Sequence
0:5 Function Definition: main( (void)
0:5 Function Parameters:

View File

@@ -1,4 +1,4 @@
ERROR: 0:1: '#version' : statement must appear first in ESSL shader; before comments or newlines
ERROR: #version: statement must appear first in es-profile shader; before comments or newlines
ERROR: 1 compilation errors. No code generated.
ERROR: node is still EOpNull!

View File

@@ -1,5 +1,4 @@
ERROR: #version: versions before 150 do not allow a profile token
ERROR: 0:1: '#version' : incorrect
ERROR: 0:38: 'attribute' : not supported in this stage: fragment
ERROR: 0:40: 'sampler2DRect' : Reserved word.
ERROR: 0:40: 'rectangle texture' : not supported for this version or the enabled extensions

9
Test/mains.frag Normal file
View File

@@ -0,0 +1,9 @@
#version 300 es
void main()
{
}
void main()
{
}

5
Test/mains1.frag Normal file
View File

@@ -0,0 +1,5 @@
#version 110
void main()
{
}

5
Test/mains2.frag Normal file
View File

@@ -0,0 +1,5 @@
#version 110
void main()
{
}

5
Test/noMain.vert Normal file
View File

@@ -0,0 +1,5 @@
#version 300 es
void foo()
{
}

5
Test/noMain1.geom Normal file
View File

@@ -0,0 +1,5 @@
#version 110
void foo()
{
}

5
Test/noMain2.geom Normal file
View File

@@ -0,0 +1,5 @@
#version 150
void bar()
{
}

View File

@@ -2,10 +2,28 @@
TARGETDIR=localResults
BASEDIR=baseResults
EXE=./glslangValidator.exe
#
# isolated compilation tests
#
while read t; do
echo Running $t...
b=`basename $t`
./glslangValidator.exe -i $t > $TARGETDIR/$b.out
b=`basename $t`
$EXE -i $t > $TARGETDIR/$b.out
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out
done < testlist
#
# grouped shaders for link tests
#
function runLinkTest {
echo Running $*...
$EXE -i -l $* > $TARGETDIR/$1.out
diff -b $BASEDIR/$1.out $TARGETDIR/$1.out
}
runLinkTest mains1.frag mains2.frag noMain1.geom noMain2.geom
runLinkTest noMain.vert mains.frag