2 ## Copyright © 2016 Intel Corporation
4 ## Permission is hereby granted, free of charge, to any person obtaining a copy
5 ## of this software and associated documentation files (the "Software"), to deal
6 ## in the Software without restriction, including without limitation the rights
7 ## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 ## copies of the Software, and to permit persons to whom the Software is
9 ## furnished to do so, subject to the following conditions:
11 ## The above copyright notice and this permission notice shall be included in
12 ## all copies or substantial portions of the Software.
14 ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 ## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 ## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 if ver == 'GL_ARB_vertex_attrib_64bit':
25 glsl_version_int = '150'
27 glsl_version_int = ver
29 glsl_version = '{}.{}'.format(glsl_version_int[0], glsl_version_int[1:3])
31 return (glsl_version, glsl_version_int)
33 <% glsl, glsl_int = _version(ver) %>
37 % if ver == 'GL_ARB_vertex_attrib_64bit':
38 GL_ARB_gpu_shader_fp64
41 GL_MAX_VERTEX_ATTRIBS >= ${num_vs_in}
45 % if ver == 'GL_ARB_vertex_attrib_64bit':
46 #extension GL_ARB_gpu_shader_fp64 : require
47 #extension GL_ARB_vertex_attrib_64bit : require
50 % for idx, in_type in enumerate(in_types):
51 % for vidx in range(4):
52 uniform ${in_type.name} expected${idx}${vidx}${'[{}]'.format(arrays[idx]) if arrays[idx] - 1 else ''};
55 % for idx, in_type in enumerate(in_types):
56 in ${in_type.name} value${idx}${'[{}]'.format(arrays[idx]) if arrays[idx] - 1 else ''};
58 in vec3 piglit_vertex;
61 #define RED vec4(1.0, 0.0, 0.0, 1.0)
62 #define GREEN vec4(0.0, 1.0, 0.0, 1.0)
66 gl_Position = vec4(piglit_vertex.x, piglit_vertex.y, 0.0, 1.0);
67 % for vidx, vertex in enumerate(['-1.0', '0.0', '1.0', '2.0']):
68 if (piglit_vertex.z == ${vertex}) {
69 % for idx, in_type in enumerate(in_types):
70 if (value${idx} != expected${idx}${vidx}) {
92 % for idx, in_type in enumerate(in_types):
93 % if idx == position_order - 1:
94 piglit_vertex/float/vec3 \
96 % for i in range(arrays[idx]):
97 % for j in range(in_type.columns):
98 value${idx}${'[{}]'.format(i) if arrays[idx] > 1 else ''}/${gl_types[idx]}/${in_type.name}${'/{}'.format(j) if in_type.columns > 1 else ''} \
102 % if position_order > len(in_types):
103 piglit_vertex/float/vec3\
106 % for d in range(len(gl_types_values['double'])):
107 % for vidx, vertex in enumerate(['-1.0 -1.0 -1.0', ' 1.0 -1.0 0.0', ' 1.0 1.0 1.0', '-1.0 1.0 2.0']):
108 % for idx, in_type in enumerate(in_types):
109 % if idx == position_order - 1:
112 % for i in range(arrays[idx]):
113 % for j in range(in_type.columns):
114 % for k in range(in_type.rows):
115 ${gl_types_values[gl_types[idx]][(d + (i * in_type.columns + j) * in_type.rows + k + vidx) % len(gl_types_values[gl_types[idx]])]} \
121 % if position_order > len(in_types):
129 % for d in range(len(gl_types_values['double'])):
131 % for vidx in range(4):
132 % for idx, in_type in enumerate(in_types):
133 % for i in range(arrays[idx]):
134 uniform ${in_type.name} expected${idx}${vidx}${'[{}]'.format(i) if arrays[idx] > 1 else ''}\
135 % for j in range(in_type.columns):
136 % for k in range(in_type.rows):
137 ## Careful: these are the values for the VBO type, not the uniform type. If we use the hex format they should match or the run will fail.
138 ${gl_types_values[gl_types[idx]][(d + (i * in_type.columns + j) * in_type.rows + k + vidx) % len(gl_types_values[gl_types[idx]])]}\
145 clear color 0.0 0.0 1.0 0.0
147 draw arrays GL_TRIANGLE_FAN ${d * 4} 4
148 probe all rgba 0.0 1.0 0.0 1.0