diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2014-08-13 02:04:28 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2014-08-27 23:35:52 -0400 |
commit | 5d34f4f599fdda90ffd372c87fa5efbfa35c9c75 (patch) | |
tree | 4ca9b029b99d4c0e81d5679c530db35a7eebb3ad | |
parent | dbae79984df02ff133df7bc507691dae89a05c09 (diff) |
arb_tessellation_shader: add simple data passing tests
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
5 files changed, 298 insertions, 0 deletions
diff --git a/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test b/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test new file mode 100644 index 000000000..a902c005c --- /dev/null +++ b/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test @@ -0,0 +1,58 @@ +[require] +GLSL >= 1.50 +GL_ARB_tessellation_shader + + +[vertex shader passthrough] + +[tessellation control shader] +#extension GL_ARB_tessellation_shader: require +layout(vertices = 3) out; + +patch out vec4 color; + +void main() { + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; + gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0); + gl_TessLevelInner = float[2](0.0, 0.0); + color = vec4(0, 1, 0, 1); +} + + +[tessellation evaluation shader] +#extension GL_ARB_tessellation_shader: require +layout(triangles) in; + +patch in vec4 color; +out vec4 color_fs; + +void main() { + gl_Position = gl_in[0].gl_Position * gl_TessCoord[0] + + gl_in[1].gl_Position * gl_TessCoord[1] + + gl_in[2].gl_Position * gl_TessCoord[2]; + + color_fs = color; +} + + +[fragment shader] +in vec4 color_fs; + +void main() +{ + gl_FragColor = color_fs; +} + +[vertex data] +piglit_vertex/float/2 +-1.0 -1.0 + 1.0 -1.0 +-1.0 1.0 +-1.0 1.0 + 1.0 -1.0 + 1.0 1.0 + +[test] +patch parameter vertices 3 +draw arrays GL_PATCHES 0 6 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test b/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test new file mode 100644 index 000000000..a7dacba70 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test @@ -0,0 +1,61 @@ +[require] +GLSL >= 1.50 +GL_ARB_tessellation_shader + + +[vertex shader passthrough] + + +[tessellation control shader] +#extension GL_ARB_tessellation_shader: require +layout(vertices = 3) out; + +out vec4 color[]; + +void main() { + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; + gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0); + gl_TessLevelInner = float[2](0.0, 0.0); + color[gl_InvocationID] = vec4(0, 1, 0, 1); +} + + +[tessellation evaluation shader] +#extension GL_ARB_tessellation_shader: require +layout(triangles) in; + +in vec4 color[]; +out vec4 color_fs; + +void main() { + gl_Position = gl_in[0].gl_Position * gl_TessCoord[0] + + gl_in[1].gl_Position * gl_TessCoord[1] + + gl_in[2].gl_Position * gl_TessCoord[2]; + + color_fs = color[0] * gl_TessCoord[0] + + color[1] * gl_TessCoord[1] + + color[2] * gl_TessCoord[2]; +} + + +[fragment shader] +in vec4 color_fs; + +void main() +{ + gl_FragColor = color_fs; +} + +[vertex data] +piglit_vertex/float/2 +-1.0 -1.0 + 1.0 -1.0 +-1.0 1.0 +-1.0 1.0 + 1.0 -1.0 + 1.0 1.0 + +[test] +patch parameter vertices 3 +draw arrays GL_PATCHES 0 6 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test b/tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test new file mode 100644 index 000000000..73632d126 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test @@ -0,0 +1,54 @@ +[require] +GLSL >= 1.50 +GL_ARB_tessellation_shader + + +[vertex shader passthrough] + +[tessellation control shader] +#extension GL_ARB_tessellation_shader: require +layout(vertices = 3) out; + +void main() { + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; + gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0); + gl_TessLevelInner = float[2](0.0, 0.0); +} + + +[tessellation evaluation shader] +#extension GL_ARB_tessellation_shader: require +layout(triangles) in; + +out vec4 color_fs; + +void main() { + gl_Position = gl_in[0].gl_Position * gl_TessCoord[0] + + gl_in[1].gl_Position * gl_TessCoord[1] + + gl_in[2].gl_Position * gl_TessCoord[2]; + + color_fs = vec4(0, 1, 0, 1); +} + + +[fragment shader] +in vec4 color_fs; + +void main() +{ + gl_FragColor = color_fs; +} + +[vertex data] +piglit_vertex/float/2 +-1.0 -1.0 + 1.0 -1.0 +-1.0 1.0 +-1.0 1.0 + 1.0 -1.0 + 1.0 1.0 + +[test] +patch parameter vertices 3 +draw arrays GL_PATCHES 0 6 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test new file mode 100644 index 000000000..550ff25e5 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test @@ -0,0 +1,70 @@ +[require] +GLSL >= 1.50 +GL_ARB_tessellation_shader + + +[vertex shader] +in vec4 vertex; +out vec4 color; + +void main() +{ + gl_Position = vertex; + color = vec4(0, 1, 0, 1); +} + + +[tessellation control shader] +#extension GL_ARB_tessellation_shader: require +layout(vertices = 3) out; + +in vec4 color[]; +out vec4 color_tes[]; + +void main() { + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; + gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0); + gl_TessLevelInner = float[2](0.0, 0.0); + color_tes[gl_InvocationID] = color[gl_InvocationID]; +} + + +[tessellation evaluation shader] +#extension GL_ARB_tessellation_shader: require +layout(triangles) in; + +in vec4 color_tes[]; +out vec4 color_fs; + +void main() { + gl_Position = gl_in[0].gl_Position * gl_TessCoord[0] + + gl_in[1].gl_Position * gl_TessCoord[1] + + gl_in[2].gl_Position * gl_TessCoord[2]; + + color_fs = color_tes[0] * gl_TessCoord[0] + + color_tes[1] * gl_TessCoord[1] + + color_tes[2] * gl_TessCoord[2]; +} + + +[fragment shader] +in vec4 color_fs; + +void main() +{ + gl_FragColor = color_fs; +} + +[vertex data] +vertex/float/2 +-1.0 -1.0 + 1.0 -1.0 +-1.0 1.0 +-1.0 1.0 + 1.0 -1.0 + 1.0 1.0 + +[test] +patch parameter vertices 3 +draw arrays GL_PATCHES 0 6 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/arb_tessellation_shader/execution/vs-tes-vertex.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tes-vertex.shader_test new file mode 100644 index 000000000..9bf509881 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/execution/vs-tes-vertex.shader_test @@ -0,0 +1,55 @@ +[require] +GLSL >= 1.50 +GL_ARB_tessellation_shader + + +[vertex shader] +in vec4 vertex; +out vec4 color; + +void main() +{ + gl_Position = vertex; + color = vec4(0, 1, 0, 1); +} + + +[tessellation evaluation shader] +#extension GL_ARB_tessellation_shader: require +layout(triangles) in; + +in vec4 color[]; +out vec4 color_fs; + +void main() { + gl_Position = gl_in[0].gl_Position * gl_TessCoord[0] + + gl_in[1].gl_Position * gl_TessCoord[1] + + gl_in[2].gl_Position * gl_TessCoord[2]; + + color_fs = color[0] * gl_TessCoord[0] + + color[1] * gl_TessCoord[1] + + color[2] * gl_TessCoord[2]; +} + + +[fragment shader] +in vec4 color_fs; + +void main() +{ + gl_FragColor = color_fs; +} + +[vertex data] +vertex/float/2 +-1.0 -1.0 + 1.0 -1.0 +-1.0 1.0 +-1.0 1.0 + 1.0 -1.0 + 1.0 1.0 + +[test] +patch parameter vertices 3 +draw arrays GL_PATCHES 0 6 +probe all rgba 0.0 1.0 0.0 1.0 |