Added initial tests for --glsl-version

- Added compilation tests for shader stages using a different
  version at each stage.
This commit is contained in:
Hai Nguyen 2022-01-10 09:43:44 -05:00
parent 1f10dddac4
commit 6a3aeb73cd
12 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1 @@
glsl.versionOverride.comp

View File

@ -0,0 +1 @@
glsl.versionOverride.frag

View File

@ -0,0 +1 @@
glsl.versionOverride.geom

View File

@ -0,0 +1 @@
glsl.versionOverride.tese

View File

@ -0,0 +1 @@
glsl.versionOverride.vert

View File

@ -0,0 +1,11 @@
/*
glslangValidator.exe --glsl-version 460 -V -S comp -o glsl.versionOverride.comp.out glsl.versionOverride.comp
*/
#version 330
void main()
{
}

View File

@ -0,0 +1,11 @@
/*
glslangValidator.exe --glsl-version 420 -V -S frag -o glsl.versionOverride.frag.out glsl.versionOverride.frag
*/
#version 330
void main()
{
}

View File

@ -0,0 +1,16 @@
/*
glslangValidator.exe --glsl-version 430 -V -S geom -o glsl.versionOverride.geom.out glsl.versionOverride.geom
*/
#version 330
layout (points) in;
layout (line_strip, max_vertices = 2) out;
void main() {
EmitVertex();
EmitVertex();
EndPrimitive();
}

View File

@ -0,0 +1,13 @@
/*
glslangValidator.exe --glsl-version 440 -V -S tesc -o glsl.versionOverride.tesc.out glsl.versionOverride.tesc
*/
#version 330
layout(vertices = 3) out;
void main()
{
}

View File

@ -0,0 +1,13 @@
/*
glslangValidator.exe --glsl-version 450 -V -S tese -o glsl.versionOverride.tese.out glsl.versionOverride.tese
*/
#version 330
layout(triangles) in;
void main()
{
}

View File

@ -0,0 +1,11 @@
/*
glslangValidator.exe --glsl-version 410 -V -S vert -o glsl.versionOverride.vert.out glsl.versionOverride.vert
*/
#version 330
void main()
{
}

View File

@ -298,6 +298,22 @@ diff -b $BASEDIR/hlsl.autosampledtextures.frag.out $TARGETDIR/hlsl.autosampledte
run --auto-sampled-textures -H -Od -S frag glsl.autosampledtextures.frag > $TARGETDIR/glsl.autosampledtextures.frag.out
diff -b $BASEDIR/glsl.autosampledtextures.frag.out $TARGETDIR/glsl.autosampledtextures.frag.out || HASERROR=1
# Test --glsl-version
#
echo "Testing --glsl-version"
run --glsl-version 410 -V -S vert glsl.versionOverride.vert > $TARGETDIR/glsl.versionOverride.vert.out
diff -b $BASEDIR/glsl.versionOverride.vert.out $TARGETDIR/glsl.versionOverride.vert.out || HASERROR=1
run --glsl-version 420 -V -S frag glsl.versionOverride.frag > $TARGETDIR/glsl.versionOverride.frag.out
diff -b $BASEDIR/glsl.versionOverride.frag.out $TARGETDIR/glsl.versionOverride.frag.out || HASERROR=1
run --glsl-version 430 -V -S geom glsl.versionOverride.geom > $TARGETDIR/glsl.versionOverride.geom.out
diff -b $BASEDIR/glsl.versionOverride.geom.out $TARGETDIR/glsl.versionOverride.geom.out || HASERROR=1
run --glsl-version 440 -V -S tesc glsl.versionOverride.tesc > $TARGETDIR/glsl.versionOverride.tesc.out
diff -b $BASEDIR/glsl.versionOverride.tesc.out $TARGETDIR/glsl.versionOverride.tesc.out || HASERROR=1
run --glsl-version 450 -V -S tese glsl.versionOverride.tese > $TARGETDIR/glsl.versionOverride.tese.out
diff -b $BASEDIR/glsl.versionOverride.tese.out $TARGETDIR/glsl.versionOverride.tese.out || HASERROR=1
run --glsl-version 460 -V -S comp glsl.versionOverride.comp > $TARGETDIR/glsl.versionOverride.comp.out
diff -b $BASEDIR/glsl.versionOverride.comp.out $TARGETDIR/glsl.versionOverride.comp.out || HASERROR=1
#
# Final checking
#