Commit 0f8a8d16 authored by Marek Olšák's avatar Marek Olšák

ext_gpu_shader4: add compiler tests for everything

parent 69fad0e5
......@@ -97,6 +97,18 @@ piglit_make_generated_tests(
templates/gen_texture_lod_tests/tex_grad.frag.mako
templates/gen_texture_lod_tests/frag_lod.glsl_parser_test.mako
)
piglit_make_generated_tests(
gpu_shader4_tests.list
gen_gpu_shader4_tests.py
templates/gen_gpu_shader4_tests/binary.frag.mako templates/gen_gpu_shader4_tests/texel_fetch.vert.mako templates/gen_gpu_shader4_tests/tex.vert.mako
templates/gen_gpu_shader4_tests/binary_op.frag.mako templates/gen_gpu_shader4_tests/tex.frag.mako templates/gen_gpu_shader4_tests/unary.frag.mako
templates/gen_gpu_shader4_tests/binary_op.vert.mako templates/gen_gpu_shader4_tests/tex_grad.frag.mako templates/gen_gpu_shader4_tests/unary_op.frag.mako
templates/gen_gpu_shader4_tests/binary.vert.mako templates/gen_gpu_shader4_tests/tex_grad.vert.mako templates/gen_gpu_shader4_tests/unary_op.vert.mako
templates/gen_gpu_shader4_tests/ternary.frag.mako templates/gen_gpu_shader4_tests/tex_lod.frag.mako templates/gen_gpu_shader4_tests/unary.vert.mako
templates/gen_gpu_shader4_tests/ternary.vert.mako templates/gen_gpu_shader4_tests/tex_lod.vert.mako templates/gen_gpu_shader4_tests/vec_compare.frag.mako
templates/gen_gpu_shader4_tests/tex_bias.frag.mako templates/gen_gpu_shader4_tests/texture_size.frag.mako templates/gen_gpu_shader4_tests/vec_compare.vert.mako
templates/gen_gpu_shader4_tests/texel_fetch.frag.mako templates/gen_gpu_shader4_tests/texture_size.vert.mako
)
piglit_make_generated_tests(
outerproduct_invalid_params.list
gen_outerproduct_invalid_params.py
......@@ -268,6 +280,7 @@ add_custom_target(gen-gl-tests
vp-tex.list
variable_index_write_tests.list
vs_in_fp64.list
gpu_shader4_tests.list
)
# Create a custom target for generating OpenCL tests
......
This diff is collapsed.
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
flat varying ${type1} x;
flat varying ${type2} y;
void main()
{
${type1} v = ${param.func}(x, y);
gl_FragColor = vec4(v${swizzle});
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
attribute vec4 pos;
attribute ${type1} x;
attribute ${type2} y;
flat varying ${type1} v;
void main()
{
gl_Position = pos;
v = ${param.func}(x, y);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
flat varying ${types[0]} x;
flat varying ${types[1]} y, z;
void main()
{
${result_type} v = x ${param.op} y;
v ${param.op}= z;
gl_FragColor = vec4(v${swizzle});
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
attribute vec4 pos;
attribute ${types[0]} x;
attribute ${types[1]} y, z;
flat varying ${result_type} v;
void main()
{
gl_Position = pos;
v = x ${param.op} y;
v ${param.op}= z;
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
flat varying ${type1} x;
flat varying ${type2} y, z;
void main()
{
${type1} v = ${param.func}(x, y, z);
gl_FragColor = vec4(v${swizzle});
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
attribute vec4 pos;
attribute ${type1} x;
attribute ${type2} y, z;
flat varying ${type1} v;
void main()
{
gl_Position = pos;
v = ${param.func}(x, y, z);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
flat varying ${param.coord} coord;
void main()
{
${prefix}vec4 v = ${param.func}${offset}(s, coord
% if offset == 'Offset':
, ${param.offsetcoord}(1)
% endif
);
gl_FragColor = vec4(v);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
attribute vec4 pos;
attribute ${param.coord} coord;
flat varying ${prefix}vec4 color;
void main()
{
gl_Position = pos;
color = ${param.func}${offset}(s, coord
% if offset == 'Offset':
, ${param.offsetcoord}(1)
% endif
);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
flat varying ${param.coord} coord;
varying float bias;
void main()
{
${prefix}vec4 v = ${param.func}${offset}(s, coord,
% if offset == 'Offset':
${param.offsetcoord}(1),
% endif
bias);
gl_FragColor = vec4(v);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
varying ${param.coord} coord;
varying ${param.grad} dPdx;
varying ${param.grad} dPdy;
void main()
{
${prefix}vec4 v = ${param.func}Grad${offset}(s, coord, dPdx, dPdy
% if offset == 'Offset':
, ${param.offsetcoord}(1)
% endif
);
gl_FragColor = vec4(v);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
attribute vec4 pos;
attribute ${param.coord} coord;
attribute ${param.grad} dPdx;
attribute ${param.grad} dPdy;
flat varying ${prefix}vec4 color;
void main()
{
gl_Position = pos;
color = ${param.func}Grad${offset}(s, coord, dPdx, dPdy
% if offset == 'Offset':
, ${param.offsetcoord}(1)
% endif
);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
flat varying ${param.coord} coord;
varying float lod;
void main()
{
${prefix}vec4 v = ${param.func}Lod${offset}(s, coord, lod
% if offset == 'Offset':
, ${param.offsetcoord}(1)
% endif
);
gl_FragColor = vec4(v);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
attribute vec4 pos;
attribute ${param.coord} coord;
attribute float lod;
flat varying ${prefix}vec4 color;
void main()
{
gl_Position = pos;
color = ${param.func}Lod${offset}(s, coord, lod
% if offset == 'Offset':
, ${param.offsetcoord}(1)
% endif
);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
flat varying ${param.coord} coord, offset;
flat varying int lod;
void main()
{
${prefix}vec4 v = texelFetch${param.sampler}${offset}(s, coord
% if param.sampler != '2DRect' and param.sampler != 'Buffer':
, lod
% endif
% if offset == 'Offset':
, ${param.offsetcoord}(1)
% endif
);
gl_FragColor = vec4(v);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
attribute vec4 pos;
attribute ${param.coord} coord;
attribute int lod;
flat varying ${prefix}vec4 color;
void main()
{
gl_Position = pos;
color = texelFetch${param.sampler}${offset}(s, coord
% if param.sampler != '2DRect' and param.sampler != 'Buffer':
, lod
% endif
% if offset == 'Offset':
, ${param.offsetcoord}(1)
% endif
);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
flat varying int lod;
void main()
{
${param.coord} v = textureSize${param.sampler}(s
% if param.sampler != '2DRect' and param.sampler != 'Buffer':
, lod
% endif
);
gl_FragColor = vec4(v${swizzle});
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: ${extensions}
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
uniform ${prefix}sampler${param.sampler} s;
attribute vec4 pos;
attribute int lod;
flat varying ${param.coord} size;
void main()
{
gl_Position = pos;
size = textureSize${param.sampler}(s
% if param.sampler != '2DRect' and param.sampler != 'Buffer':
, lod
% endif
);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
flat varying ${type1} x;
void main()
{
${type1} v = ${param.func}(x);
gl_FragColor = vec4(v${swizzle});
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
attribute vec4 pos;
attribute ${type1} x;
flat varying ${type1} v;
void main()
{
gl_Position = pos;
v = ${param.func}(x);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
flat varying ${type1} x;
void main()
{
${type1} v = ${param.op}x;
gl_FragColor = vec4(v${swizzle});
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
attribute vec4 pos;
attribute ${type1} x;
flat varying ${type1} v;
void main()
{
gl_Position = pos;
v = ${param.op}x;
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
flat varying ${type1} x, y;
void main()
{
${bvec} v = ${param.func}(x, y);
gl_FragColor = vec4(v${swizzle});
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
attribute vec4 pos;
attribute ${type1} x, y;
flat varying ${type1} v;
void main()
{
gl_Position = pos;
${bvec} b = ${param.func}(x, y);
v = ${type1}(b);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
attribute vec4 pos;
flat varying int v;
void main()
{
gl_Position = pos;
v = gl_InstanceID;
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
void main()
{
int v = gl_PrimitiveID;
gl_FragColor = vec4(v);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
attribute vec4 pos;
flat varying int v;
void main()
{
gl_Position = pos;
v = gl_VertexID;
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
attribute vec4 pos;
attribute unsigned int x;
uniform unsigned int w;
flat varying unsigned int v;
void main()
{
gl_Position = pos;
int i = int(pos.y);
unsigned int t = 1u;
unsigned int u = unsigned int(pos.x);
unsigned int v = unsigned int(i);
v = t + unsigned int(x + 2U) + u + v + w;
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
flat varying unsigned int u1[2];
flat varying uvec2 u2[2];
flat varying uvec3 u3[2];
flat varying uvec4 u4[2];
flat varying int i1[2];
flat varying ivec2 i2[2];
flat varying ivec3 i3[2];
flat varying ivec4 i4[2];
void main()
{
gl_FragColor = vec4(1.0);
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
flat varying float u1;
flat varying vec2 u2;
flat varying vec3 u3;
flat varying vec4 u4;
varying out float o1;
varying out vec2 o2;
varying out vec3 o3;
varying out vec4 o4;
void main()
{
o1 = u1;
o2 = u2;
o3 = u3;
o4 = u4;
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
flat varying int i1;
flat varying ivec2 i2;
flat varying ivec3 i3;
flat varying ivec4 i4;
flat varying unsigned int u1;
flat varying uvec2 u2;
flat varying uvec3 u3;
flat varying uvec4 u4;
varying out unsigned int o1;
varying out uvec2 o2;
varying out uvec3 o3;
varying out uvec4 o4;
varying out int o5;
varying out ivec2 o6;
varying out ivec3 o7;
varying out ivec4 o8;
void main()
{
o1 = u1;
o2 = u2;
o3 = u3;
o4 = u4;
o5 = i1;
o6 = i2;
o7 = i3;
o8 = i4;
}
/* [config]
* expect_result: pass
* glsl_version: 1.10
* require_extensions: GL_EXT_gpu_shader4
* [end config]
*/
#extension GL_EXT_gpu_shader4 : require
noperspective varying float temperature;
flat varying vec3 myColor;
centroid varying vec2 myTexCoord1;
noperspective varying vec2 myTexCoord2;
centroid noperspective varying vec2 myTexCoord3;
noperspective centroid varying vec2 myTexCoord4;
void main()
{
gl_FragColor = vec4(1.0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment