• Home
  • Raw
  • Download

Lines Matching refs:ctx

45 void bind_buffer (NegativeTestContext& ctx)  in bind_buffer()  argument
47 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the allowable values."); in bind_buffer()
48 ctx.glBindBuffer(-1, 0); in bind_buffer()
49 ctx.expectError(GL_INVALID_ENUM); in bind_buffer()
50 ctx.endSection(); in bind_buffer()
53 void delete_buffers (NegativeTestContext& ctx) in delete_buffers() argument
55 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative."); in delete_buffers()
56 ctx.glDeleteBuffers(-1, 0); in delete_buffers()
57 ctx.expectError(GL_INVALID_VALUE); in delete_buffers()
58 ctx.endSection(); in delete_buffers()
61 void gen_buffers (NegativeTestContext& ctx) in gen_buffers() argument
63 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative."); in gen_buffers()
64 ctx.glGenBuffers(-1, 0); in gen_buffers()
65 ctx.expectError(GL_INVALID_VALUE); in gen_buffers()
66 ctx.endSection(); in gen_buffers()
69 void buffer_data (NegativeTestContext& ctx) in buffer_data() argument
72 ctx.glGenBuffers(1, &buffer); in buffer_data()
73 ctx.glBindBuffer(GL_ARRAY_BUFFER, buffer); in buffer_data()
75ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_ARRAY_BUFFER or GL_ELEMENT_ARRA… in buffer_data()
76 ctx.glBufferData(-1, 0, NULL, GL_STREAM_DRAW); in buffer_data()
77 ctx.expectError(GL_INVALID_ENUM); in buffer_data()
78 ctx.endSection(); in buffer_data()
80ctx.beginSection("GL_INVALID_ENUM is generated if usage is not GL_STREAM_DRAW, GL_STATIC_DRAW, or … in buffer_data()
81 ctx.glBufferData(GL_ARRAY_BUFFER, 0, NULL, -1); in buffer_data()
82 ctx.expectError(GL_INVALID_ENUM); in buffer_data()
83 ctx.endSection(); in buffer_data()
85 ctx.beginSection("GL_INVALID_VALUE is generated if size is negative."); in buffer_data()
86 ctx.glBufferData(GL_ARRAY_BUFFER, -1, NULL, GL_STREAM_DRAW); in buffer_data()
87 ctx.expectError(GL_INVALID_VALUE); in buffer_data()
88 ctx.endSection(); in buffer_data()
90ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound … in buffer_data()
91 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0); in buffer_data()
92 ctx.glBufferData(GL_ARRAY_BUFFER, 0, NULL, GL_STREAM_DRAW); in buffer_data()
93 ctx.expectError(GL_INVALID_OPERATION); in buffer_data()
94 ctx.endSection(); in buffer_data()
96 ctx.glDeleteBuffers(1, &buffer); in buffer_data()
99 void buffer_sub_data (NegativeTestContext& ctx) in buffer_sub_data() argument
102 ctx.glGenBuffers(1, &buffer); in buffer_sub_data()
103 ctx.glBindBuffer(GL_ARRAY_BUFFER, buffer); in buffer_sub_data()
104 ctx.glBufferData(GL_ARRAY_BUFFER, 10, 0, GL_STREAM_DRAW); in buffer_sub_data()
106ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_ARRAY_BUFFER or GL_ELEMENT_ARRA… in buffer_sub_data()
107 ctx.glBufferSubData(-1, 1, 1, 0); in buffer_sub_data()
108 ctx.expectError(GL_INVALID_ENUM); in buffer_sub_data()
109 ctx.endSection(); in buffer_sub_data()
111ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound … in buffer_sub_data()
112 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0); in buffer_sub_data()
113 ctx.glBufferSubData(GL_ARRAY_BUFFER, 1, 1, 0); in buffer_sub_data()
114 ctx.expectError(GL_INVALID_OPERATION); in buffer_sub_data()
115 ctx.endSection(); in buffer_sub_data()
117ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer object being updated is mapped."… in buffer_sub_data()
118 ctx.glBindBuffer(GL_ARRAY_BUFFER, buffer); in buffer_sub_data()
119 ctx.glMapBufferRange(GL_ARRAY_BUFFER, 0, 5, GL_MAP_READ_BIT); in buffer_sub_data()
120 ctx.expectError(GL_NO_ERROR); in buffer_sub_data()
121 ctx.glBufferSubData(GL_ARRAY_BUFFER, 1, 1, 0); in buffer_sub_data()
122 ctx.expectError(GL_INVALID_OPERATION); in buffer_sub_data()
123 ctx.endSection(); in buffer_sub_data()
125 ctx.glDeleteBuffers(1, &buffer); in buffer_sub_data()
128 void buffer_sub_data_size_offset (NegativeTestContext& ctx) in buffer_sub_data_size_offset() argument
131 ctx.glGenBuffers(1, &buffer); in buffer_sub_data_size_offset()
132 ctx.glBindBuffer(GL_ARRAY_BUFFER, buffer); in buffer_sub_data_size_offset()
133 ctx.glBufferData(GL_ARRAY_BUFFER, 10, 0, GL_STREAM_DRAW); in buffer_sub_data_size_offset()
135ctx.beginSection("GL_INVALID_VALUE is generated if offset or size is negative, or if together they… in buffer_sub_data_size_offset()
136 ctx.glBufferSubData(GL_ARRAY_BUFFER, -1, 1, 0); in buffer_sub_data_size_offset()
137 ctx.expectError(GL_INVALID_VALUE); in buffer_sub_data_size_offset()
138 ctx.glBufferSubData(GL_ARRAY_BUFFER, -1, -1, 0); in buffer_sub_data_size_offset()
139 ctx.expectError(GL_INVALID_VALUE); in buffer_sub_data_size_offset()
140 ctx.glBufferSubData(GL_ARRAY_BUFFER, 1, -1, 0); in buffer_sub_data_size_offset()
141 ctx.expectError(GL_INVALID_VALUE); in buffer_sub_data_size_offset()
142 ctx.glBufferSubData(GL_ARRAY_BUFFER, 15, 1, 0); in buffer_sub_data_size_offset()
143 ctx.expectError(GL_INVALID_VALUE); in buffer_sub_data_size_offset()
144 ctx.glBufferSubData(GL_ARRAY_BUFFER, 1, 15, 0); in buffer_sub_data_size_offset()
145 ctx.expectError(GL_INVALID_VALUE); in buffer_sub_data_size_offset()
146 ctx.glBufferSubData(GL_ARRAY_BUFFER, 8, 8, 0); in buffer_sub_data_size_offset()
147 ctx.expectError(GL_INVALID_VALUE); in buffer_sub_data_size_offset()
148 ctx.endSection(); in buffer_sub_data_size_offset()
150 ctx.glDeleteBuffers(1, &buffer); in buffer_sub_data_size_offset()
153 void clear (NegativeTestContext& ctx) in clear() argument
155ctx.beginSection("GL_INVALID_VALUE is generated if any bit other than the three defined bits is se… in clear()
156 ctx.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); in clear()
157 ctx.expectError(GL_NO_ERROR); in clear()
158 ctx.glClear(0x00000200); in clear()
159 ctx.expectError(GL_INVALID_VALUE); in clear()
160 ctx.glClear(0x00001000); in clear()
161 ctx.expectError(GL_INVALID_VALUE); in clear()
162 ctx.glClear(0x00000010); in clear()
163 ctx.expectError(GL_INVALID_VALUE); in clear()
164 ctx.endSection(); in clear()
167 void read_pixels (NegativeTestContext& ctx) in read_pixels() argument
172ctx.beginSection("GL_INVALID_OPERATION is generated if the combination of format and type is unsup… in read_pixels()
173 ctx.glReadPixels(0, 0, 1, 1, GL_LUMINANCE_ALPHA, GL_UNSIGNED_SHORT_4_4_4_4, &ubyteData[0]); in read_pixels()
174 ctx.expectError(GL_INVALID_OPERATION); in read_pixels()
175 ctx.endSection(); in read_pixels()
177 ctx.beginSection("GL_INVALID_VALUE is generated if either width or height is negative."); in read_pixels()
178 ctx.glReadPixels(0, 0, -1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]); in read_pixels()
179 ctx.expectError(GL_INVALID_VALUE); in read_pixels()
180 ctx.glReadPixels(0, 0, 1, -1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]); in read_pixels()
181 ctx.expectError(GL_INVALID_VALUE); in read_pixels()
182 ctx.glReadPixels(0, 0, -1, -1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]); in read_pixels()
183 ctx.expectError(GL_INVALID_VALUE); in read_pixels()
184 ctx.endSection(); in read_pixels()
186ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer… in read_pixels()
187 ctx.glGenFramebuffers(1, &fbo); in read_pixels()
188 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in read_pixels()
189 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in read_pixels()
190 ctx.glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]); in read_pixels()
191 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION); in read_pixels()
192 ctx.endSection(); in read_pixels()
194 ctx.glDeleteFramebuffers(1, &fbo); in read_pixels()
197 void readn_pixels (NegativeTestContext& ctx) in readn_pixels() argument
202 if (!contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) in readn_pixels()
203 && !ctx.isExtensionSupported("GL_KHR_robustness") in readn_pixels()
204 && !ctx.isExtensionSupported("GL_EXT_robustness")) in readn_pixels()
209ctx.beginSection("GL_INVALID_OPERATION is generated if the combination of format and type is unsup… in readn_pixels()
210ctx.glReadnPixels(0, 0, 1, 1, GL_LUMINANCE_ALPHA, GL_UNSIGNED_SHORT_4_4_4_4, (int) ubyteData.size(… in readn_pixels()
211 ctx.expectError(GL_INVALID_OPERATION); in readn_pixels()
212 ctx.endSection(); in readn_pixels()
214 ctx.beginSection("GL_INVALID_VALUE is generated if either width or height is negative."); in readn_pixels()
215 ctx.glReadnPixels(0, 0, -1, 1, GL_RGBA, GL_UNSIGNED_BYTE, (int) ubyteData.size(), &ubyteData[0]); in readn_pixels()
216 ctx.expectError(GL_INVALID_VALUE); in readn_pixels()
217 ctx.glReadnPixels(0, 0, 1, -1, GL_RGBA, GL_UNSIGNED_BYTE, (int) ubyteData.size(), &ubyteData[0]); in readn_pixels()
218 ctx.expectError(GL_INVALID_VALUE); in readn_pixels()
219 ctx.glReadnPixels(0, 0, -1, -1, GL_RGBA, GL_UNSIGNED_BYTE, (int) ubyteData.size(), &ubyteData[0]); in readn_pixels()
220 ctx.expectError(GL_INVALID_VALUE); in readn_pixels()
221 ctx.endSection(); in readn_pixels()
223ctx.beginSection("GL_INVALID_OPERATION is generated by ReadnPixels if the buffer size required to … in readn_pixels()
224ctx.glReadnPixels(0, 0, 0x1234, 0x1234, GL_RGBA, GL_UNSIGNED_BYTE, (int) ubyteData.size(), &ubyteD… in readn_pixels()
225 ctx.expectError(GL_INVALID_OPERATION); in readn_pixels()
226 ctx.endSection(); in readn_pixels()
228ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer… in readn_pixels()
229 ctx.glGenFramebuffers(1, &fbo); in readn_pixels()
230 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in readn_pixels()
231 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in readn_pixels()
232 ctx.glReadnPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, (int) ubyteData.size(), &ubyteData[0]); in readn_pixels()
233 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION); in readn_pixels()
234 ctx.endSection(); in readn_pixels()
236 ctx.glDeleteFramebuffers(1, &fbo); in readn_pixels()
239 void read_pixels_format_mismatch (NegativeTestContext& ctx) in read_pixels_format_mismatch() argument
247ctx.beginSection("Unsupported combinations of format and type will generate an GL_INVALID_OPERATIO… in read_pixels_format_mismatch()
248 ctx.glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_SHORT_5_6_5, &ushortData[0]); in read_pixels_format_mismatch()
249 ctx.expectError(GL_INVALID_OPERATION); in read_pixels_format_mismatch()
250 ctx.glReadPixels(0, 0, 1, 1, GL_ALPHA, GL_UNSIGNED_SHORT_5_6_5, &ushortData[0]); in read_pixels_format_mismatch()
251 ctx.expectError(GL_INVALID_OPERATION); in read_pixels_format_mismatch()
252 ctx.glReadPixels(0, 0, 1, 1, GL_RGB, GL_UNSIGNED_SHORT_4_4_4_4, &ushortData[0]); in read_pixels_format_mismatch()
253 ctx.expectError(GL_INVALID_OPERATION); in read_pixels_format_mismatch()
254 ctx.glReadPixels(0, 0, 1, 1, GL_ALPHA, GL_UNSIGNED_SHORT_4_4_4_4, &ushortData[0]); in read_pixels_format_mismatch()
255 ctx.expectError(GL_INVALID_OPERATION); in read_pixels_format_mismatch()
256 ctx.glReadPixels(0, 0, 1, 1, GL_RGB, GL_UNSIGNED_SHORT_5_5_5_1, &ushortData[0]); in read_pixels_format_mismatch()
257 ctx.expectError(GL_INVALID_OPERATION); in read_pixels_format_mismatch()
258 ctx.glReadPixels(0, 0, 1, 1, GL_ALPHA, GL_UNSIGNED_SHORT_5_5_5_1, &ushortData[0]); in read_pixels_format_mismatch()
259 ctx.expectError(GL_INVALID_OPERATION); in read_pixels_format_mismatch()
260 ctx.glReadnPixels(0, 0, 1, 1, GL_RGBA, GL_FLOAT, (int) floatData.size(), &floatData[0]); in read_pixels_format_mismatch()
261 ctx.expectError(GL_INVALID_OPERATION); in read_pixels_format_mismatch()
262 ctx.endSection(); in read_pixels_format_mismatch()
264ctx.beginSection("GL_RGBA/GL_UNSIGNED_BYTE is always accepted and the other acceptable pair can be… in read_pixels_format_mismatch()
265 ctx.glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]); in read_pixels_format_mismatch()
266 ctx.expectError(GL_NO_ERROR); in read_pixels_format_mismatch()
267 ctx.glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &readFormat); in read_pixels_format_mismatch()
268 ctx.glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &readType); in read_pixels_format_mismatch()
269 ctx.glReadPixels(0, 0, 1, 1, readFormat, readType, &ubyteData[0]); in read_pixels_format_mismatch()
270 ctx.expectError(GL_NO_ERROR); in read_pixels_format_mismatch()
271 ctx.endSection(); in read_pixels_format_mismatch()
274 void read_pixels_fbo_format_mismatch (NegativeTestContext& ctx) in read_pixels_fbo_format_mismatch() argument
281 ctx.glGenTextures (1, &texture); in read_pixels_fbo_format_mismatch()
282 ctx.glBindTexture (GL_TEXTURE_2D, texture); in read_pixels_fbo_format_mismatch()
283 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in read_pixels_fbo_format_mismatch()
284 ctx.glGenFramebuffers (1, &fbo); in read_pixels_fbo_format_mismatch()
285 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in read_pixels_fbo_format_mismatch()
286 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in read_pixels_fbo_format_mismatch()
287 ctx.expectError (GL_NO_ERROR); in read_pixels_fbo_format_mismatch()
289ctx.beginSection("GL_INVALID_OPERATION is generated if currently bound framebuffer format is incom… in read_pixels_fbo_format_mismatch()
291 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in read_pixels_fbo_format_mismatch()
292 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in read_pixels_fbo_format_mismatch()
293 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in read_pixels_fbo_format_mismatch()
294 ctx.expectError (GL_NO_ERROR); in read_pixels_fbo_format_mismatch()
295 ctx.glReadPixels (0, 0, 1, 1, GL_RGBA, GL_FLOAT, &floatData[0]); in read_pixels_fbo_format_mismatch()
296 ctx.expectError (GL_INVALID_OPERATION); in read_pixels_fbo_format_mismatch()
298 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32I, 32, 32, 0, GL_RGBA_INTEGER, GL_INT, NULL); in read_pixels_fbo_format_mismatch()
299 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in read_pixels_fbo_format_mismatch()
300 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in read_pixels_fbo_format_mismatch()
301 ctx.expectError (GL_NO_ERROR); in read_pixels_fbo_format_mismatch()
302 ctx.glReadPixels (0, 0, 1, 1, GL_RGBA, GL_FLOAT, &floatData[0]); in read_pixels_fbo_format_mismatch()
303 ctx.expectError (GL_INVALID_OPERATION); in read_pixels_fbo_format_mismatch()
305ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32UI, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, NU… in read_pixels_fbo_format_mismatch()
306 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in read_pixels_fbo_format_mismatch()
307 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in read_pixels_fbo_format_mismatch()
308 ctx.expectError (GL_NO_ERROR); in read_pixels_fbo_format_mismatch()
309 ctx.glReadPixels (0, 0, 1, 1, GL_RGBA, GL_FLOAT, &floatData[0]); in read_pixels_fbo_format_mismatch()
310 ctx.expectError (GL_INVALID_OPERATION); in read_pixels_fbo_format_mismatch()
312 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || in read_pixels_fbo_format_mismatch()
313 ctx.isExtensionSupported("GL_EXT_color_buffer_float")) in read_pixels_fbo_format_mismatch()
315 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32F, 32, 32, 0, GL_RGBA, GL_FLOAT, NULL); in read_pixels_fbo_format_mismatch()
316 ctx.expectError (GL_NO_ERROR); in read_pixels_fbo_format_mismatch()
317 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in read_pixels_fbo_format_mismatch()
318 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in read_pixels_fbo_format_mismatch()
319 ctx.expectError (GL_NO_ERROR); in read_pixels_fbo_format_mismatch()
320 ctx.glReadPixels (0, 0, 1, 1, GL_RGBA, GL_INT, &floatData[0]); in read_pixels_fbo_format_mismatch()
321 ctx.expectError (GL_INVALID_OPERATION); in read_pixels_fbo_format_mismatch()
324 ctx.endSection(); in read_pixels_fbo_format_mismatch()
326ctx.beginSection("GL_INVALID_OPERATION is generated if GL_READ_FRAMEBUFFER_BINDING is non-zero, th… in read_pixels_fbo_format_mismatch()
332 ctx.glGenRenderbuffers(1, &rbo); in read_pixels_fbo_format_mismatch()
333 ctx.glBindRenderbuffer(GL_RENDERBUFFER, rbo); in read_pixels_fbo_format_mismatch()
334 ctx.glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_RGBA8, 32, 32); in read_pixels_fbo_format_mismatch()
335 ctx.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo); in read_pixels_fbo_format_mismatch()
337 ctx.glGetIntegerv (GL_READ_FRAMEBUFFER_BINDING, &binding); in read_pixels_fbo_format_mismatch()
338ctx.getLog() << TestLog::Message << "// GL_READ_FRAMEBUFFER_BINDING: " << binding << TestLog::EndM… in read_pixels_fbo_format_mismatch()
339 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in read_pixels_fbo_format_mismatch()
340 ctx.glGetIntegerv (GL_SAMPLE_BUFFERS, &sampleBuffers); in read_pixels_fbo_format_mismatch()
341ctx.getLog() << TestLog::Message << "// GL_SAMPLE_BUFFERS: " << sampleBuffers << TestLog::EndMessa… in read_pixels_fbo_format_mismatch()
342 ctx.expectError (GL_NO_ERROR); in read_pixels_fbo_format_mismatch()
346ctx.getLog() << TestLog::Message << "// ERROR: expected GL_READ_FRAMEBUFFER_BINDING to be non-zero… in read_pixels_fbo_format_mismatch()
347 ctx.fail("Got invalid value"); in read_pixels_fbo_format_mismatch()
351 ctx.glReadPixels (0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]); in read_pixels_fbo_format_mismatch()
352 ctx.expectError (GL_INVALID_OPERATION); in read_pixels_fbo_format_mismatch()
355 ctx.endSection(); in read_pixels_fbo_format_mismatch()
357 ctx.glBindRenderbuffer (GL_RENDERBUFFER, 0); in read_pixels_fbo_format_mismatch()
358 ctx.glBindTexture (GL_TEXTURE_2D, 0); in read_pixels_fbo_format_mismatch()
359 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in read_pixels_fbo_format_mismatch()
360 ctx.glDeleteFramebuffers (1, &fbo); in read_pixels_fbo_format_mismatch()
361 ctx.glDeleteTextures (1, &texture); in read_pixels_fbo_format_mismatch()
362 ctx.glDeleteRenderbuffers (1, &rbo); in read_pixels_fbo_format_mismatch()
365 void bind_buffer_range (NegativeTestContext& ctx) in bind_buffer_range() argument
374 ctx.glGenBuffers(1, &bufU); in bind_buffer_range()
375 ctx.glBindBuffer(GL_UNIFORM_BUFFER, bufU); in bind_buffer_range()
376 ctx.glBufferData(GL_UNIFORM_BUFFER, 16, NULL, GL_STREAM_DRAW); in bind_buffer_range()
378 ctx.glGenBuffers(1, &bufTF); in bind_buffer_range()
379 ctx.glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, bufTF); in bind_buffer_range()
380 ctx.glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 16, NULL, GL_STREAM_DRAW); in bind_buffer_range()
382 ctx.glGenBuffers(1, &bufAC); in bind_buffer_range()
383 ctx.glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, bufAC); in bind_buffer_range()
384 ctx.glBufferData(GL_ATOMIC_COUNTER_BUFFER, 16, NULL, GL_STREAM_DRAW); in bind_buffer_range()
386ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_ATOMIC_COUNTER_BUFFER, GL_SHADE… in bind_buffer_range()
387 ctx.glBindBufferRange(GL_ARRAY_BUFFER, 0, bufU, 0, 4); in bind_buffer_range()
388 ctx.expectError(GL_INVALID_ENUM); in bind_buffer_range()
389 ctx.endSection(); in bind_buffer_range()
391ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_TRANSFORM_FEEDBACK_BUFFER and inde… in bind_buffer_range()
392 ctx.glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &maxTFSize); in bind_buffer_range()
393 ctx.glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, maxTFSize, bufTF, 0, 4); in bind_buffer_range()
394 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
395 ctx.endSection(); in bind_buffer_range()
397ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_UNIFORM_BUFFER and index is greate… in bind_buffer_range()
398 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUSize); in bind_buffer_range()
399 ctx.glBindBufferRange(GL_UNIFORM_BUFFER, maxUSize, bufU, 0, 4); in bind_buffer_range()
400 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
401 ctx.endSection(); in bind_buffer_range()
403 ctx.beginSection("GL_INVALID_VALUE is generated if size is less than or equal to zero."); in bind_buffer_range()
404 ctx.glBindBufferRange(GL_UNIFORM_BUFFER, 0, bufU, 0, -1); in bind_buffer_range()
405 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
406 ctx.glBindBufferRange(GL_UNIFORM_BUFFER, 0, bufU, 0, 0); in bind_buffer_range()
407 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
408 ctx.endSection(); in bind_buffer_range()
410 ctx.beginSection("GL_INVALID_VALUE is generated if offset is less than zero."); in bind_buffer_range()
411 ctx.glBindBufferRange(GL_UNIFORM_BUFFER, 0, bufU, -1, 0); in bind_buffer_range()
412 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
413 ctx.endSection(); in bind_buffer_range()
415ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_TRANSFORM_FEEDBACK_BUFFER and size… in bind_buffer_range()
416 ctx.glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 4, 5); in bind_buffer_range()
417 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
418 ctx.glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 5, 4); in bind_buffer_range()
419 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
420 ctx.glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 5, 7); in bind_buffer_range()
421 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
422 ctx.endSection(); in bind_buffer_range()
424ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_UNIFORM_BUFFER and offset is not a… in bind_buffer_range()
425 ctx.glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &uAlignment); in bind_buffer_range()
426 ctx.glBindBufferRange(GL_UNIFORM_BUFFER, 0, bufU, uAlignment+1, 4); in bind_buffer_range()
427 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
428 ctx.endSection(); in bind_buffer_range()
430 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in bind_buffer_range()
436ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_ATOMIC_COUNTER_BUFFER and index is… in bind_buffer_range()
437 ctx.glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &maxACize); in bind_buffer_range()
438 ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, maxACize, bufU, 0, 4); in bind_buffer_range()
439 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
440 ctx.endSection(); in bind_buffer_range()
442ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_SHADER_STORAGE_BUFFER and index is… in bind_buffer_range()
443 ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxSSize); in bind_buffer_range()
444 ctx.glBindBufferRange(GL_SHADER_STORAGE_BUFFER, maxSSize, bufU, 0, 4); in bind_buffer_range()
445 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
446 ctx.endSection(); in bind_buffer_range()
448ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_ATOMIC_COUNTER_BUFFER and offset i… in bind_buffer_range()
449 ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, 0, bufTF, 5, 0); in bind_buffer_range()
450 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
451 ctx.endSection(); in bind_buffer_range()
453ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_SHADER_STORAGE_BUFFER and offset i… in bind_buffer_range()
454 ctx.glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &ssAlignment); in bind_buffer_range()
455 ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, 0, bufTF, ssAlignment+1, 0); in bind_buffer_range()
456 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
457 ctx.endSection(); in bind_buffer_range()
460 ctx.glDeleteBuffers(1, &bufU); in bind_buffer_range()
461 ctx.glDeleteBuffers(1, &bufTF); in bind_buffer_range()
462 ctx.glDeleteBuffers(1, &bufAC); in bind_buffer_range()
465 void bind_buffer_base (NegativeTestContext& ctx) in bind_buffer_base() argument
472 ctx.glGenBuffers(1, &bufU); in bind_buffer_base()
473 ctx.glBindBuffer(GL_UNIFORM_BUFFER, bufU); in bind_buffer_base()
474 ctx.glBufferData(GL_UNIFORM_BUFFER, 16, NULL, GL_STREAM_DRAW); in bind_buffer_base()
476 ctx.glGenBuffers(1, &bufTF); in bind_buffer_base()
477 ctx.glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, bufTF); in bind_buffer_base()
478 ctx.glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 16, NULL, GL_STREAM_DRAW); in bind_buffer_base()
479 ctx.expectError(GL_NO_ERROR); in bind_buffer_base()
481ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_ATOMIC_COUNTER_BUFFER, GL_SHADE… in bind_buffer_base()
482 ctx.glBindBufferBase(-1, 0, bufU); in bind_buffer_base()
483 ctx.expectError(GL_INVALID_ENUM); in bind_buffer_base()
484 ctx.glBindBufferBase(GL_ARRAY_BUFFER, 0, bufU); in bind_buffer_base()
485 ctx.expectError(GL_INVALID_ENUM); in bind_buffer_base()
486 ctx.endSection(); in bind_buffer_base()
488ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_UNIFORM_BUFFER and index is greate… in bind_buffer_base()
489 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUSize); in bind_buffer_base()
490 ctx.glBindBufferBase(GL_UNIFORM_BUFFER, maxUSize, bufU); in bind_buffer_base()
491 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_base()
492 ctx.endSection(); in bind_buffer_base()
494ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_TRANSFORM_FEEDBACK_BUFFER andindex… in bind_buffer_base()
495 ctx.glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &maxTFSize); in bind_buffer_base()
496 ctx.glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, maxTFSize, bufTF); in bind_buffer_base()
497 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_base()
498 ctx.endSection(); in bind_buffer_base()
500 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in bind_buffer_base()
505ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_ATOMIC_COUNTER_BUFFER and index is… in bind_buffer_base()
506 ctx.glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &maxACize); in bind_buffer_base()
507 ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, maxACize, bufU, 0, 4); in bind_buffer_base()
508 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_base()
509 ctx.endSection(); in bind_buffer_base()
511ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_SHADER_STORAGE_BUFFER and index is… in bind_buffer_base()
512 ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxSSize); in bind_buffer_base()
513 ctx.glBindBufferRange(GL_SHADER_STORAGE_BUFFER, maxSSize, bufU, 0, 4); in bind_buffer_base()
514 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_base()
515 ctx.endSection(); in bind_buffer_base()
518 ctx.glDeleteBuffers(1, &bufU); in bind_buffer_base()
519 ctx.glDeleteBuffers(1, &bufTF); in bind_buffer_base()
522 void clear_bufferiv (NegativeTestContext& ctx) in clear_bufferiv() argument
529 ctx.glGenTextures (1, &texture); in clear_bufferiv()
530 ctx.glBindTexture (GL_TEXTURE_2D, texture); in clear_bufferiv()
531 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32I, 32, 32, 0, GL_RGBA_INTEGER, GL_INT, NULL); in clear_bufferiv()
532 ctx.glGenFramebuffers (1, &fbo); in clear_bufferiv()
533 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in clear_bufferiv()
534 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in clear_bufferiv()
535 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in clear_bufferiv()
536 ctx.expectError (GL_NO_ERROR); in clear_bufferiv()
538 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is not an accepted value."); in clear_bufferiv()
539 ctx.glClearBufferiv (-1, 0, &data[0]); in clear_bufferiv()
540 ctx.expectError (GL_INVALID_ENUM); in clear_bufferiv()
541 ctx.glClearBufferiv (GL_FRAMEBUFFER, 0, &data[0]); in clear_bufferiv()
542 ctx.expectError (GL_INVALID_ENUM); in clear_bufferiv()
543 ctx.endSection(); in clear_bufferiv()
545 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is GL_DEPTH or GL_DEPTH_STENCIL."); in clear_bufferiv()
546 ctx.glClearBufferiv (GL_DEPTH, 1, &data[0]); in clear_bufferiv()
547 ctx.expectError (GL_INVALID_ENUM); in clear_bufferiv()
548 ctx.glClearBufferiv (GL_DEPTH_STENCIL, 1, &data[0]); in clear_bufferiv()
549 ctx.expectError (GL_INVALID_ENUM); in clear_bufferiv()
550 ctx.endSection(); in clear_bufferiv()
552ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR or GL_STENCIL and drawBuffer… in clear_bufferiv()
553 ctx.glGetIntegerv (GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); in clear_bufferiv()
554 ctx.glClearBufferiv (GL_COLOR, maxDrawBuffers, &data[0]); in clear_bufferiv()
555 ctx.expectError (GL_INVALID_VALUE); in clear_bufferiv()
556 ctx.endSection(); in clear_bufferiv()
558ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR or GL_STENCIL and drawBuffer… in clear_bufferiv()
559 ctx.glClearBufferiv (GL_COLOR, -1, &data[0]); in clear_bufferiv()
560 ctx.expectError (GL_INVALID_VALUE); in clear_bufferiv()
561 ctx.endSection(); in clear_bufferiv()
563ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_STENCIL and drawBuffer is not zero… in clear_bufferiv()
564 ctx.glClearBufferiv (GL_STENCIL, 1, &data[0]); in clear_bufferiv()
565 ctx.expectError (GL_INVALID_VALUE); in clear_bufferiv()
566 ctx.endSection(); in clear_bufferiv()
568 ctx.glDeleteFramebuffers (1, &fbo); in clear_bufferiv()
569 ctx.glDeleteTextures (1, &texture); in clear_bufferiv()
572 void clear_bufferuiv (NegativeTestContext& ctx) in clear_bufferuiv() argument
579 ctx.glGenTextures (1, &texture); in clear_bufferuiv()
580 ctx.glBindTexture (GL_TEXTURE_2D, texture); in clear_bufferuiv()
581ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32UI, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, NU… in clear_bufferuiv()
582 ctx.glGenFramebuffers (1, &fbo); in clear_bufferuiv()
583 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in clear_bufferuiv()
584 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in clear_bufferuiv()
585 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in clear_bufferuiv()
586 ctx.expectError (GL_NO_ERROR); in clear_bufferuiv()
588 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is not GL_COLOR."); in clear_bufferuiv()
589 ctx.glClearBufferuiv (-1, 0, &data[0]); in clear_bufferuiv()
590 ctx.expectError (GL_INVALID_ENUM); in clear_bufferuiv()
591 ctx.glClearBufferuiv (GL_FRAMEBUFFER, 0, &data[0]); in clear_bufferuiv()
592 ctx.expectError (GL_INVALID_ENUM); in clear_bufferuiv()
593 ctx.endSection(); in clear_bufferuiv()
595ctx.beginSection("GL_INVALID_ENUM is generated if buffer is GL_DEPTH, GL_STENCIL, or GL_DEPTH_STEN… in clear_bufferuiv()
596 ctx.glClearBufferuiv (GL_DEPTH, 0, &data[0]); in clear_bufferuiv()
597 ctx.expectError (GL_INVALID_ENUM); in clear_bufferuiv()
598 ctx.glClearBufferuiv (GL_STENCIL, 0, &data[0]); in clear_bufferuiv()
599 ctx.expectError (GL_INVALID_ENUM); in clear_bufferuiv()
600 ctx.glClearBufferuiv (GL_DEPTH_STENCIL, 0, &data[0]); in clear_bufferuiv()
601 ctx.expectError (GL_INVALID_ENUM); in clear_bufferuiv()
602 ctx.endSection(); in clear_bufferuiv()
604ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR and drawBuffer is greater th… in clear_bufferuiv()
605 ctx.glGetIntegerv (GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); in clear_bufferuiv()
606 ctx.glClearBufferuiv (GL_COLOR, maxDrawBuffers, &data[0]); in clear_bufferuiv()
607 ctx.expectError (GL_INVALID_VALUE); in clear_bufferuiv()
608 ctx.endSection(); in clear_bufferuiv()
610ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR and drawBuffer is negative."… in clear_bufferuiv()
611 ctx.glClearBufferuiv (GL_COLOR, -1, &data[0]); in clear_bufferuiv()
612 ctx.expectError (GL_INVALID_VALUE); in clear_bufferuiv()
613 ctx.endSection(); in clear_bufferuiv()
615 ctx.glDeleteFramebuffers (1, &fbo); in clear_bufferuiv()
616 ctx.glDeleteTextures (1, &texture); in clear_bufferuiv()
619 void clear_bufferfv (NegativeTestContext& ctx) in clear_bufferfv() argument
626 ctx.glGenTextures (1, &texture); in clear_bufferfv()
627 ctx.glBindTexture (GL_TEXTURE_2D, texture); in clear_bufferfv()
628 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32F, 32, 32, 0, GL_RGBA, GL_FLOAT, NULL); in clear_bufferfv()
629 ctx.glGenFramebuffers (1, &fbo); in clear_bufferfv()
630 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in clear_bufferfv()
631 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in clear_bufferfv()
632 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in clear_bufferfv()
633 ctx.expectError (GL_NO_ERROR); in clear_bufferfv()
635 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is not GL_COLOR or GL_DEPTH."); in clear_bufferfv()
636 ctx.glClearBufferfv (-1, 0, &data[0]); in clear_bufferfv()
637 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfv()
638 ctx.glClearBufferfv (GL_FRAMEBUFFER, 0, &data[0]); in clear_bufferfv()
639 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfv()
640 ctx.endSection(); in clear_bufferfv()
642 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is GL_STENCIL or GL_DEPTH_STENCIL."); in clear_bufferfv()
643 ctx.glClearBufferfv (GL_STENCIL, 1, &data[0]); in clear_bufferfv()
644 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfv()
645 ctx.glClearBufferfv (GL_DEPTH_STENCIL, 1, &data[0]); in clear_bufferfv()
646 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfv()
647 ctx.endSection(); in clear_bufferfv()
649ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR and drawBuffer is greater th… in clear_bufferfv()
650 ctx.glGetIntegerv (GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); in clear_bufferfv()
651 ctx.glClearBufferfv (GL_COLOR, maxDrawBuffers, &data[0]); in clear_bufferfv()
652 ctx.expectError (GL_INVALID_VALUE); in clear_bufferfv()
653 ctx.endSection(); in clear_bufferfv()
655ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR and drawBuffer is negative."… in clear_bufferfv()
656 ctx.glClearBufferfv (GL_COLOR, -1, &data[0]); in clear_bufferfv()
657 ctx.expectError (GL_INVALID_VALUE); in clear_bufferfv()
658 ctx.endSection(); in clear_bufferfv()
660ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_DEPTH and drawBuffer is not zero."… in clear_bufferfv()
661 ctx.glClearBufferfv (GL_DEPTH, 1, &data[0]); in clear_bufferfv()
662 ctx.expectError (GL_INVALID_VALUE); in clear_bufferfv()
663 ctx.endSection(); in clear_bufferfv()
665 ctx.glDeleteFramebuffers (1, &fbo); in clear_bufferfv()
666 ctx.glDeleteTextures (1, &texture); in clear_bufferfv()
669 void clear_bufferfi (NegativeTestContext& ctx) in clear_bufferfi() argument
671 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is not GL_DEPTH_STENCIL."); in clear_bufferfi()
672 ctx.glClearBufferfi (-1, 0, 1.0f, 1); in clear_bufferfi()
673 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfi()
674 ctx.glClearBufferfi (GL_FRAMEBUFFER, 0, 1.0f, 1); in clear_bufferfi()
675 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfi()
676 ctx.glClearBufferfi (GL_DEPTH, 0, 1.0f, 1); in clear_bufferfi()
677 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfi()
678 ctx.glClearBufferfi (GL_STENCIL, 0, 1.0f, 1); in clear_bufferfi()
679 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfi()
680 ctx.glClearBufferfi (GL_COLOR, 0, 1.0f, 1); in clear_bufferfi()
681 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfi()
682 ctx.endSection(); in clear_bufferfi()
684ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_DEPTH_STENCIL and drawBuffer is no… in clear_bufferfi()
685 ctx.glClearBufferfi (GL_DEPTH_STENCIL, 1, 1.0f, 1); in clear_bufferfi()
686 ctx.expectError (GL_INVALID_VALUE); in clear_bufferfi()
687 ctx.endSection(); in clear_bufferfi()
690 void copy_buffer_sub_data (NegativeTestContext& ctx) in copy_buffer_sub_data() argument
695 ctx.glGenBuffers (2, buf); in copy_buffer_sub_data()
696 ctx.glBindBuffer (GL_COPY_READ_BUFFER, buf[0]); in copy_buffer_sub_data()
697 ctx.glBufferData (GL_COPY_READ_BUFFER, 32, &data[0], GL_DYNAMIC_COPY); in copy_buffer_sub_data()
698 ctx.glBindBuffer (GL_COPY_WRITE_BUFFER, buf[1]); in copy_buffer_sub_data()
699 ctx.glBufferData (GL_COPY_WRITE_BUFFER, 32, &data[0], GL_DYNAMIC_COPY); in copy_buffer_sub_data()
700 ctx.expectError (GL_NO_ERROR); in copy_buffer_sub_data()
702ctx.beginSection("GL_INVALID_VALUE is generated if any of readoffset, writeoffset or size is negat… in copy_buffer_sub_data()
703 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, -4); in copy_buffer_sub_data()
704 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
705 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, -1, 0, 4); in copy_buffer_sub_data()
706 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
707 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, -1, 4); in copy_buffer_sub_data()
708 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
709 ctx.endSection(); in copy_buffer_sub_data()
711ctx.beginSection("GL_INVALID_VALUE is generated if readoffset + size exceeds the size of the buffe… in copy_buffer_sub_data()
712 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 36); in copy_buffer_sub_data()
713 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
714 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 24, 0, 16); in copy_buffer_sub_data()
715 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
716 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 36, 0, 4); in copy_buffer_sub_data()
717 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
718 ctx.endSection(); in copy_buffer_sub_data()
720ctx.beginSection("GL_INVALID_VALUE is generated if writeoffset + size exceeds the size of the buff… in copy_buffer_sub_data()
721 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 36); in copy_buffer_sub_data()
722 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
723 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 24, 16); in copy_buffer_sub_data()
724 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
725 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 36, 4); in copy_buffer_sub_data()
726 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
727 ctx.endSection(); in copy_buffer_sub_data()
729ctx.beginSection("GL_INVALID_VALUE is generated if the same buffer object is bound to both readtar… in copy_buffer_sub_data()
730 ctx.glBindBuffer (GL_COPY_WRITE_BUFFER, buf[0]); in copy_buffer_sub_data()
731 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 16, 4); in copy_buffer_sub_data()
732 ctx.expectError (GL_NO_ERROR); in copy_buffer_sub_data()
733 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 4); in copy_buffer_sub_data()
734 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
735 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 16, 18); in copy_buffer_sub_data()
736 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
737 ctx.glBindBuffer (GL_COPY_WRITE_BUFFER, buf[1]); in copy_buffer_sub_data()
738 ctx.endSection(); in copy_buffer_sub_data()
740ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to readtarget or writetarget.… in copy_buffer_sub_data()
741 ctx.glBindBuffer (GL_COPY_READ_BUFFER, 0); in copy_buffer_sub_data()
742 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 16); in copy_buffer_sub_data()
743 ctx.expectError (GL_INVALID_OPERATION); in copy_buffer_sub_data()
745 ctx.glBindBuffer (GL_COPY_READ_BUFFER, buf[0]); in copy_buffer_sub_data()
746 ctx.glBindBuffer (GL_COPY_WRITE_BUFFER, 0); in copy_buffer_sub_data()
747 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 16); in copy_buffer_sub_data()
748 ctx.expectError (GL_INVALID_OPERATION); in copy_buffer_sub_data()
750 ctx.glBindBuffer (GL_COPY_WRITE_BUFFER, buf[1]); in copy_buffer_sub_data()
751 ctx.endSection(); in copy_buffer_sub_data()
753ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer object bound to either readtarge… in copy_buffer_sub_data()
754 ctx.glMapBufferRange (GL_COPY_READ_BUFFER, 0, 4, GL_MAP_READ_BIT); in copy_buffer_sub_data()
755 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 16); in copy_buffer_sub_data()
756 ctx.expectError (GL_INVALID_OPERATION); in copy_buffer_sub_data()
757 ctx.glUnmapBuffer (GL_COPY_READ_BUFFER); in copy_buffer_sub_data()
759 ctx.glMapBufferRange (GL_COPY_WRITE_BUFFER, 0, 4, GL_MAP_READ_BIT); in copy_buffer_sub_data()
760 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 16); in copy_buffer_sub_data()
761 ctx.expectError (GL_INVALID_OPERATION); in copy_buffer_sub_data()
762 ctx.glUnmapBuffer (GL_COPY_WRITE_BUFFER); in copy_buffer_sub_data()
763 ctx.endSection(); in copy_buffer_sub_data()
765 ctx.glDeleteBuffers(2, buf); in copy_buffer_sub_data()
768 void draw_buffers (NegativeTestContext& ctx) in draw_buffers() argument
774 ctx.glGetIntegerv (GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments); in draw_buffers()
775 ctx.glGetIntegerv (GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); in draw_buffers()
788 ctx.glGenTextures (1, &texture); in draw_buffers()
789 ctx.glBindTexture (GL_TEXTURE_2D, texture); in draw_buffers()
790 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in draw_buffers()
791 ctx.glGenFramebuffers (1, &fbo); in draw_buffers()
792 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in draw_buffers()
793 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in draw_buffers()
794 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in draw_buffers()
795 ctx.expectError (GL_NO_ERROR); in draw_buffers()
797ctx.beginSection("GL_INVALID_ENUM is generated if one of the values in bufs is not an accepted val… in draw_buffers()
798 ctx.glDrawBuffers (2, &values[2]); in draw_buffers()
799 ctx.expectError (GL_INVALID_ENUM); in draw_buffers()
800 ctx.endSection(); in draw_buffers()
802ctx.beginSection("GL_INVALID_OPERATION is generated if the GL is bound to a draw framebuffer and D… in draw_buffers()
803 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in draw_buffers()
804 ctx.glDrawBuffers (1, &values[1]); in draw_buffers()
805 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
806 ctx.glDrawBuffers (4, &attachments[0]); in draw_buffers()
807 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
808 ctx.endSection(); in draw_buffers()
810ctx.beginSection("GL_INVALID_OPERATION is generated if the GL is bound to the default framebuffer … in draw_buffers()
811 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in draw_buffers()
812 ctx.glDrawBuffers (2, &values[0]); in draw_buffers()
813 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
814 ctx.endSection(); in draw_buffers()
816ctx.beginSection("GL_INVALID_OPERATION is generated if the GL is bound to the default framebuffer … in draw_buffers()
817 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in draw_buffers()
818 ctx.glDrawBuffers (1, &values[2]); in draw_buffers()
819 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
820 ctx.endSection(); in draw_buffers()
822ctx.beginSection("GL_INVALID_OPERATION is generated if the GL is bound to a framebuffer object and… in draw_buffers()
823 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in draw_buffers()
824 ctx.glDrawBuffers (1, &values[1]); in draw_buffers()
825 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
826 ctx.glDrawBuffers (4, &attachments[0]); in draw_buffers()
827 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
829 ctx.endSection(); in draw_buffers()
831ctx.beginSection("GL_INVALID_VALUE is generated if n is less than 0 or greater than GL_MAX_DRAW_BU… in draw_buffers()
832 ctx.glDrawBuffers (-1, &values[1]); in draw_buffers()
833 ctx.expectError (GL_INVALID_VALUE); in draw_buffers()
834 ctx.glDrawBuffers (maxDrawBuffers+1, &values[0]); in draw_buffers()
835 ctx.expectError (GL_INVALID_VALUE); in draw_buffers()
836 ctx.endSection(); in draw_buffers()
838 ctx.glDeleteTextures(1, &texture); in draw_buffers()
839 ctx.glDeleteFramebuffers(1, &fbo); in draw_buffers()
842 void flush_mapped_buffer_range (NegativeTestContext& ctx) in flush_mapped_buffer_range() argument
847 ctx.glGenBuffers (1, &buf); in flush_mapped_buffer_range()
848 ctx.glBindBuffer (GL_ARRAY_BUFFER, buf); in flush_mapped_buffer_range()
849 ctx.glBufferData (GL_ARRAY_BUFFER, 32, &data[0], GL_STATIC_READ); in flush_mapped_buffer_range()
850 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); in flush_mapped_buffer_range()
851 ctx.expectError (GL_NO_ERROR); in flush_mapped_buffer_range()
853 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted values."); in flush_mapped_buffer_range()
854 ctx.glFlushMappedBufferRange(-1, 0, 16); in flush_mapped_buffer_range()
855 ctx.expectError (GL_INVALID_ENUM); in flush_mapped_buffer_range()
856 ctx.endSection(); in flush_mapped_buffer_range()
858ctx.beginSection("GL_INVALID_VALUE is generated if offset or length is negative, or if offset + le… in flush_mapped_buffer_range()
859 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, -1, 1); in flush_mapped_buffer_range()
860 ctx.expectError (GL_INVALID_VALUE); in flush_mapped_buffer_range()
861 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, -1); in flush_mapped_buffer_range()
862 ctx.expectError (GL_INVALID_VALUE); in flush_mapped_buffer_range()
863 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 12, 8); in flush_mapped_buffer_range()
864 ctx.expectError (GL_INVALID_VALUE); in flush_mapped_buffer_range()
865 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 24, 4); in flush_mapped_buffer_range()
866 ctx.expectError (GL_INVALID_VALUE); in flush_mapped_buffer_range()
867 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, 24); in flush_mapped_buffer_range()
868 ctx.expectError (GL_INVALID_VALUE); in flush_mapped_buffer_range()
869 ctx.endSection(); in flush_mapped_buffer_range()
871 ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to target."); in flush_mapped_buffer_range()
872 ctx.glBindBuffer (GL_ARRAY_BUFFER, 0); in flush_mapped_buffer_range()
873 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, 8); in flush_mapped_buffer_range()
874 ctx.expectError (GL_INVALID_OPERATION); in flush_mapped_buffer_range()
875 ctx.endSection(); in flush_mapped_buffer_range()
877ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer bound to target is not mapped, o… in flush_mapped_buffer_range()
878 ctx.glBindBuffer (GL_ARRAY_BUFFER, buf); in flush_mapped_buffer_range()
879 ctx.glUnmapBuffer (GL_ARRAY_BUFFER); in flush_mapped_buffer_range()
880 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, 8); in flush_mapped_buffer_range()
881 ctx.expectError (GL_INVALID_OPERATION); in flush_mapped_buffer_range()
882 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_WRITE_BIT); in flush_mapped_buffer_range()
883 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, 8); in flush_mapped_buffer_range()
884 ctx.expectError (GL_INVALID_OPERATION); in flush_mapped_buffer_range()
885 ctx.endSection(); in flush_mapped_buffer_range()
887 ctx.glUnmapBuffer (GL_ARRAY_BUFFER); in flush_mapped_buffer_range()
888 ctx.glDeleteBuffers (1, &buf); in flush_mapped_buffer_range()
891 void map_buffer_range (NegativeTestContext& ctx) in map_buffer_range() argument
896 ctx.glGenBuffers (1, &buf); in map_buffer_range()
897 ctx.glBindBuffer (GL_ARRAY_BUFFER, buf); in map_buffer_range()
898 ctx.glBufferData (GL_ARRAY_BUFFER, 32, &data[0], GL_DYNAMIC_COPY); in map_buffer_range()
899 ctx.expectError (GL_NO_ERROR); in map_buffer_range()
901 ctx.beginSection("GL_INVALID_VALUE is generated if either of offset or length is negative."); in map_buffer_range()
902 ctx.glMapBufferRange (GL_ARRAY_BUFFER, -1, 1, GL_MAP_READ_BIT); in map_buffer_range()
903 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
905 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 1, -1, GL_MAP_READ_BIT); in map_buffer_range()
906 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
907 ctx.endSection(); in map_buffer_range()
909ctx.beginSection("GL_INVALID_VALUE is generated if offset + length is greater than the value of GL… in map_buffer_range()
910 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 33, GL_MAP_READ_BIT); in map_buffer_range()
911 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
913 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 32, 1, GL_MAP_READ_BIT); in map_buffer_range()
914 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
916 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 16, 17, GL_MAP_READ_BIT); in map_buffer_range()
917 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
918 ctx.endSection(); in map_buffer_range()
920ctx.beginSection("GL_INVALID_VALUE is generated if access has any bits set other than those accept… in map_buffer_range()
921 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_READ_BIT | 0x1000); in map_buffer_range()
922 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
924 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_WRITE_BIT | 0x1000); in map_buffer_range()
925 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
926 ctx.endSection(); in map_buffer_range()
928 ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer is already in a mapped state."); in map_buffer_range()
929 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_WRITE_BIT); in map_buffer_range()
930 ctx.expectError (GL_NO_ERROR); in map_buffer_range()
931 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 16, 8, GL_MAP_READ_BIT); in map_buffer_range()
932 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
933 ctx.glUnmapBuffer (GL_ARRAY_BUFFER); in map_buffer_range()
934 ctx.endSection(); in map_buffer_range()
936ctx.beginSection("GL_INVALID_OPERATION is generated if neither GL_MAP_READ_BIT or GL_MAP_WRITE_BIT… in map_buffer_range()
937 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_INVALIDATE_RANGE_BIT); in map_buffer_range()
938 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
939 ctx.endSection(); in map_buffer_range()
941 ctx.beginSection("GL_INVALID_OPERATION is generated if length is 0"); in map_buffer_range()
942 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT); in map_buffer_range()
943 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
944 ctx.endSection(); in map_buffer_range()
946ctx.beginSection("GL_INVALID_OPERATION is generated if GL_MAP_READ_BIT is set and any of GL_MAP_IN… in map_buffer_range()
947 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_READ_BIT | GL_MAP_INVALIDATE_RANGE_BIT); in map_buffer_range()
948 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
950 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_READ_BIT | GL_MAP_INVALIDATE_BUFFER_BIT); in map_buffer_range()
951 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
953 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_READ_BIT | GL_MAP_UNSYNCHRONIZED_BIT); in map_buffer_range()
954 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
955 ctx.endSection(); in map_buffer_range()
957ctx.beginSection("GL_INVALID_OPERATION is generated if GL_MAP_FLUSH_EXPLICIT_BIT is set and GL_MAP… in map_buffer_range()
958 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_READ_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); in map_buffer_range()
959 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
960 ctx.endSection(); in map_buffer_range()
962 ctx.glDeleteBuffers (1, &buf); in map_buffer_range()
965 void read_buffer (NegativeTestContext& ctx) in read_buffer() argument
971 ctx.glGetIntegerv (GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments); in read_buffer()
972 ctx.glGenTextures (1, &texture); in read_buffer()
973 ctx.glBindTexture (GL_TEXTURE_2D, texture); in read_buffer()
974 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in read_buffer()
975 ctx.glGenFramebuffers (1, &fbo); in read_buffer()
976 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in read_buffer()
977 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in read_buffer()
978 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in read_buffer()
979 ctx.expectError (GL_NO_ERROR); in read_buffer()
981ctx.beginSection("GL_INVALID_ENUM is generated if mode is not GL_BACK, GL_NONE, or GL_COLOR_ATTACH… in read_buffer()
982 ctx.glReadBuffer (GL_NONE); in read_buffer()
983 ctx.expectError (GL_NO_ERROR); in read_buffer()
984 ctx.glReadBuffer (1); in read_buffer()
985 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
986 ctx.glReadBuffer (GL_FRAMEBUFFER); in read_buffer()
987 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
988 ctx.glReadBuffer (GL_COLOR_ATTACHMENT0 - 1); in read_buffer()
989 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
990 ctx.glReadBuffer (GL_FRONT); in read_buffer()
991 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
996 ctx.glReadBuffer (GL_DEPTH_ATTACHMENT); in read_buffer()
997 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
998 ctx.glReadBuffer (GL_STENCIL_ATTACHMENT); in read_buffer()
999 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
1000 ctx.glReadBuffer (GL_STENCIL_ATTACHMENT+1); in read_buffer()
1001 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
1002 ctx.glReadBuffer (0xffffffffu); in read_buffer()
1003 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
1004 ctx.endSection(); in read_buffer()
1006ctx.beginSection("GL_INVALID_OPERATION error is generated if src is GL_BACK or if src is GL_COLOR_… in read_buffer()
1007 ctx.glReadBuffer (GL_BACK); in read_buffer()
1008 ctx.expectError (GL_INVALID_OPERATION); in read_buffer()
1009 ctx.glReadBuffer (GL_COLOR_ATTACHMENT0 + maxColorAttachments); in read_buffer()
1010 ctx.expectError (GL_INVALID_OPERATION); in read_buffer()
1014 ctx.glReadBuffer (GL_DEPTH_ATTACHMENT - 1); in read_buffer()
1015 ctx.expectError (GL_INVALID_OPERATION); in read_buffer()
1018 ctx.endSection(); in read_buffer()
1020ctx.beginSection("GL_INVALID_OPERATION is generated if the current framebuffer is the default fram… in read_buffer()
1021 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in read_buffer()
1022 ctx.glReadBuffer (GL_COLOR_ATTACHMENT0); in read_buffer()
1023 ctx.expectError (GL_INVALID_OPERATION); in read_buffer()
1024 ctx.endSection(); in read_buffer()
1026ctx.beginSection("GL_INVALID_OPERATION is generated if the current framebuffer is a named framebuf… in read_buffer()
1027 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in read_buffer()
1028 ctx.glReadBuffer (GL_BACK); in read_buffer()
1029 ctx.expectError (GL_INVALID_OPERATION); in read_buffer()
1030 ctx.endSection(); in read_buffer()
1032 ctx.glDeleteTextures(1, &texture); in read_buffer()
1033 ctx.glDeleteFramebuffers(1, &fbo); in read_buffer()
1036 void unmap_buffer (NegativeTestContext& ctx) in unmap_buffer() argument
1041 ctx.glGenBuffers (1, &buf); in unmap_buffer()
1042 ctx.glBindBuffer (GL_ARRAY_BUFFER, buf); in unmap_buffer()
1043 ctx.glBufferData (GL_ARRAY_BUFFER, 32, &data[0], GL_DYNAMIC_COPY); in unmap_buffer()
1044 ctx.expectError (GL_NO_ERROR); in unmap_buffer()
1046ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer data store is already in an unma… in unmap_buffer()
1047 ctx.glUnmapBuffer (GL_ARRAY_BUFFER); in unmap_buffer()
1048 ctx.expectError (GL_INVALID_OPERATION); in unmap_buffer()
1049 ctx.endSection(); in unmap_buffer()
1051 ctx.glDeleteBuffers (1, &buf); in unmap_buffer()
1055 void bind_framebuffer (NegativeTestContext& ctx) in bind_framebuffer() argument
1057ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_DRAW_FRAMEBUFFER, GL_READ_FRAME… in bind_framebuffer()
1058 ctx.glBindFramebuffer(-1, 0); in bind_framebuffer()
1059 ctx.expectError(GL_INVALID_ENUM); in bind_framebuffer()
1060 ctx.glBindFramebuffer(GL_RENDERBUFFER, 0); in bind_framebuffer()
1061 ctx.expectError(GL_INVALID_ENUM); in bind_framebuffer()
1062 ctx.endSection(); in bind_framebuffer()
1065 void bind_renderbuffer (NegativeTestContext& ctx) in bind_renderbuffer() argument
1067 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER."); in bind_renderbuffer()
1068 ctx.glBindRenderbuffer(-1, 0); in bind_renderbuffer()
1069 ctx.expectError(GL_INVALID_ENUM); in bind_renderbuffer()
1070 ctx.glBindRenderbuffer(GL_FRAMEBUFFER, 0); in bind_renderbuffer()
1071 ctx.expectError(GL_INVALID_ENUM); in bind_renderbuffer()
1072 ctx.endSection(); in bind_renderbuffer()
1075 void check_framebuffer_status (NegativeTestContext& ctx) in check_framebuffer_status() argument
1077ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_DRAW_FRAMEBUFFER, GL_READ_FRAME… in check_framebuffer_status()
1078 ctx.glCheckFramebufferStatus(-1); in check_framebuffer_status()
1079 ctx.expectError(GL_INVALID_ENUM); in check_framebuffer_status()
1080 ctx.glCheckFramebufferStatus(GL_RENDERBUFFER); in check_framebuffer_status()
1081 ctx.expectError(GL_INVALID_ENUM); in check_framebuffer_status()
1082 ctx.endSection(); in check_framebuffer_status()
1085 void gen_framebuffers (NegativeTestContext& ctx) in gen_framebuffers() argument
1087 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative."); in gen_framebuffers()
1088 ctx.glGenFramebuffers(-1, 0); in gen_framebuffers()
1089 ctx.expectError(GL_INVALID_VALUE); in gen_framebuffers()
1090 ctx.endSection(); in gen_framebuffers()
1093 void gen_renderbuffers (NegativeTestContext& ctx) in gen_renderbuffers() argument
1095 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative."); in gen_renderbuffers()
1096 ctx.glGenRenderbuffers(-1, 0); in gen_renderbuffers()
1097 ctx.expectError(GL_INVALID_VALUE); in gen_renderbuffers()
1098 ctx.endSection(); in gen_renderbuffers()
1101 void delete_framebuffers (NegativeTestContext& ctx) in delete_framebuffers() argument
1103 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative."); in delete_framebuffers()
1104 ctx.glDeleteFramebuffers(-1, 0); in delete_framebuffers()
1105 ctx.expectError(GL_INVALID_VALUE); in delete_framebuffers()
1106 ctx.endSection(); in delete_framebuffers()
1109 void delete_renderbuffers (NegativeTestContext& ctx) in delete_renderbuffers() argument
1111 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative."); in delete_renderbuffers()
1112 ctx.glDeleteRenderbuffers(-1, 0); in delete_renderbuffers()
1113 ctx.expectError(GL_INVALID_VALUE); in delete_renderbuffers()
1114 ctx.endSection(); in delete_renderbuffers()
1117 void framebuffer_renderbuffer (NegativeTestContext& ctx) in framebuffer_renderbuffer() argument
1121 ctx.glGenFramebuffers(1, &fbo); in framebuffer_renderbuffer()
1122 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in framebuffer_renderbuffer()
1123 ctx.glGenRenderbuffers(1, &rbo); in framebuffer_renderbuffer()
1125 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); in framebuffer_renderbuffer()
1126 ctx.glFramebufferRenderbuffer(-1, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0); in framebuffer_renderbuffer()
1127 ctx.expectError(GL_INVALID_ENUM); in framebuffer_renderbuffer()
1128 ctx.endSection(); in framebuffer_renderbuffer()
1130 ctx.beginSection("GL_INVALID_ENUM is generated if attachment is not one of the accepted tokens."); in framebuffer_renderbuffer()
1131 ctx.glFramebufferRenderbuffer(GL_FRAMEBUFFER, -1, GL_RENDERBUFFER, 0); in framebuffer_renderbuffer()
1132 ctx.expectError(GL_INVALID_ENUM); in framebuffer_renderbuffer()
1133 ctx.endSection(); in framebuffer_renderbuffer()
1135 ctx.beginSection("GL_INVALID_ENUM is generated if renderbuffertarget is not GL_RENDERBUFFER."); in framebuffer_renderbuffer()
1136 ctx.glBindRenderbuffer(GL_RENDERBUFFER, rbo); in framebuffer_renderbuffer()
1137 ctx.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -1, rbo); in framebuffer_renderbuffer()
1138 ctx.expectError(GL_INVALID_ENUM); in framebuffer_renderbuffer()
1139 ctx.glBindRenderbuffer(GL_RENDERBUFFER, 0); in framebuffer_renderbuffer()
1140 ctx.endSection(); in framebuffer_renderbuffer()
1142ctx.beginSection("GL_INVALID_OPERATION is generated if renderbuffer is neither 0 nor the name of a… in framebuffer_renderbuffer()
1143 ctx.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, -1); in framebuffer_renderbuffer()
1144 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_renderbuffer()
1145 ctx.endSection(); in framebuffer_renderbuffer()
1147 ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to target."); in framebuffer_renderbuffer()
1148 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0); in framebuffer_renderbuffer()
1149 ctx.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0); in framebuffer_renderbuffer()
1150 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_renderbuffer()
1151 ctx.endSection(); in framebuffer_renderbuffer()
1153 ctx.glDeleteRenderbuffers(1, &rbo); in framebuffer_renderbuffer()
1154 ctx.glDeleteFramebuffers(1, &fbo); in framebuffer_renderbuffer()
1157 void framebuffer_texture (NegativeTestContext& ctx) in framebuffer_texture() argument
1159 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in framebuffer_texture()
1164 ctx.glGenFramebuffers(1, &fbo); in framebuffer_texture()
1165 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in framebuffer_texture()
1166 ctx.glGenTextures(2, texture); in framebuffer_texture()
1167 ctx.glBindTexture(GL_TEXTURE_2D, texture[0]); in framebuffer_texture()
1168 ctx.glBindTexture(GL_TEXTURE_BUFFER, texture[1]); in framebuffer_texture()
1169 ctx.expectError(GL_NO_ERROR); in framebuffer_texture()
1171 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); in framebuffer_texture()
1172 ctx.glFramebufferTexture(-1, GL_COLOR_ATTACHMENT0, texture[0], 0); in framebuffer_texture()
1173 ctx.expectError(GL_INVALID_ENUM); in framebuffer_texture()
1174 ctx.endSection(); in framebuffer_texture()
1176 ctx.beginSection("GL_INVALID_ENUM is generated if attachment is not one of the accepted tokens."); in framebuffer_texture()
1177 ctx.glFramebufferTexture(GL_FRAMEBUFFER, -1, texture[0], 0); in framebuffer_texture()
1178 ctx.expectError(GL_INVALID_ENUM); in framebuffer_texture()
1179 ctx.endSection(); in framebuffer_texture()
1181ctx.beginSection("GL_INVALID_OPERATION is generated if texture is neither 0 nor the name of an exi… in framebuffer_texture()
1182 ctx.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -1, 0); in framebuffer_texture()
1183 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture()
1184 ctx.endSection(); in framebuffer_texture()
1186 ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to target."); in framebuffer_texture()
1187 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0); in framebuffer_texture()
1188 ctx.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 0, 0); in framebuffer_texture()
1189 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture()
1190 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in framebuffer_texture()
1191 ctx.endSection(); in framebuffer_texture()
1193 ctx.beginSection("GL_INVALID_OPERATION is generated by if texture is a buffer texture."); in framebuffer_texture()
1194 ctx.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture[1], 0); in framebuffer_texture()
1195 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture()
1196 ctx.endSection(); in framebuffer_texture()
1198 ctx.glDeleteFramebuffers(1, &fbo); in framebuffer_texture()
1199 ctx.glDeleteBuffers(2, texture); in framebuffer_texture()
1203 void framebuffer_texture2d (NegativeTestContext& ctx) in framebuffer_texture2d() argument
1213 ctx.glGenFramebuffers(1, &fbo); in framebuffer_texture2d()
1214 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in framebuffer_texture2d()
1215 ctx.glGenTextures(1, &tex2D); in framebuffer_texture2d()
1216 ctx.glBindTexture(GL_TEXTURE_2D, tex2D); in framebuffer_texture2d()
1217 ctx.glGenTextures(1, &texCube); in framebuffer_texture2d()
1218 ctx.glBindTexture(GL_TEXTURE_CUBE_MAP, texCube); in framebuffer_texture2d()
1219 ctx.glGenTextures(1, &tex2DMS); in framebuffer_texture2d()
1220 ctx.glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, tex2DMS); in framebuffer_texture2d()
1221 ctx.glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTexSize); in framebuffer_texture2d()
1222 ctx.glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &maxTexCubeSize); in framebuffer_texture2d()
1223 ctx.expectError(GL_NO_ERROR); in framebuffer_texture2d()
1225 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); in framebuffer_texture2d()
1226 ctx.glFramebufferTexture2D(-1, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); in framebuffer_texture2d()
1227 ctx.expectError(GL_INVALID_ENUM); in framebuffer_texture2d()
1228 ctx.endSection(); in framebuffer_texture2d()
1230 ctx.beginSection("GL_INVALID_ENUM is generated if textarget is not an accepted texture target."); in framebuffer_texture2d()
1231 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -1, tex2D, 0); in framebuffer_texture2d()
1232 ctx.expectError(GL_INVALID_ENUM); in framebuffer_texture2d()
1233 ctx.endSection(); in framebuffer_texture2d()
1235 ctx.beginSection("GL_INVALID_ENUM is generated if attachment is not an accepted token."); in framebuffer_texture2d()
1236 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, -1, GL_TEXTURE_2D, tex2D, 0); in framebuffer_texture2d()
1237 ctx.expectError(GL_INVALID_ENUM); in framebuffer_texture2d()
1238 ctx.endSection(); in framebuffer_texture2d()
1240ctx.beginSection("GL_INVALID_VALUE is generated if level is less than 0 or larger than log_2 of ma… in framebuffer_texture2d()
1241 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, -1); in framebuffer_texture2d()
1242 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1244 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, maxSize); in framebuffer_texture2d()
1245 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1247ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X, t… in framebuffer_texture2d()
1248 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1249 ctx.endSection(); in framebuffer_texture2d()
1251 ctx.beginSection("GL_INVALID_VALUE is generated if level is larger than maximum texture size."); in framebuffer_texture2d()
1252ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, maxTexSize … in framebuffer_texture2d()
1253 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1254 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, -1); in framebuffer_texture2d()
1255 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1256ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, t… in framebuffer_texture2d()
1257 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1258ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, t… in framebuffer_texture2d()
1259 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1260ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, tex2DM… in framebuffer_texture2d()
1261 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1262 ctx.endSection(); in framebuffer_texture2d()
1264ctx.beginSection("GL_INVALID_OPERATION is generated if texture is neither 0 nor the name of an exi… in framebuffer_texture2d()
1265 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, -1, 0); in framebuffer_texture2d()
1266 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1267 ctx.endSection(); in framebuffer_texture2d()
1269 ctx.beginSection("GL_INVALID_OPERATION is generated if textarget and texture are not compatible."); in framebuffer_texture2d()
1270ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X, t… in framebuffer_texture2d()
1271 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1272ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, tex2D,… in framebuffer_texture2d()
1273 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1274 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texCube, 0); in framebuffer_texture2d()
1275 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1276 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2DMS, 0); in framebuffer_texture2d()
1277 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1278 ctx.glDeleteTextures(1, &tex2D); in framebuffer_texture2d()
1279 ctx.glDeleteTextures(1, &texCube); in framebuffer_texture2d()
1280 ctx.glDeleteTextures(1, &tex2DMS); in framebuffer_texture2d()
1281 ctx.endSection(); in framebuffer_texture2d()
1283 ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to target."); in framebuffer_texture2d()
1284 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0); in framebuffer_texture2d()
1285 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); in framebuffer_texture2d()
1286 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1287 ctx.endSection(); in framebuffer_texture2d()
1289 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in framebuffer_texture2d()
1292ctx.beginSection("GL_INVALID_OPERATION error is generated if texture is the name of a buffer textu… in framebuffer_texture2d()
1293 ctx.glGenTextures(1, &texBuf); in framebuffer_texture2d()
1294 ctx.glBindTexture(GL_TEXTURE_BUFFER, texBuf); in framebuffer_texture2d()
1295 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in framebuffer_texture2d()
1296 ctx.expectError(GL_NO_ERROR); in framebuffer_texture2d()
1297 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texBuf, 0); in framebuffer_texture2d()
1298 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1299 ctx.endSection(); in framebuffer_texture2d()
1302 ctx.glDeleteFramebuffers(1, &fbo); in framebuffer_texture2d()
1305 void renderbuffer_storage (NegativeTestContext& ctx) in renderbuffer_storage() argument
1310 ctx.glGenRenderbuffers (1, &rbo); in renderbuffer_storage()
1311 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo); in renderbuffer_storage()
1313 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER."); in renderbuffer_storage()
1314 ctx.glRenderbufferStorage (-1, GL_RGBA4, 1, 1); in renderbuffer_storage()
1315 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage()
1316 ctx.glRenderbufferStorage (GL_FRAMEBUFFER, GL_RGBA4, 1, 1); in renderbuffer_storage()
1317 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage()
1318 ctx.endSection(); in renderbuffer_storage()
1320ctx.beginSection("GL_INVALID_ENUM is generated if internalformat is not a color-renderable, depth-… in renderbuffer_storage()
1321 ctx.glRenderbufferStorage (GL_RENDERBUFFER, -1, 1, 1); in renderbuffer_storage()
1322 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage()
1324 …if (!ctx.isExtensionSupported("GL_EXT_color_buffer_half_float")) // GL_EXT_color_buffer_half_float… in renderbuffer_storage()
1326 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGB16F, 1, 1); in renderbuffer_storage()
1327 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage()
1330 if (!ctx.isExtensionSupported("GL_EXT_render_snorm")) // GL_EXT_render_snorm disables error in renderbuffer_storage()
1332 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA8_SNORM, 1, 1); in renderbuffer_storage()
1333 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage()
1336 ctx.endSection(); in renderbuffer_storage()
1338 ctx.beginSection("GL_INVALID_VALUE is generated if width or height is less than zero."); in renderbuffer_storage()
1339 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, -1, 1); in renderbuffer_storage()
1340 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage()
1341 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, 1, -1); in renderbuffer_storage()
1342 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage()
1343 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, -1, -1); in renderbuffer_storage()
1344 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage()
1345 ctx.endSection(); in renderbuffer_storage()
1347ctx.beginSection("GL_INVALID_VALUE is generated if width or height is greater than GL_MAX_RENDERBU… in renderbuffer_storage()
1348 ctx.glGetIntegerv (GL_MAX_RENDERBUFFER_SIZE, &maxSize); in renderbuffer_storage()
1349 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, 1, maxSize+1); in renderbuffer_storage()
1350 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage()
1351 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, maxSize+1, 1); in renderbuffer_storage()
1352 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage()
1353 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, maxSize+1, maxSize+1); in renderbuffer_storage()
1354 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage()
1355 ctx.endSection(); in renderbuffer_storage()
1357 ctx.glDeleteRenderbuffers(1, &rbo); in renderbuffer_storage()
1360 void blit_framebuffer (NegativeTestContext& ctx) in blit_framebuffer() argument
1367 ctx.glGenFramebuffers (1, &blankFrameBuffer); in blit_framebuffer()
1368 ctx.glGenFramebuffers (2, fbo); in blit_framebuffer()
1369 ctx.glGenTextures (2, texture); in blit_framebuffer()
1370 ctx.glGenRenderbuffers (2, rbo); in blit_framebuffer()
1372 ctx.glBindTexture (GL_TEXTURE_2D, texture[0]); in blit_framebuffer()
1373 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[0]); in blit_framebuffer()
1374 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, fbo[0]); in blit_framebuffer()
1376 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in blit_framebuffer()
1377 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 32, 32); in blit_framebuffer()
1378ctx.glFramebufferTexture2D (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[0], … in blit_framebuffer()
1379ctx.glFramebufferRenderbuffer(GL_READ_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, r… in blit_framebuffer()
1380 ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER); in blit_framebuffer()
1382 ctx.glBindTexture (GL_TEXTURE_2D, texture[1]); in blit_framebuffer()
1383 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[1]); in blit_framebuffer()
1384 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[1]); in blit_framebuffer()
1386 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in blit_framebuffer()
1387 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 32, 32); in blit_framebuffer()
1388ctx.glFramebufferTexture2D (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[1], … in blit_framebuffer()
1389ctx.glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, r… in blit_framebuffer()
1390 ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); in blit_framebuffer()
1391 ctx.expectError (GL_NO_ERROR); in blit_framebuffer()
1393ctx.beginSection("GL_INVALID_VALUE is generated if mask contains any bits other than GL_COLOR_BUFF… in blit_framebuffer()
1394 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, 1, GL_NEAREST); in blit_framebuffer()
1395 ctx.expectError (GL_INVALID_VALUE); in blit_framebuffer()
1396 ctx.endSection(); in blit_framebuffer()
1398 ctx.beginSection("GL_INVALID_ENUM is generated if filter is not GL_LINEAR or GL_NEAREST."); in blit_framebuffer()
1399 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, 0); in blit_framebuffer()
1400 ctx.expectError (GL_INVALID_ENUM); in blit_framebuffer()
1401 ctx.endSection(); in blit_framebuffer()
1403ctx.beginSection("GL_INVALID_OPERATION is generated if mask contains any of the GL_DEPTH_BUFFER_BI… in blit_framebuffer()
1404ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, G… in blit_framebuffer()
1405 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1406ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_… in blit_framebuffer()
1407 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1408ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, G… in blit_framebuffer()
1409 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1410 ctx.endSection(); in blit_framebuffer()
1412ctx.beginSection("GL_INVALID_OPERATION is generated if mask contains GL_COLOR_BUFFER_BIT and read … in blit_framebuffer()
1413 ctx.glBindTexture (GL_TEXTURE_2D, texture[0]); in blit_framebuffer()
1415ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32UI, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, NU… in blit_framebuffer()
1416ctx.glFramebufferTexture2D (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[0], … in blit_framebuffer()
1417ctx.getLog() << TestLog::Message << "// Read buffer: GL_RGBA32UI, draw buffer: GL_RGBA" << TestLog… in blit_framebuffer()
1418 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1419 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1421 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32I, 32, 32, 0, GL_RGBA_INTEGER, GL_INT, NULL); in blit_framebuffer()
1422ctx.glFramebufferTexture2D (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[0], … in blit_framebuffer()
1423ctx.getLog() << TestLog::Message << "// Read buffer: GL_RGBA32I, draw buffer: GL_RGBA" << TestLog:… in blit_framebuffer()
1424 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1425 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1427 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in blit_framebuffer()
1428ctx.glFramebufferTexture2D (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[0], … in blit_framebuffer()
1429 ctx.glBindTexture (GL_TEXTURE_2D, texture[1]); in blit_framebuffer()
1430 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32I, 32, 32, 0, GL_RGBA_INTEGER, GL_INT, NULL); in blit_framebuffer()
1431ctx.glFramebufferTexture2D (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[1], … in blit_framebuffer()
1432ctx.getLog() << TestLog::Message << "// Read buffer: GL_RGBA8, draw buffer: GL_RGBA32I" << TestLog… in blit_framebuffer()
1433 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1434 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1435 ctx.endSection(); in blit_framebuffer()
1437ctx.beginSection("GL_INVALID_OPERATION is generated if filter is GL_LINEAR and the read buffer con… in blit_framebuffer()
1438 ctx.glBindTexture (GL_TEXTURE_2D, texture[0]); in blit_framebuffer()
1439ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32UI, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, NU… in blit_framebuffer()
1440ctx.glFramebufferTexture2D (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[0], … in blit_framebuffer()
1441 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in blit_framebuffer()
1442ctx.glFramebufferTexture2D (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[1], … in blit_framebuffer()
1443ctx.getLog() << TestLog::Message << "// Read buffer: GL_RGBA32I, draw buffer: GL_RGBA8" << TestLog… in blit_framebuffer()
1444 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_LINEAR); in blit_framebuffer()
1445 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1446 ctx.endSection(); in blit_framebuffer()
1448ctx.beginSection("GL_INVALID_OPERATION is generated if mask contains GL_DEPTH_BUFFER_BIT or GL_STE… in blit_framebuffer()
1449 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[0]); in blit_framebuffer()
1450 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH32F_STENCIL8, 32, 32); in blit_framebuffer()
1451ctx.glFramebufferRenderbuffer(GL_READ_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, r… in blit_framebuffer()
1452 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_DEPTH_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1453 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1454 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_STENCIL_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1455 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1456 ctx.endSection(); in blit_framebuffer()
1458ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the read or draw framebuffer is… in blit_framebuffer()
1459 ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER); in blit_framebuffer()
1460 ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); in blit_framebuffer()
1461 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, 0, GL_NEAREST); in blit_framebuffer()
1462 ctx.expectError (GL_NO_ERROR); in blit_framebuffer()
1463 ctx.getLog() << TestLog::Message << "// incomplete read framebuffer" << TestLog::EndMessage; in blit_framebuffer()
1464 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, blankFrameBuffer); in blit_framebuffer()
1465 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[1]); in blit_framebuffer()
1466 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1467 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1468 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, 0, GL_NEAREST); in blit_framebuffer()
1469 ctx.expectError (GL_INVALID_FRAMEBUFFER_OPERATION); in blit_framebuffer()
1470 ctx.getLog() << TestLog::Message << "// incomplete draw framebuffer" << TestLog::EndMessage; in blit_framebuffer()
1471 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, fbo[1]); in blit_framebuffer()
1472 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, blankFrameBuffer); in blit_framebuffer()
1473 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1474 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1475 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, 0, GL_NEAREST); in blit_framebuffer()
1476 ctx.expectError (GL_INVALID_FRAMEBUFFER_OPERATION); in blit_framebuffer()
1477ctx.getLog() << TestLog::Message << "// incomplete read and draw framebuffer" << TestLog::EndMessa… in blit_framebuffer()
1478 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, blankFrameBuffer); in blit_framebuffer()
1479 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, blankFrameBuffer); in blit_framebuffer()
1480 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1481 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1482 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, 0, GL_NEAREST); in blit_framebuffer()
1483 ctx.expectError (GL_INVALID_FRAMEBUFFER_OPERATION); in blit_framebuffer()
1485 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, fbo[0]); in blit_framebuffer()
1486 ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER); in blit_framebuffer()
1487 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[1]); in blit_framebuffer()
1488 ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); in blit_framebuffer()
1489 ctx.endSection(); in blit_framebuffer()
1491ctx.beginSection("GL_INVALID_OPERATION is generated if the source and destination buffers are iden… in blit_framebuffer()
1492 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[0]); in blit_framebuffer()
1493 ctx.expectError (GL_NO_ERROR); in blit_framebuffer()
1494 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_DEPTH_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1495 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1497 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[1]); in blit_framebuffer()
1498 ctx.endSection(); in blit_framebuffer()
1500 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in blit_framebuffer()
1501 ctx.glBindRenderbuffer (GL_RENDERBUFFER, 0); in blit_framebuffer()
1502 ctx.glDeleteFramebuffers (2, fbo); in blit_framebuffer()
1503 ctx.glDeleteFramebuffers (1, &blankFrameBuffer); in blit_framebuffer()
1504 ctx.glDeleteTextures (2, texture); in blit_framebuffer()
1505 ctx.glDeleteRenderbuffers (2, rbo); in blit_framebuffer()
1508 void blit_framebuffer_multisample (NegativeTestContext& ctx) in blit_framebuffer_multisample() argument
1513 ctx.glGenFramebuffers (2, fbo); in blit_framebuffer_multisample()
1514 ctx.glGenRenderbuffers (2, rbo); in blit_framebuffer_multisample()
1516 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[0]); in blit_framebuffer_multisample()
1517 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, fbo[0]); in blit_framebuffer_multisample()
1518 ctx.glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_RGBA8, 32, 32); in blit_framebuffer_multisample()
1519ctx.glFramebufferRenderbuffer (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo[0]… in blit_framebuffer_multisample()
1520 ctx.glCheckFramebufferStatus (GL_READ_FRAMEBUFFER); in blit_framebuffer_multisample()
1522 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[1]); in blit_framebuffer_multisample()
1523 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[1]); in blit_framebuffer_multisample()
1525 ctx.expectError (GL_NO_ERROR); in blit_framebuffer_multisample()
1527 if (!ctx.isExtensionSupported("GL_NV_framebuffer_multisample")) in blit_framebuffer_multisample()
1529ctx.beginSection("GL_INVALID_OPERATION is generated if the value of GL_SAMPLE_BUFFERS for the draw… in blit_framebuffer_multisample()
1530 ctx.glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_RGBA8, 32, 32); in blit_framebuffer_multisample()
1531ctx.glFramebufferRenderbuffer (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo[1]… in blit_framebuffer_multisample()
1532 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer_multisample()
1533 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer_multisample()
1534 ctx.endSection(); in blit_framebuffer_multisample()
1536ctx.beginSection("GL_INVALID_OPERATION is generated if GL_SAMPLE_BUFFERS for the read buffer is gr… in blit_framebuffer_multisample()
1537 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, 32, 32); in blit_framebuffer_multisample()
1538ctx.glFramebufferRenderbuffer (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo[1]… in blit_framebuffer_multisample()
1539 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer_multisample()
1540 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer_multisample()
1541 ctx.endSection(); in blit_framebuffer_multisample()
1543ctx.beginSection("GL_INVALID_OPERATION is generated if GL_SAMPLE_BUFFERS for the read buffer is gr… in blit_framebuffer_multisample()
1544 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA8, 32, 32); in blit_framebuffer_multisample()
1545ctx.glFramebufferRenderbuffer (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo[1]… in blit_framebuffer_multisample()
1546 ctx.glBlitFramebuffer (0, 0, 16, 16, 2, 2, 18, 18, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer_multisample()
1547 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer_multisample()
1548 ctx.endSection(); in blit_framebuffer_multisample()
1551 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in blit_framebuffer_multisample()
1552 ctx.glDeleteRenderbuffers (2, rbo); in blit_framebuffer_multisample()
1553 ctx.glDeleteFramebuffers (2, fbo); in blit_framebuffer_multisample()
1556 void framebuffer_texture_layer (NegativeTestContext& ctx) in framebuffer_texture_layer() argument
1572 ctx.glGetIntegerv (GL_MAX_3D_TEXTURE_SIZE, &max3DTexSize); in framebuffer_texture_layer()
1573 ctx.glGetIntegerv (GL_MAX_TEXTURE_SIZE, &maxTexSize); in framebuffer_texture_layer()
1575 ctx.glGenFramebuffers (1, &fbo); in framebuffer_texture_layer()
1576 ctx.glGenTextures (1, &tex3D); in framebuffer_texture_layer()
1577 ctx.glGenTextures (1, &tex2DArray); in framebuffer_texture_layer()
1578 ctx.glGenTextures (1, &tex2D); in framebuffer_texture_layer()
1579 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in framebuffer_texture_layer()
1581 ctx.glBindTexture (GL_TEXTURE_3D, tex3D); in framebuffer_texture_layer()
1582 ctx.glTexImage3D (GL_TEXTURE_3D, 0, GL_RGBA, 4, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in framebuffer_texture_layer()
1583 ctx.glBindTexture (GL_TEXTURE_2D_ARRAY, tex2DArray); in framebuffer_texture_layer()
1584 ctx.glTexImage3D (GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, 4, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in framebuffer_texture_layer()
1585 ctx.glBindTexture (GL_TEXTURE_2D, tex2D); in framebuffer_texture_layer()
1586 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in framebuffer_texture_layer()
1588 ctx.expectError (GL_NO_ERROR); in framebuffer_texture_layer()
1590 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); in framebuffer_texture_layer()
1591 ctx.glFramebufferTextureLayer (-1, GL_COLOR_ATTACHMENT0, tex3D, 0, 1); in framebuffer_texture_layer()
1592 ctx.expectError (GL_INVALID_ENUM); in framebuffer_texture_layer()
1593 ctx.glFramebufferTextureLayer (GL_RENDERBUFFER, GL_COLOR_ATTACHMENT0, tex3D, 0, 1); in framebuffer_texture_layer()
1594 ctx.expectError (GL_INVALID_ENUM); in framebuffer_texture_layer()
1595 ctx.endSection(); in framebuffer_texture_layer()
1597 ctx.beginSection("GL_INVALID_ENUM is generated if attachment is not one of the accepted tokens."); in framebuffer_texture_layer()
1598 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, -1, tex3D, 0, 1); in framebuffer_texture_layer()
1599 ctx.expectError (GL_INVALID_ENUM); in framebuffer_texture_layer()
1600 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_BACK, tex3D, 0, 1); in framebuffer_texture_layer()
1601 ctx.expectError (GL_INVALID_ENUM); in framebuffer_texture_layer()
1602 ctx.endSection(); in framebuffer_texture_layer()
1604ctx.beginSection("GL_INVALID_OPERATION is generated if texture is non-zero and not the name of a 3… in framebuffer_texture_layer()
1605 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -1, 0, 0); in framebuffer_texture_layer()
1606 ctx.expectError (GL_INVALID_OPERATION); in framebuffer_texture_layer()
1607 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex2D, 0, 0); in framebuffer_texture_layer()
1608 ctx.expectError (GL_INVALID_OPERATION); in framebuffer_texture_layer()
1609 ctx.endSection(); in framebuffer_texture_layer()
1611 ctx.beginSection("GL_INVALID_VALUE is generated if texture is not zero and layer is negative."); in framebuffer_texture_layer()
1612 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex3D, 0, -1); in framebuffer_texture_layer()
1613 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1614 ctx.endSection(); in framebuffer_texture_layer()
1616ctx.beginSection("GL_INVALID_VALUE is generated if texture is not zero and layer is greater than G… in framebuffer_texture_layer()
1617 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex3D, 0, max3DTexSize); in framebuffer_texture_layer()
1618 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1619 ctx.endSection(); in framebuffer_texture_layer()
1621ctx.beginSection("GL_INVALID_VALUE is generated if texture is not zero and layer is greater than G… in framebuffer_texture_layer()
1622 ctx.glGetIntegerv (GL_MAX_ARRAY_TEXTURE_LAYERS, &maxArrayTexLayers); in framebuffer_texture_layer()
1623ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex2DArray, 0, maxArrayTexLay… in framebuffer_texture_layer()
1624 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1625 ctx.endSection(); in framebuffer_texture_layer()
1627 ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to target."); in framebuffer_texture_layer()
1628 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in framebuffer_texture_layer()
1629 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex3D, 0, 1); in framebuffer_texture_layer()
1630 ctx.expectError (GL_INVALID_OPERATION); in framebuffer_texture_layer()
1631 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in framebuffer_texture_layer()
1632 ctx.endSection(); in framebuffer_texture_layer()
1634ctx.beginSection("GL_INVALID_VALUE is generated if texture is a 3D texture and level is less than … in framebuffer_texture_layer()
1636 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex3D, -1, max3DTexSize - 1); in framebuffer_texture_layer()
1637 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1638ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex3D, log2Max3DTexSize + 1, … in framebuffer_texture_layer()
1639 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1640 ctx.endSection(); in framebuffer_texture_layer()
1642ctx.beginSection("GL_INVALID_VALUE is generated if texture is a 2D array texture and layer is less… in framebuffer_texture_layer()
1644ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex2DArray, -1, maxArrayTexLa… in framebuffer_texture_layer()
1645 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1646ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex2DArray, log2MaxTexSize + … in framebuffer_texture_layer()
1647 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1648 ctx.endSection(); in framebuffer_texture_layer()
1650 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in framebuffer_texture_layer()
1652 ctx.glGetIntegerv (GL_MAX_CUBE_MAP_TEXTURE_SIZE, &maxCubeTexSize); in framebuffer_texture_layer()
1653 ctx.glGenTextures (1, &tex2DMSArray); in framebuffer_texture_layer()
1654 ctx.glGenTextures (1, &texCube); in framebuffer_texture_layer()
1655 ctx.glGenTextures (1, &texBuffer); in framebuffer_texture_layer()
1656 ctx.glBindTexture (GL_TEXTURE_2D_MULTISAMPLE_ARRAY, tex2DMSArray); in framebuffer_texture_layer()
1657 ctx.glBindTexture (GL_TEXTURE_CUBE_MAP, texCube); in framebuffer_texture_layer()
1658 ctx.glBindTexture (GL_TEXTURE_BUFFER, texBuffer); in framebuffer_texture_layer()
1659 ctx.expectError (GL_NO_ERROR); in framebuffer_texture_layer()
1661 ctx.beginSection("GL_INVALID_OPERATION is generated if texture is the name of a buffer texture."); in framebuffer_texture_layer()
1662 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texBuffer, 0, 0); in framebuffer_texture_layer()
1663 ctx.expectError (GL_INVALID_OPERATION); in framebuffer_texture_layer()
1664 ctx.endSection(); in framebuffer_texture_layer()
1666 ctx.glDeleteTextures (1, &tex2DMSArray); in framebuffer_texture_layer()
1667 ctx.glDeleteTextures (1, &texCube); in framebuffer_texture_layer()
1668 ctx.glDeleteTextures (1, &texBuffer); in framebuffer_texture_layer()
1671 ctx.glDeleteTextures (1, &tex3D); in framebuffer_texture_layer()
1672 ctx.glDeleteTextures (1, &tex2DArray); in framebuffer_texture_layer()
1673 ctx.glDeleteTextures (1, &tex2D); in framebuffer_texture_layer()
1674 ctx.glDeleteFramebuffers (1, &fbo); in framebuffer_texture_layer()
1677 void invalidate_framebuffer (NegativeTestContext& ctx) in invalidate_framebuffer() argument
1684 ctx.glGetIntegerv (GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments); in invalidate_framebuffer()
1689 ctx.glGenFramebuffers (1, &fbo); in invalidate_framebuffer()
1690 ctx.glGenTextures (1, &texture); in invalidate_framebuffer()
1691 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in invalidate_framebuffer()
1692 ctx.glBindTexture (GL_TEXTURE_2D, texture); in invalidate_framebuffer()
1693 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in invalidate_framebuffer()
1694 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in invalidate_framebuffer()
1695 ctx.glCheckFramebufferStatus (GL_FRAMEBUFFER); in invalidate_framebuffer()
1696 ctx.expectError (GL_NO_ERROR); in invalidate_framebuffer()
1698ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER, GL_READ_FRAMEBUFFE… in invalidate_framebuffer()
1699 ctx.glInvalidateFramebuffer (-1, 1, &attachments[0]); in invalidate_framebuffer()
1700 ctx.expectError (GL_INVALID_ENUM); in invalidate_framebuffer()
1701 ctx.glInvalidateFramebuffer (GL_BACK, 1, &attachments[0]); in invalidate_framebuffer()
1702 ctx.expectError (GL_INVALID_ENUM); in invalidate_framebuffer()
1703 ctx.endSection(); in invalidate_framebuffer()
1705ctx.beginSection("GL_INVALID_OPERATION is generated if attachments contains GL_COLOR_ATTACHMENTm a… in invalidate_framebuffer()
1706 ctx.glInvalidateFramebuffer (GL_FRAMEBUFFER, 1, &attachments[1]); in invalidate_framebuffer()
1707 ctx.expectError (GL_INVALID_OPERATION); in invalidate_framebuffer()
1708 ctx.endSection(); in invalidate_framebuffer()
1710 ctx.beginSection("GL_INVALID_VALUE is generated if numAttachments is negative."); in invalidate_framebuffer()
1711 ctx.glInvalidateFramebuffer (GL_FRAMEBUFFER, -1, &attachments[0]); in invalidate_framebuffer()
1712 ctx.expectError (GL_INVALID_VALUE); in invalidate_framebuffer()
1713 ctx.endSection(); in invalidate_framebuffer()
1715ctx.beginSection("GL_INVALID_ENUM is generated if the default framebuffer is bound to target and a… in invalidate_framebuffer()
1716 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in invalidate_framebuffer()
1717 ctx.glInvalidateFramebuffer (GL_FRAMEBUFFER, 1, &attachments[2]); in invalidate_framebuffer()
1718 ctx.expectError (GL_INVALID_ENUM); in invalidate_framebuffer()
1719 ctx.endSection(); in invalidate_framebuffer()
1722 ctx.glDeleteTextures (1, &texture); in invalidate_framebuffer()
1723 ctx.glDeleteFramebuffers (1, &fbo); in invalidate_framebuffer()
1726 void invalidate_sub_framebuffer (NegativeTestContext& ctx) in invalidate_sub_framebuffer() argument
1733 ctx.glGetIntegerv (GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments); in invalidate_sub_framebuffer()
1738 ctx.glGenFramebuffers (1, &fbo); in invalidate_sub_framebuffer()
1739 ctx.glGenTextures (1, &texture); in invalidate_sub_framebuffer()
1740 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in invalidate_sub_framebuffer()
1741 ctx.glBindTexture (GL_TEXTURE_2D, texture); in invalidate_sub_framebuffer()
1742 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in invalidate_sub_framebuffer()
1743 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in invalidate_sub_framebuffer()
1744 ctx.glCheckFramebufferStatus (GL_FRAMEBUFFER); in invalidate_sub_framebuffer()
1745 ctx.expectError (GL_NO_ERROR); in invalidate_sub_framebuffer()
1747ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER, GL_READ_FRAMEBUFFE… in invalidate_sub_framebuffer()
1748 ctx.glInvalidateSubFramebuffer (-1, 1, &attachments[0], 0, 0, 16, 16); in invalidate_sub_framebuffer()
1749 ctx.expectError (GL_INVALID_ENUM); in invalidate_sub_framebuffer()
1750 ctx.glInvalidateSubFramebuffer (GL_BACK, 1, &attachments[0], 0, 0, 16, 16); in invalidate_sub_framebuffer()
1751 ctx.expectError (GL_INVALID_ENUM); in invalidate_sub_framebuffer()
1752 ctx.endSection(); in invalidate_sub_framebuffer()
1754ctx.beginSection("GL_INVALID_OPERATION is generated if attachments contains GL_COLOR_ATTACHMENTm a… in invalidate_sub_framebuffer()
1755 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, 1, &attachments[1], 0, 0, 16, 16); in invalidate_sub_framebuffer()
1756 ctx.expectError (GL_INVALID_OPERATION); in invalidate_sub_framebuffer()
1757 ctx.endSection(); in invalidate_sub_framebuffer()
1759 ctx.beginSection("GL_INVALID_VALUE is generated if numAttachments, width, or heigh is negative."); in invalidate_sub_framebuffer()
1760 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, -1, &attachments[0], 0, 0, 16, 16); in invalidate_sub_framebuffer()
1761 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1762 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, -1, &attachments[0], 0, 0, -1, 16); in invalidate_sub_framebuffer()
1763 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1764 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, -1, &attachments[0], 0, 0, 16, -1); in invalidate_sub_framebuffer()
1765 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1766 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, -1, &attachments[0], 0, 0, -1, -1); in invalidate_sub_framebuffer()
1767 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1768 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, 1, &attachments[0], 0, 0, -1, 16); in invalidate_sub_framebuffer()
1769 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1770 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, 1, &attachments[0], 0, 0, 16, -1); in invalidate_sub_framebuffer()
1771 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1772 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, 1, &attachments[0], 0, 0, -1, -1); in invalidate_sub_framebuffer()
1773 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1774 ctx.endSection(); in invalidate_sub_framebuffer()
1776ctx.beginSection("GL_INVALID_ENUM is generated if the default framebuffer is bound to target and a… in invalidate_sub_framebuffer()
1777 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in invalidate_sub_framebuffer()
1778 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, 1, &attachments[2], 0, 0, 16, 16); in invalidate_sub_framebuffer()
1779 ctx.expectError (GL_INVALID_ENUM); in invalidate_sub_framebuffer()
1780 ctx.endSection(); in invalidate_sub_framebuffer()
1782 ctx.glDeleteTextures (1, &texture); in invalidate_sub_framebuffer()
1783 ctx.glDeleteFramebuffers (1, &fbo); in invalidate_sub_framebuffer()
1786 void renderbuffer_storage_multisample (NegativeTestContext& ctx) in renderbuffer_storage_multisample() argument
1793 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA4, GL_SAMPLES, 1, &maxSamplesSupportedRGBA4); in renderbuffer_storage_multisample()
1794ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA8UI, GL_SAMPLES, 1, &maxSamplesSupportedRGBA… in renderbuffer_storage_multisample()
1796 ctx.glGenRenderbuffers (1, &rbo); in renderbuffer_storage_multisample()
1797 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo); in renderbuffer_storage_multisample()
1799 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER."); in renderbuffer_storage_multisample()
1800 ctx.glRenderbufferStorageMultisample (-1, 2, GL_RGBA4, 1, 1); in renderbuffer_storage_multisample()
1801 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage_multisample()
1802 ctx.glRenderbufferStorageMultisample (GL_FRAMEBUFFER, 2, GL_RGBA4, 1, 1); in renderbuffer_storage_multisample()
1803 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage_multisample()
1804 ctx.endSection(); in renderbuffer_storage_multisample()
1806ctx.beginSection("GL_INVALID_OPERATION is generated if samples is greater than the maximum number … in renderbuffer_storage_multisample()
1807 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, maxSamplesSupportedRGBA4+1, GL_RGBA4, 1, 1); in renderbuffer_storage_multisample()
1808 ctx.expectError (GL_INVALID_OPERATION); in renderbuffer_storage_multisample()
1809 ctx.endSection(); in renderbuffer_storage_multisample()
1811ctx.beginSection("GL_INVALID_ENUM is generated if internalformat is not a color-renderable, depth-… in renderbuffer_storage_multisample()
1812 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, -1, 1, 1); in renderbuffer_storage_multisample()
1813 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage_multisample()
1815 …if (!ctx.isExtensionSupported("GL_EXT_color_buffer_half_float")) // GL_EXT_color_buffer_half_float… in renderbuffer_storage_multisample()
1817 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, GL_RGB16F, 1, 1); in renderbuffer_storage_multisample()
1818 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage_multisample()
1821 if (!ctx.isExtensionSupported("GL_EXT_render_snorm")) // GL_EXT_render_snorm disables error in renderbuffer_storage_multisample()
1823 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, GL_RGBA8_SNORM, 1, 1); in renderbuffer_storage_multisample()
1824 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage_multisample()
1827 ctx.endSection(); in renderbuffer_storage_multisample()
1829ctx.beginSection("GL_INVALID_OPERATION is generated if samples is greater than the maximum number … in renderbuffer_storage_multisample()
1830ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, maxSamplesSupportedRGBA8UI+1, GL_RGBA8UI, 1… in renderbuffer_storage_multisample()
1831 ctx.expectError (GL_INVALID_OPERATION); in renderbuffer_storage_multisample()
1832 ctx.endSection(); in renderbuffer_storage_multisample()
1834 ctx.beginSection("GL_INVALID_VALUE is generated if width or height is less than zero."); in renderbuffer_storage_multisample()
1835 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, GL_RGBA4, -1, 1); in renderbuffer_storage_multisample()
1836 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1837 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, GL_RGBA4, 1, -1); in renderbuffer_storage_multisample()
1838 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1839 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, GL_RGBA4, -1, -1); in renderbuffer_storage_multisample()
1840 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1841 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, -1, GL_RGBA4, 1, 1); in renderbuffer_storage_multisample()
1842 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1843 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, -1, GL_RGBA4, -1, 1); in renderbuffer_storage_multisample()
1844 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1845 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, -1, GL_RGBA4, 1, -1); in renderbuffer_storage_multisample()
1846 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1847 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, -1, GL_RGBA4, -1, -1); in renderbuffer_storage_multisample()
1848 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1849 ctx.endSection(); in renderbuffer_storage_multisample()
1851ctx.beginSection("GL_INVALID_VALUE is generated if width or height is greater than GL_MAX_RENDERBU… in renderbuffer_storage_multisample()
1852 ctx.glGetIntegerv (GL_MAX_RENDERBUFFER_SIZE, &maxSize); in renderbuffer_storage_multisample()
1853 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 4, GL_RGBA4, 1, maxSize+1); in renderbuffer_storage_multisample()
1854 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1855 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 4, GL_RGBA4, maxSize+1, 1); in renderbuffer_storage_multisample()
1856 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1857 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 4, GL_RGBA4, maxSize+1, maxSize+1); in renderbuffer_storage_multisample()
1858 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1859 ctx.endSection(); in renderbuffer_storage_multisample()
1861 ctx.glDeleteRenderbuffers(1, &rbo); in renderbuffer_storage_multisample()
1864 void copy_image_sub_data (NegativeTestContext& ctx) in copy_image_sub_data() argument
1866 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in copy_image_sub_data()
1871 ctx.glGenTextures (5, texture); in copy_image_sub_data()
1872 ctx.glGenRenderbuffers (1, &rbo); in copy_image_sub_data()
1873 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo); in copy_image_sub_data()
1875 ctx.glBindTexture (GL_TEXTURE_2D, texture[0]); in copy_image_sub_data()
1876 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in copy_image_sub_data()
1877 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in copy_image_sub_data()
1878 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in copy_image_sub_data()
1879 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA8, 32, 32); in copy_image_sub_data()
1880 ctx.glBindTexture (GL_TEXTURE_2D, texture[1]); in copy_image_sub_data()
1881 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in copy_image_sub_data()
1882 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in copy_image_sub_data()
1883 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in copy_image_sub_data()
1884 ctx.expectError (GL_NO_ERROR); in copy_image_sub_data()
1886 ctx.glBindTexture (GL_TEXTURE_3D, texture[2]); in copy_image_sub_data()
1887 ctx.glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in copy_image_sub_data()
1888 ctx.glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in copy_image_sub_data()
1889 ctx.glTexImage3D (GL_TEXTURE_3D, 0, GL_RGBA8, 32, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in copy_image_sub_data()
1890 ctx.expectError (GL_NO_ERROR); in copy_image_sub_data()
1892 ctx.glBindTexture (GL_TEXTURE_3D, texture[3]); in copy_image_sub_data()
1893 ctx.glTexImage3D (GL_TEXTURE_3D, 0, GL_RGBA8, 32, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in copy_image_sub_data()
1894 ctx.expectError (GL_NO_ERROR); in copy_image_sub_data()
1896 ctx.glBindTexture (GL_TEXTURE_2D, texture[4]); in copy_image_sub_data()
1897 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in copy_image_sub_data()
1898 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in copy_image_sub_data()
1899 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32F, 32, 32, 0, GL_RGBA, GL_FLOAT, NULL); in copy_image_sub_data()
1900 ctx.expectError (GL_NO_ERROR); in copy_image_sub_data()
1902ctx.beginSection("GL_INVALID_VALUE is generated if srcWidth, srcHeight, or srcDepth is negative."); in copy_image_sub_data()
1903ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1904 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1905ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1906 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1907ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1908 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1909ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1910 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1911ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1912 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1913ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1914 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1915ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1916 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1917 ctx.endSection(); in copy_image_sub_data()
1919ctx.beginSection("GL_INVALID_VALUE is generated if srcLevel and dstLevel are not valid levels for … in copy_image_sub_data()
1920ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 1, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1921 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1922ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 1, 0, 0… in copy_image_sub_data()
1923 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1924ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 1, 0, 0, 0, texture[1], GL_TEXTURE_2D, 1, 0, 0… in copy_image_sub_data()
1925 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1926ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, -1, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, … in copy_image_sub_data()
1927 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1928ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, -1, 0, … in copy_image_sub_data()
1929 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1930ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, -1, 0, 0, 0, texture[1], GL_TEXTURE_2D, -1, 0,… in copy_image_sub_data()
1931 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1932ctx.glCopyImageSubData (rbo, GL_RENDERBUFFER, -1, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0, 0,… in copy_image_sub_data()
1933 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1934ctx.glCopyImageSubData (rbo, GL_RENDERBUFFER, 1, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0, 0, … in copy_image_sub_data()
1935 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1936ctx.glCopyImageSubData (texture[1], GL_TEXTURE_2D, 0, 0, 0, 0, rbo, GL_RENDERBUFFER, -1, 0, 0, 0,… in copy_image_sub_data()
1937 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1938ctx.glCopyImageSubData (texture[1], GL_TEXTURE_2D, 0, 0, 0, 0, rbo, GL_RENDERBUFFER, 1, 0, 0, 0, … in copy_image_sub_data()
1939 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1940 ctx.endSection(); in copy_image_sub_data()
1942ctx.beginSection("GL_INVALID_ENUM is generated if either target does not match the type of the obj… in copy_image_sub_data()
1946ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_3D, 0, 0, 0… in copy_image_sub_data()
1947 ctx.expectError (GL_INVALID_ENUM); in copy_image_sub_data()
1948ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[2], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1949 ctx.expectError (GL_INVALID_ENUM); in copy_image_sub_data()
1950ctx.glCopyImageSubData (texture[0], GL_TEXTURE_3D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1951 ctx.expectError (GL_INVALID_ENUM); in copy_image_sub_data()
1952ctx.glCopyImageSubData (texture[2], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1953 ctx.expectError (GL_INVALID_ENUM); in copy_image_sub_data()
1954 ctx.endSection(); in copy_image_sub_data()
1956ctx.beginSection("GL_INVALID_OPERATION is generated if either object is a texture and the texture … in copy_image_sub_data()
1957ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[3], GL_TEXTURE_3D, 0, 0, 0… in copy_image_sub_data()
1958 ctx.expectError (GL_INVALID_OPERATION); in copy_image_sub_data()
1959ctx.glCopyImageSubData (texture[3], GL_TEXTURE_3D, 0, 0, 0, 0, texture[0], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1960 ctx.expectError (GL_INVALID_OPERATION); in copy_image_sub_data()
1961ctx.glCopyImageSubData (texture[3], GL_TEXTURE_3D, 0, 0, 0, 0, texture[3], GL_TEXTURE_3D, 0, 0, 0… in copy_image_sub_data()
1962 ctx.expectError (GL_INVALID_OPERATION); in copy_image_sub_data()
1963 ctx.endSection(); in copy_image_sub_data()
1965ctx.beginSection("GL_INVALID_VALUE is generated if the dimensions of either subregion exceeds the … in copy_image_sub_data()
1966ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1967 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1968ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1969 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1970 ctx.endSection(); in copy_image_sub_data()
1972ctx.beginSection("GL_INVALID_OPERATION error is generated if the source and destination internal f… in copy_image_sub_data()
1973ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[4], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1974 ctx.expectError (GL_INVALID_OPERATION); in copy_image_sub_data()
1975ctx.glCopyImageSubData (texture[4], GL_TEXTURE_2D, 0, 0, 0, 0, texture[0], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1976 ctx.expectError (GL_INVALID_OPERATION); in copy_image_sub_data()
1977 ctx.endSection(); in copy_image_sub_data()
1979 ctx.glDeleteTextures (5, texture); in copy_image_sub_data()
1980 ctx.glDeleteRenderbuffers (1, &rbo); in copy_image_sub_data()