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 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32F, 32, 32, 0, GL_RGBA, GL_FLOAT, NULL); in read_pixels_fbo_format_mismatch()
313 ctx.expectError (GL_NO_ERROR); in read_pixels_fbo_format_mismatch()
314 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in read_pixels_fbo_format_mismatch()
315 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in read_pixels_fbo_format_mismatch()
316 ctx.expectError (GL_NO_ERROR); in read_pixels_fbo_format_mismatch()
317 ctx.glReadPixels (0, 0, 1, 1, GL_RGBA, GL_INT, &floatData[0]); in read_pixels_fbo_format_mismatch()
318 ctx.expectError (GL_INVALID_OPERATION); in read_pixels_fbo_format_mismatch()
320 ctx.endSection(); in read_pixels_fbo_format_mismatch()
322ctx.beginSection("GL_INVALID_OPERATION is generated if GL_READ_FRAMEBUFFER_BINDING is non-zero, th… in read_pixels_fbo_format_mismatch()
328 ctx.glGenRenderbuffers(1, &rbo); in read_pixels_fbo_format_mismatch()
329 ctx.glBindRenderbuffer(GL_RENDERBUFFER, rbo); in read_pixels_fbo_format_mismatch()
330 ctx.glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_RGBA8, 32, 32); in read_pixels_fbo_format_mismatch()
331 ctx.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo); in read_pixels_fbo_format_mismatch()
333 ctx.glGetIntegerv (GL_READ_FRAMEBUFFER_BINDING, &binding); in read_pixels_fbo_format_mismatch()
334ctx.getLog() << TestLog::Message << "// GL_READ_FRAMEBUFFER_BINDING: " << binding << TestLog::EndM… in read_pixels_fbo_format_mismatch()
335 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in read_pixels_fbo_format_mismatch()
336 ctx.glGetIntegerv (GL_SAMPLE_BUFFERS, &sampleBuffers); in read_pixels_fbo_format_mismatch()
337ctx.getLog() << TestLog::Message << "// GL_SAMPLE_BUFFERS: " << sampleBuffers << TestLog::EndMessa… in read_pixels_fbo_format_mismatch()
338 ctx.expectError (GL_NO_ERROR); in read_pixels_fbo_format_mismatch()
342ctx.getLog() << TestLog::Message << "// ERROR: expected GL_READ_FRAMEBUFFER_BINDING to be non-zero… in read_pixels_fbo_format_mismatch()
343 ctx.fail("Got invalid value"); in read_pixels_fbo_format_mismatch()
347 ctx.glReadPixels (0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]); in read_pixels_fbo_format_mismatch()
348 ctx.expectError (GL_INVALID_OPERATION); in read_pixels_fbo_format_mismatch()
351 ctx.endSection(); in read_pixels_fbo_format_mismatch()
353 ctx.glBindRenderbuffer (GL_RENDERBUFFER, 0); in read_pixels_fbo_format_mismatch()
354 ctx.glBindTexture (GL_TEXTURE_2D, 0); in read_pixels_fbo_format_mismatch()
355 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in read_pixels_fbo_format_mismatch()
356 ctx.glDeleteFramebuffers (1, &fbo); in read_pixels_fbo_format_mismatch()
357 ctx.glDeleteTextures (1, &texture); in read_pixels_fbo_format_mismatch()
358 ctx.glDeleteRenderbuffers (1, &rbo); in read_pixels_fbo_format_mismatch()
361 void bind_buffer_range (NegativeTestContext& ctx) in bind_buffer_range() argument
370 ctx.glGenBuffers(1, &bufU); in bind_buffer_range()
371 ctx.glBindBuffer(GL_UNIFORM_BUFFER, bufU); in bind_buffer_range()
372 ctx.glBufferData(GL_UNIFORM_BUFFER, 16, NULL, GL_STREAM_DRAW); in bind_buffer_range()
374 ctx.glGenBuffers(1, &bufTF); in bind_buffer_range()
375 ctx.glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, bufTF); in bind_buffer_range()
376 ctx.glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 16, NULL, GL_STREAM_DRAW); in bind_buffer_range()
378 ctx.glGenBuffers(1, &bufAC); in bind_buffer_range()
379 ctx.glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, bufAC); in bind_buffer_range()
380 ctx.glBufferData(GL_ATOMIC_COUNTER_BUFFER, 16, NULL, GL_STREAM_DRAW); in bind_buffer_range()
382ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_ATOMIC_COUNTER_BUFFER, GL_SHADE… in bind_buffer_range()
383 ctx.glBindBufferRange(GL_ARRAY_BUFFER, 0, bufU, 0, 4); in bind_buffer_range()
384 ctx.expectError(GL_INVALID_ENUM); in bind_buffer_range()
385 ctx.endSection(); in bind_buffer_range()
387ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_TRANSFORM_FEEDBACK_BUFFER and inde… in bind_buffer_range()
388 ctx.glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &maxTFSize); in bind_buffer_range()
389 ctx.glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, maxTFSize, bufTF, 0, 4); in bind_buffer_range()
390 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
391 ctx.endSection(); in bind_buffer_range()
393ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_UNIFORM_BUFFER and index is greate… in bind_buffer_range()
394 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUSize); in bind_buffer_range()
395 ctx.glBindBufferRange(GL_UNIFORM_BUFFER, maxUSize, bufU, 0, 4); in bind_buffer_range()
396 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
397 ctx.endSection(); in bind_buffer_range()
399 ctx.beginSection("GL_INVALID_VALUE is generated if size is less than or equal to zero."); in bind_buffer_range()
400 ctx.glBindBufferRange(GL_UNIFORM_BUFFER, 0, bufU, 0, -1); in bind_buffer_range()
401 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
402 ctx.glBindBufferRange(GL_UNIFORM_BUFFER, 0, bufU, 0, 0); in bind_buffer_range()
403 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
404 ctx.endSection(); in bind_buffer_range()
406 ctx.beginSection("GL_INVALID_VALUE is generated if offset is less than zero."); in bind_buffer_range()
407 ctx.glBindBufferRange(GL_UNIFORM_BUFFER, 0, bufU, -1, 0); in bind_buffer_range()
408 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
409 ctx.endSection(); in bind_buffer_range()
411ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_TRANSFORM_FEEDBACK_BUFFER and size… in bind_buffer_range()
412 ctx.glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 4, 5); in bind_buffer_range()
413 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
414 ctx.glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 5, 4); in bind_buffer_range()
415 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
416 ctx.glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 5, 7); in bind_buffer_range()
417 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
418 ctx.endSection(); in bind_buffer_range()
420ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_UNIFORM_BUFFER and offset is not a… in bind_buffer_range()
421 ctx.glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &uAlignment); in bind_buffer_range()
422 ctx.glBindBufferRange(GL_UNIFORM_BUFFER, 0, bufU, uAlignment+1, 4); in bind_buffer_range()
423 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
424 ctx.endSection(); in bind_buffer_range()
426 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in bind_buffer_range()
432ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_ATOMIC_COUNTER_BUFFER and index is… in bind_buffer_range()
433 ctx.glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &maxACize); in bind_buffer_range()
434 ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, maxACize, bufU, 0, 4); in bind_buffer_range()
435 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
436 ctx.endSection(); in bind_buffer_range()
438ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_SHADER_STORAGE_BUFFER and index is… in bind_buffer_range()
439 ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxSSize); in bind_buffer_range()
440 ctx.glBindBufferRange(GL_SHADER_STORAGE_BUFFER, maxSSize, bufU, 0, 4); in bind_buffer_range()
441 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
442 ctx.endSection(); in bind_buffer_range()
444ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_ATOMIC_COUNTER_BUFFER and offset i… in bind_buffer_range()
445 ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, 0, bufTF, 5, 0); in bind_buffer_range()
446 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
447 ctx.endSection(); in bind_buffer_range()
449ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_SHADER_STORAGE_BUFFER and offset i… in bind_buffer_range()
450 ctx.glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &ssAlignment); in bind_buffer_range()
451 ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, 0, bufTF, ssAlignment+1, 0); in bind_buffer_range()
452 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_range()
453 ctx.endSection(); in bind_buffer_range()
456 ctx.glDeleteBuffers(1, &bufU); in bind_buffer_range()
457 ctx.glDeleteBuffers(1, &bufTF); in bind_buffer_range()
458 ctx.glDeleteBuffers(1, &bufAC); in bind_buffer_range()
461 void bind_buffer_base (NegativeTestContext& ctx) in bind_buffer_base() argument
468 ctx.glGenBuffers(1, &bufU); in bind_buffer_base()
469 ctx.glBindBuffer(GL_UNIFORM_BUFFER, bufU); in bind_buffer_base()
470 ctx.glBufferData(GL_UNIFORM_BUFFER, 16, NULL, GL_STREAM_DRAW); in bind_buffer_base()
472 ctx.glGenBuffers(1, &bufTF); in bind_buffer_base()
473 ctx.glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, bufTF); in bind_buffer_base()
474 ctx.glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 16, NULL, GL_STREAM_DRAW); in bind_buffer_base()
475 ctx.expectError(GL_NO_ERROR); in bind_buffer_base()
477ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_ATOMIC_COUNTER_BUFFER, GL_SHADE… in bind_buffer_base()
478 ctx.glBindBufferBase(-1, 0, bufU); in bind_buffer_base()
479 ctx.expectError(GL_INVALID_ENUM); in bind_buffer_base()
480 ctx.glBindBufferBase(GL_ARRAY_BUFFER, 0, bufU); in bind_buffer_base()
481 ctx.expectError(GL_INVALID_ENUM); in bind_buffer_base()
482 ctx.endSection(); in bind_buffer_base()
484ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_UNIFORM_BUFFER and index is greate… in bind_buffer_base()
485 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUSize); in bind_buffer_base()
486 ctx.glBindBufferBase(GL_UNIFORM_BUFFER, maxUSize, bufU); in bind_buffer_base()
487 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_base()
488 ctx.endSection(); in bind_buffer_base()
490ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_TRANSFORM_FEEDBACK_BUFFER andindex… in bind_buffer_base()
491 ctx.glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &maxTFSize); in bind_buffer_base()
492 ctx.glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, maxTFSize, bufTF); in bind_buffer_base()
493 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_base()
494 ctx.endSection(); in bind_buffer_base()
496 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in bind_buffer_base()
501ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_ATOMIC_COUNTER_BUFFER and index is… in bind_buffer_base()
502 ctx.glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &maxACize); in bind_buffer_base()
503 ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, maxACize, bufU, 0, 4); in bind_buffer_base()
504 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_base()
505 ctx.endSection(); in bind_buffer_base()
507ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_SHADER_STORAGE_BUFFER and index is… in bind_buffer_base()
508 ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxSSize); in bind_buffer_base()
509 ctx.glBindBufferRange(GL_SHADER_STORAGE_BUFFER, maxSSize, bufU, 0, 4); in bind_buffer_base()
510 ctx.expectError(GL_INVALID_VALUE); in bind_buffer_base()
511 ctx.endSection(); in bind_buffer_base()
514 ctx.glDeleteBuffers(1, &bufU); in bind_buffer_base()
515 ctx.glDeleteBuffers(1, &bufTF); in bind_buffer_base()
518 void clear_bufferiv (NegativeTestContext& ctx) in clear_bufferiv() argument
525 ctx.glGenTextures (1, &texture); in clear_bufferiv()
526 ctx.glBindTexture (GL_TEXTURE_2D, texture); in clear_bufferiv()
527 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32I, 32, 32, 0, GL_RGBA_INTEGER, GL_INT, NULL); in clear_bufferiv()
528 ctx.glGenFramebuffers (1, &fbo); in clear_bufferiv()
529 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in clear_bufferiv()
530 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in clear_bufferiv()
531 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in clear_bufferiv()
532 ctx.expectError (GL_NO_ERROR); in clear_bufferiv()
534 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is not an accepted value."); in clear_bufferiv()
535 ctx.glClearBufferiv (-1, 0, &data[0]); in clear_bufferiv()
536 ctx.expectError (GL_INVALID_ENUM); in clear_bufferiv()
537 ctx.glClearBufferiv (GL_FRAMEBUFFER, 0, &data[0]); in clear_bufferiv()
538 ctx.expectError (GL_INVALID_ENUM); in clear_bufferiv()
539 ctx.endSection(); in clear_bufferiv()
541 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is GL_DEPTH or GL_DEPTH_STENCIL."); in clear_bufferiv()
542 ctx.glClearBufferiv (GL_DEPTH, 1, &data[0]); in clear_bufferiv()
543 ctx.expectError (GL_INVALID_ENUM); in clear_bufferiv()
544 ctx.glClearBufferiv (GL_DEPTH_STENCIL, 1, &data[0]); in clear_bufferiv()
545 ctx.expectError (GL_INVALID_ENUM); in clear_bufferiv()
546 ctx.endSection(); in clear_bufferiv()
548ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR or GL_STENCIL and drawBuffer… in clear_bufferiv()
549 ctx.glGetIntegerv (GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); in clear_bufferiv()
550 ctx.glClearBufferiv (GL_COLOR, maxDrawBuffers, &data[0]); in clear_bufferiv()
551 ctx.expectError (GL_INVALID_VALUE); in clear_bufferiv()
552 ctx.endSection(); in clear_bufferiv()
554ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR or GL_STENCIL and drawBuffer… in clear_bufferiv()
555 ctx.glClearBufferiv (GL_COLOR, -1, &data[0]); in clear_bufferiv()
556 ctx.expectError (GL_INVALID_VALUE); in clear_bufferiv()
557 ctx.endSection(); in clear_bufferiv()
559ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_STENCIL and drawBuffer is not zero… in clear_bufferiv()
560 ctx.glClearBufferiv (GL_STENCIL, 1, &data[0]); in clear_bufferiv()
561 ctx.expectError (GL_INVALID_VALUE); in clear_bufferiv()
562 ctx.endSection(); in clear_bufferiv()
564 ctx.glDeleteFramebuffers (1, &fbo); in clear_bufferiv()
565 ctx.glDeleteTextures (1, &texture); in clear_bufferiv()
568 void clear_bufferuiv (NegativeTestContext& ctx) in clear_bufferuiv() argument
575 ctx.glGenTextures (1, &texture); in clear_bufferuiv()
576 ctx.glBindTexture (GL_TEXTURE_2D, texture); in clear_bufferuiv()
577ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32UI, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, NU… in clear_bufferuiv()
578 ctx.glGenFramebuffers (1, &fbo); in clear_bufferuiv()
579 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in clear_bufferuiv()
580 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in clear_bufferuiv()
581 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in clear_bufferuiv()
582 ctx.expectError (GL_NO_ERROR); in clear_bufferuiv()
584 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is not GL_COLOR."); in clear_bufferuiv()
585 ctx.glClearBufferuiv (-1, 0, &data[0]); in clear_bufferuiv()
586 ctx.expectError (GL_INVALID_ENUM); in clear_bufferuiv()
587 ctx.glClearBufferuiv (GL_FRAMEBUFFER, 0, &data[0]); in clear_bufferuiv()
588 ctx.expectError (GL_INVALID_ENUM); in clear_bufferuiv()
589 ctx.endSection(); in clear_bufferuiv()
591ctx.beginSection("GL_INVALID_ENUM is generated if buffer is GL_DEPTH, GL_STENCIL, or GL_DEPTH_STEN… in clear_bufferuiv()
592 ctx.glClearBufferuiv (GL_DEPTH, 0, &data[0]); in clear_bufferuiv()
593 ctx.expectError (GL_INVALID_ENUM); in clear_bufferuiv()
594 ctx.glClearBufferuiv (GL_STENCIL, 0, &data[0]); in clear_bufferuiv()
595 ctx.expectError (GL_INVALID_ENUM); in clear_bufferuiv()
596 ctx.glClearBufferuiv (GL_DEPTH_STENCIL, 0, &data[0]); in clear_bufferuiv()
597 ctx.expectError (GL_INVALID_ENUM); in clear_bufferuiv()
598 ctx.endSection(); in clear_bufferuiv()
600ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR and drawBuffer is greater th… in clear_bufferuiv()
601 ctx.glGetIntegerv (GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); in clear_bufferuiv()
602 ctx.glClearBufferuiv (GL_COLOR, maxDrawBuffers, &data[0]); in clear_bufferuiv()
603 ctx.expectError (GL_INVALID_VALUE); in clear_bufferuiv()
604 ctx.endSection(); in clear_bufferuiv()
606ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR and drawBuffer is negative."… in clear_bufferuiv()
607 ctx.glClearBufferuiv (GL_COLOR, -1, &data[0]); in clear_bufferuiv()
608 ctx.expectError (GL_INVALID_VALUE); in clear_bufferuiv()
609 ctx.endSection(); in clear_bufferuiv()
611 ctx.glDeleteFramebuffers (1, &fbo); in clear_bufferuiv()
612 ctx.glDeleteTextures (1, &texture); in clear_bufferuiv()
615 void clear_bufferfv (NegativeTestContext& ctx) in clear_bufferfv() argument
622 ctx.glGenTextures (1, &texture); in clear_bufferfv()
623 ctx.glBindTexture (GL_TEXTURE_2D, texture); in clear_bufferfv()
624 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32F, 32, 32, 0, GL_RGBA, GL_FLOAT, NULL); in clear_bufferfv()
625 ctx.glGenFramebuffers (1, &fbo); in clear_bufferfv()
626 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in clear_bufferfv()
627 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in clear_bufferfv()
628 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in clear_bufferfv()
629 ctx.expectError (GL_NO_ERROR); in clear_bufferfv()
631 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is not GL_COLOR or GL_DEPTH."); in clear_bufferfv()
632 ctx.glClearBufferfv (-1, 0, &data[0]); in clear_bufferfv()
633 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfv()
634 ctx.glClearBufferfv (GL_FRAMEBUFFER, 0, &data[0]); in clear_bufferfv()
635 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfv()
636 ctx.endSection(); in clear_bufferfv()
638 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is GL_STENCIL or GL_DEPTH_STENCIL."); in clear_bufferfv()
639 ctx.glClearBufferfv (GL_STENCIL, 1, &data[0]); in clear_bufferfv()
640 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfv()
641 ctx.glClearBufferfv (GL_DEPTH_STENCIL, 1, &data[0]); in clear_bufferfv()
642 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfv()
643 ctx.endSection(); in clear_bufferfv()
645ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR and drawBuffer is greater th… in clear_bufferfv()
646 ctx.glGetIntegerv (GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); in clear_bufferfv()
647 ctx.glClearBufferfv (GL_COLOR, maxDrawBuffers, &data[0]); in clear_bufferfv()
648 ctx.expectError (GL_INVALID_VALUE); in clear_bufferfv()
649 ctx.endSection(); in clear_bufferfv()
651ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_COLOR and drawBuffer is negative."… in clear_bufferfv()
652 ctx.glClearBufferfv (GL_COLOR, -1, &data[0]); in clear_bufferfv()
653 ctx.expectError (GL_INVALID_VALUE); in clear_bufferfv()
654 ctx.endSection(); in clear_bufferfv()
656ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_DEPTH and drawBuffer is not zero."… in clear_bufferfv()
657 ctx.glClearBufferfv (GL_DEPTH, 1, &data[0]); in clear_bufferfv()
658 ctx.expectError (GL_INVALID_VALUE); in clear_bufferfv()
659 ctx.endSection(); in clear_bufferfv()
661 ctx.glDeleteFramebuffers (1, &fbo); in clear_bufferfv()
662 ctx.glDeleteTextures (1, &texture); in clear_bufferfv()
665 void clear_bufferfi (NegativeTestContext& ctx) in clear_bufferfi() argument
667 ctx.beginSection("GL_INVALID_ENUM is generated if buffer is not GL_DEPTH_STENCIL."); in clear_bufferfi()
668 ctx.glClearBufferfi (-1, 0, 1.0f, 1); in clear_bufferfi()
669 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfi()
670 ctx.glClearBufferfi (GL_FRAMEBUFFER, 0, 1.0f, 1); in clear_bufferfi()
671 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfi()
672 ctx.glClearBufferfi (GL_DEPTH, 0, 1.0f, 1); in clear_bufferfi()
673 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfi()
674 ctx.glClearBufferfi (GL_STENCIL, 0, 1.0f, 1); in clear_bufferfi()
675 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfi()
676 ctx.glClearBufferfi (GL_COLOR, 0, 1.0f, 1); in clear_bufferfi()
677 ctx.expectError (GL_INVALID_ENUM); in clear_bufferfi()
678 ctx.endSection(); in clear_bufferfi()
680ctx.beginSection("GL_INVALID_VALUE is generated if buffer is GL_DEPTH_STENCIL and drawBuffer is no… in clear_bufferfi()
681 ctx.glClearBufferfi (GL_DEPTH_STENCIL, 1, 1.0f, 1); in clear_bufferfi()
682 ctx.expectError (GL_INVALID_VALUE); in clear_bufferfi()
683 ctx.endSection(); in clear_bufferfi()
686 void copy_buffer_sub_data (NegativeTestContext& ctx) in copy_buffer_sub_data() argument
691 ctx.glGenBuffers (2, buf); in copy_buffer_sub_data()
692 ctx.glBindBuffer (GL_COPY_READ_BUFFER, buf[0]); in copy_buffer_sub_data()
693 ctx.glBufferData (GL_COPY_READ_BUFFER, 32, &data[0], GL_DYNAMIC_COPY); in copy_buffer_sub_data()
694 ctx.glBindBuffer (GL_COPY_WRITE_BUFFER, buf[1]); in copy_buffer_sub_data()
695 ctx.glBufferData (GL_COPY_WRITE_BUFFER, 32, &data[0], GL_DYNAMIC_COPY); in copy_buffer_sub_data()
696 ctx.expectError (GL_NO_ERROR); in copy_buffer_sub_data()
698ctx.beginSection("GL_INVALID_VALUE is generated if any of readoffset, writeoffset or size is negat… in copy_buffer_sub_data()
699 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, -4); in copy_buffer_sub_data()
700 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
701 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, -1, 0, 4); in copy_buffer_sub_data()
702 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
703 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, -1, 4); in copy_buffer_sub_data()
704 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
705 ctx.endSection(); in copy_buffer_sub_data()
707ctx.beginSection("GL_INVALID_VALUE is generated if readoffset + size exceeds the size of the buffe… in copy_buffer_sub_data()
708 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 36); in copy_buffer_sub_data()
709 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
710 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 24, 0, 16); in copy_buffer_sub_data()
711 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
712 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 36, 0, 4); in copy_buffer_sub_data()
713 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
714 ctx.endSection(); in copy_buffer_sub_data()
716ctx.beginSection("GL_INVALID_VALUE is generated if writeoffset + size exceeds the size of the buff… in copy_buffer_sub_data()
717 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 36); in copy_buffer_sub_data()
718 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
719 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 24, 16); in copy_buffer_sub_data()
720 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
721 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 36, 4); in copy_buffer_sub_data()
722 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
723 ctx.endSection(); in copy_buffer_sub_data()
725ctx.beginSection("GL_INVALID_VALUE is generated if the same buffer object is bound to both readtar… in copy_buffer_sub_data()
726 ctx.glBindBuffer (GL_COPY_WRITE_BUFFER, buf[0]); in copy_buffer_sub_data()
727 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 16, 4); in copy_buffer_sub_data()
728 ctx.expectError (GL_NO_ERROR); in copy_buffer_sub_data()
729 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 4); in copy_buffer_sub_data()
730 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
731 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 16, 18); in copy_buffer_sub_data()
732 ctx.expectError (GL_INVALID_VALUE); in copy_buffer_sub_data()
733 ctx.glBindBuffer (GL_COPY_WRITE_BUFFER, buf[1]); in copy_buffer_sub_data()
734 ctx.endSection(); in copy_buffer_sub_data()
736ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to readtarget or writetarget.… in copy_buffer_sub_data()
737 ctx.glBindBuffer (GL_COPY_READ_BUFFER, 0); in copy_buffer_sub_data()
738 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 16); in copy_buffer_sub_data()
739 ctx.expectError (GL_INVALID_OPERATION); in copy_buffer_sub_data()
741 ctx.glBindBuffer (GL_COPY_READ_BUFFER, buf[0]); in copy_buffer_sub_data()
742 ctx.glBindBuffer (GL_COPY_WRITE_BUFFER, 0); in copy_buffer_sub_data()
743 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 16); in copy_buffer_sub_data()
744 ctx.expectError (GL_INVALID_OPERATION); in copy_buffer_sub_data()
746 ctx.glBindBuffer (GL_COPY_WRITE_BUFFER, buf[1]); in copy_buffer_sub_data()
747 ctx.endSection(); in copy_buffer_sub_data()
749ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer object bound to either readtarge… in copy_buffer_sub_data()
750 ctx.glMapBufferRange (GL_COPY_READ_BUFFER, 0, 4, GL_MAP_READ_BIT); in copy_buffer_sub_data()
751 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 16); in copy_buffer_sub_data()
752 ctx.expectError (GL_INVALID_OPERATION); in copy_buffer_sub_data()
753 ctx.glUnmapBuffer (GL_COPY_READ_BUFFER); in copy_buffer_sub_data()
755 ctx.glMapBufferRange (GL_COPY_WRITE_BUFFER, 0, 4, GL_MAP_READ_BIT); in copy_buffer_sub_data()
756 ctx.glCopyBufferSubData (GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 16); in copy_buffer_sub_data()
757 ctx.expectError (GL_INVALID_OPERATION); in copy_buffer_sub_data()
758 ctx.glUnmapBuffer (GL_COPY_WRITE_BUFFER); in copy_buffer_sub_data()
759 ctx.endSection(); in copy_buffer_sub_data()
761 ctx.glDeleteBuffers(2, buf); in copy_buffer_sub_data()
764 void draw_buffers (NegativeTestContext& ctx) in draw_buffers() argument
770 ctx.glGetIntegerv (GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments); in draw_buffers()
771 ctx.glGetIntegerv (GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); in draw_buffers()
784 ctx.glGenTextures (1, &texture); in draw_buffers()
785 ctx.glBindTexture (GL_TEXTURE_2D, texture); in draw_buffers()
786 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in draw_buffers()
787 ctx.glGenFramebuffers (1, &fbo); in draw_buffers()
788 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in draw_buffers()
789 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in draw_buffers()
790 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in draw_buffers()
791 ctx.expectError (GL_NO_ERROR); in draw_buffers()
793ctx.beginSection("GL_INVALID_ENUM is generated if one of the values in bufs is not an accepted val… in draw_buffers()
794 ctx.glDrawBuffers (2, &values[2]); in draw_buffers()
795 ctx.expectError (GL_INVALID_ENUM); in draw_buffers()
796 ctx.endSection(); in draw_buffers()
798ctx.beginSection("GL_INVALID_OPERATION is generated if the GL is bound to a draw framebuffer and D… in draw_buffers()
799 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in draw_buffers()
800 ctx.glDrawBuffers (1, &values[1]); in draw_buffers()
801 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
802 ctx.glDrawBuffers (4, &attachments[0]); in draw_buffers()
803 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
804 ctx.endSection(); in draw_buffers()
806ctx.beginSection("GL_INVALID_OPERATION is generated if the GL is bound to the default framebuffer … in draw_buffers()
807 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in draw_buffers()
808 ctx.glDrawBuffers (2, &values[0]); in draw_buffers()
809 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
810 ctx.endSection(); in draw_buffers()
812ctx.beginSection("GL_INVALID_OPERATION is generated if the GL is bound to the default framebuffer … in draw_buffers()
813 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in draw_buffers()
814 ctx.glDrawBuffers (1, &values[2]); in draw_buffers()
815 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
816 ctx.endSection(); in draw_buffers()
818ctx.beginSection("GL_INVALID_OPERATION is generated if the GL is bound to a framebuffer object and… in draw_buffers()
819 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in draw_buffers()
820 ctx.glDrawBuffers (1, &values[1]); in draw_buffers()
821 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
822 ctx.glDrawBuffers (4, &attachments[0]); in draw_buffers()
823 ctx.expectError (GL_INVALID_OPERATION); in draw_buffers()
825 ctx.endSection(); in draw_buffers()
827ctx.beginSection("GL_INVALID_VALUE is generated if n is less than 0 or greater than GL_MAX_DRAW_BU… in draw_buffers()
828 ctx.glDrawBuffers (-1, &values[1]); in draw_buffers()
829 ctx.expectError (GL_INVALID_VALUE); in draw_buffers()
830 ctx.glDrawBuffers (maxDrawBuffers+1, &values[0]); in draw_buffers()
831 ctx.expectError (GL_INVALID_VALUE); in draw_buffers()
832 ctx.endSection(); in draw_buffers()
834 ctx.glDeleteTextures(1, &texture); in draw_buffers()
835 ctx.glDeleteFramebuffers(1, &fbo); in draw_buffers()
838 void flush_mapped_buffer_range (NegativeTestContext& ctx) in flush_mapped_buffer_range() argument
843 ctx.glGenBuffers (1, &buf); in flush_mapped_buffer_range()
844 ctx.glBindBuffer (GL_ARRAY_BUFFER, buf); in flush_mapped_buffer_range()
845 ctx.glBufferData (GL_ARRAY_BUFFER, 32, &data[0], GL_STATIC_READ); in flush_mapped_buffer_range()
846 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); in flush_mapped_buffer_range()
847 ctx.expectError (GL_NO_ERROR); in flush_mapped_buffer_range()
849 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted values."); in flush_mapped_buffer_range()
850 ctx.glFlushMappedBufferRange(-1, 0, 16); in flush_mapped_buffer_range()
851 ctx.expectError (GL_INVALID_ENUM); in flush_mapped_buffer_range()
852 ctx.endSection(); in flush_mapped_buffer_range()
854ctx.beginSection("GL_INVALID_VALUE is generated if offset or length is negative, or if offset + le… in flush_mapped_buffer_range()
855 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, -1, 1); in flush_mapped_buffer_range()
856 ctx.expectError (GL_INVALID_VALUE); in flush_mapped_buffer_range()
857 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, -1); in flush_mapped_buffer_range()
858 ctx.expectError (GL_INVALID_VALUE); in flush_mapped_buffer_range()
859 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 12, 8); in flush_mapped_buffer_range()
860 ctx.expectError (GL_INVALID_VALUE); in flush_mapped_buffer_range()
861 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 24, 4); in flush_mapped_buffer_range()
862 ctx.expectError (GL_INVALID_VALUE); in flush_mapped_buffer_range()
863 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, 24); in flush_mapped_buffer_range()
864 ctx.expectError (GL_INVALID_VALUE); in flush_mapped_buffer_range()
865 ctx.endSection(); in flush_mapped_buffer_range()
867 ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to target."); in flush_mapped_buffer_range()
868 ctx.glBindBuffer (GL_ARRAY_BUFFER, 0); in flush_mapped_buffer_range()
869 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, 8); in flush_mapped_buffer_range()
870 ctx.expectError (GL_INVALID_OPERATION); in flush_mapped_buffer_range()
871 ctx.endSection(); in flush_mapped_buffer_range()
873ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer bound to target is not mapped, o… in flush_mapped_buffer_range()
874 ctx.glBindBuffer (GL_ARRAY_BUFFER, buf); in flush_mapped_buffer_range()
875 ctx.glUnmapBuffer (GL_ARRAY_BUFFER); in flush_mapped_buffer_range()
876 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, 8); in flush_mapped_buffer_range()
877 ctx.expectError (GL_INVALID_OPERATION); in flush_mapped_buffer_range()
878 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_WRITE_BIT); in flush_mapped_buffer_range()
879 ctx.glFlushMappedBufferRange(GL_ARRAY_BUFFER, 0, 8); in flush_mapped_buffer_range()
880 ctx.expectError (GL_INVALID_OPERATION); in flush_mapped_buffer_range()
881 ctx.endSection(); in flush_mapped_buffer_range()
883 ctx.glUnmapBuffer (GL_ARRAY_BUFFER); in flush_mapped_buffer_range()
884 ctx.glDeleteBuffers (1, &buf); in flush_mapped_buffer_range()
887 void map_buffer_range (NegativeTestContext& ctx) in map_buffer_range() argument
892 ctx.glGenBuffers (1, &buf); in map_buffer_range()
893 ctx.glBindBuffer (GL_ARRAY_BUFFER, buf); in map_buffer_range()
894 ctx.glBufferData (GL_ARRAY_BUFFER, 32, &data[0], GL_DYNAMIC_COPY); in map_buffer_range()
895 ctx.expectError (GL_NO_ERROR); in map_buffer_range()
897 ctx.beginSection("GL_INVALID_VALUE is generated if either of offset or length is negative."); in map_buffer_range()
898 ctx.glMapBufferRange (GL_ARRAY_BUFFER, -1, 1, GL_MAP_READ_BIT); in map_buffer_range()
899 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
901 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 1, -1, GL_MAP_READ_BIT); in map_buffer_range()
902 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
903 ctx.endSection(); in map_buffer_range()
905ctx.beginSection("GL_INVALID_VALUE is generated if offset + length is greater than the value of GL… in map_buffer_range()
906 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 33, GL_MAP_READ_BIT); in map_buffer_range()
907 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
909 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 32, 1, GL_MAP_READ_BIT); in map_buffer_range()
910 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
912 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 16, 17, GL_MAP_READ_BIT); in map_buffer_range()
913 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
914 ctx.endSection(); in map_buffer_range()
916ctx.beginSection("GL_INVALID_VALUE is generated if access has any bits set other than those accept… in map_buffer_range()
917 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_READ_BIT | 0x1000); in map_buffer_range()
918 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
920 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_WRITE_BIT | 0x1000); in map_buffer_range()
921 ctx.expectError (GL_INVALID_VALUE); in map_buffer_range()
922 ctx.endSection(); in map_buffer_range()
924 ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer is already in a mapped state."); in map_buffer_range()
925 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_WRITE_BIT); in map_buffer_range()
926 ctx.expectError (GL_NO_ERROR); in map_buffer_range()
927 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 16, 8, GL_MAP_READ_BIT); in map_buffer_range()
928 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
929 ctx.glUnmapBuffer (GL_ARRAY_BUFFER); in map_buffer_range()
930 ctx.endSection(); in map_buffer_range()
932ctx.beginSection("GL_INVALID_OPERATION is generated if neither GL_MAP_READ_BIT or GL_MAP_WRITE_BIT… in map_buffer_range()
933 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_INVALIDATE_RANGE_BIT); in map_buffer_range()
934 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
935 ctx.endSection(); in map_buffer_range()
937 ctx.beginSection("GL_INVALID_OPERATION is generated if length is 0"); in map_buffer_range()
938 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT); in map_buffer_range()
939 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
940 ctx.endSection(); in map_buffer_range()
942ctx.beginSection("GL_INVALID_OPERATION is generated if GL_MAP_READ_BIT is set and any of GL_MAP_IN… in map_buffer_range()
943 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_READ_BIT | GL_MAP_INVALIDATE_RANGE_BIT); in map_buffer_range()
944 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
946 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_READ_BIT | GL_MAP_INVALIDATE_BUFFER_BIT); in map_buffer_range()
947 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
949 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_READ_BIT | GL_MAP_UNSYNCHRONIZED_BIT); in map_buffer_range()
950 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
951 ctx.endSection(); in map_buffer_range()
953ctx.beginSection("GL_INVALID_OPERATION is generated if GL_MAP_FLUSH_EXPLICIT_BIT is set and GL_MAP… in map_buffer_range()
954 ctx.glMapBufferRange (GL_ARRAY_BUFFER, 0, 16, GL_MAP_READ_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); in map_buffer_range()
955 ctx.expectError (GL_INVALID_OPERATION); in map_buffer_range()
956 ctx.endSection(); in map_buffer_range()
958 ctx.glDeleteBuffers (1, &buf); in map_buffer_range()
961 void read_buffer (NegativeTestContext& ctx) in read_buffer() argument
967 ctx.glGetIntegerv (GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments); in read_buffer()
968 ctx.glGenTextures (1, &texture); in read_buffer()
969 ctx.glBindTexture (GL_TEXTURE_2D, texture); in read_buffer()
970 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in read_buffer()
971 ctx.glGenFramebuffers (1, &fbo); in read_buffer()
972 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in read_buffer()
973 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in read_buffer()
974 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER); in read_buffer()
975 ctx.expectError (GL_NO_ERROR); in read_buffer()
977ctx.beginSection("GL_INVALID_ENUM is generated if mode is not GL_BACK, GL_NONE, or GL_COLOR_ATTACH… in read_buffer()
978 ctx.glReadBuffer (GL_NONE); in read_buffer()
979 ctx.expectError (GL_NO_ERROR); in read_buffer()
980 ctx.glReadBuffer (1); in read_buffer()
981 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
982 ctx.glReadBuffer (GL_FRAMEBUFFER); in read_buffer()
983 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
984 ctx.glReadBuffer (GL_COLOR_ATTACHMENT0 - 1); in read_buffer()
985 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
986 ctx.glReadBuffer (GL_FRONT); in read_buffer()
987 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
992 ctx.glReadBuffer (GL_DEPTH_ATTACHMENT); in read_buffer()
993 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
994 ctx.glReadBuffer (GL_STENCIL_ATTACHMENT); in read_buffer()
995 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
996 ctx.glReadBuffer (GL_STENCIL_ATTACHMENT+1); in read_buffer()
997 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
998 ctx.glReadBuffer (0xffffffffu); in read_buffer()
999 ctx.expectError (GL_INVALID_ENUM); in read_buffer()
1000 ctx.endSection(); in read_buffer()
1002ctx.beginSection("GL_INVALID_OPERATION error is generated if src is GL_BACK or if src is GL_COLOR_… in read_buffer()
1003 ctx.glReadBuffer (GL_BACK); in read_buffer()
1004 ctx.expectError (GL_INVALID_OPERATION); in read_buffer()
1005 ctx.glReadBuffer (GL_COLOR_ATTACHMENT0 + maxColorAttachments); in read_buffer()
1006 ctx.expectError (GL_INVALID_OPERATION); in read_buffer()
1010 ctx.glReadBuffer (GL_DEPTH_ATTACHMENT - 1); in read_buffer()
1011 ctx.expectError (GL_INVALID_OPERATION); in read_buffer()
1014 ctx.endSection(); in read_buffer()
1016ctx.beginSection("GL_INVALID_OPERATION is generated if the current framebuffer is the default fram… in read_buffer()
1017 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in read_buffer()
1018 ctx.glReadBuffer (GL_COLOR_ATTACHMENT0); in read_buffer()
1019 ctx.expectError (GL_INVALID_OPERATION); in read_buffer()
1020 ctx.endSection(); in read_buffer()
1022ctx.beginSection("GL_INVALID_OPERATION is generated if the current framebuffer is a named framebuf… in read_buffer()
1023 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in read_buffer()
1024 ctx.glReadBuffer (GL_BACK); in read_buffer()
1025 ctx.expectError (GL_INVALID_OPERATION); in read_buffer()
1026 ctx.endSection(); in read_buffer()
1028 ctx.glDeleteTextures(1, &texture); in read_buffer()
1029 ctx.glDeleteFramebuffers(1, &fbo); in read_buffer()
1032 void unmap_buffer (NegativeTestContext& ctx) in unmap_buffer() argument
1037 ctx.glGenBuffers (1, &buf); in unmap_buffer()
1038 ctx.glBindBuffer (GL_ARRAY_BUFFER, buf); in unmap_buffer()
1039 ctx.glBufferData (GL_ARRAY_BUFFER, 32, &data[0], GL_DYNAMIC_COPY); in unmap_buffer()
1040 ctx.expectError (GL_NO_ERROR); in unmap_buffer()
1042ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer data store is already in an unma… in unmap_buffer()
1043 ctx.glUnmapBuffer (GL_ARRAY_BUFFER); in unmap_buffer()
1044 ctx.expectError (GL_INVALID_OPERATION); in unmap_buffer()
1045 ctx.endSection(); in unmap_buffer()
1047 ctx.glDeleteBuffers (1, &buf); in unmap_buffer()
1051 void bind_framebuffer (NegativeTestContext& ctx) in bind_framebuffer() argument
1053ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_DRAW_FRAMEBUFFER, GL_READ_FRAME… in bind_framebuffer()
1054 ctx.glBindFramebuffer(-1, 0); in bind_framebuffer()
1055 ctx.expectError(GL_INVALID_ENUM); in bind_framebuffer()
1056 ctx.glBindFramebuffer(GL_RENDERBUFFER, 0); in bind_framebuffer()
1057 ctx.expectError(GL_INVALID_ENUM); in bind_framebuffer()
1058 ctx.endSection(); in bind_framebuffer()
1061 void bind_renderbuffer (NegativeTestContext& ctx) in bind_renderbuffer() argument
1063 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER."); in bind_renderbuffer()
1064 ctx.glBindRenderbuffer(-1, 0); in bind_renderbuffer()
1065 ctx.expectError(GL_INVALID_ENUM); in bind_renderbuffer()
1066 ctx.glBindRenderbuffer(GL_FRAMEBUFFER, 0); in bind_renderbuffer()
1067 ctx.expectError(GL_INVALID_ENUM); in bind_renderbuffer()
1068 ctx.endSection(); in bind_renderbuffer()
1071 void check_framebuffer_status (NegativeTestContext& ctx) in check_framebuffer_status() argument
1073ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_DRAW_FRAMEBUFFER, GL_READ_FRAME… in check_framebuffer_status()
1074 ctx.glCheckFramebufferStatus(-1); in check_framebuffer_status()
1075 ctx.expectError(GL_INVALID_ENUM); in check_framebuffer_status()
1076 ctx.glCheckFramebufferStatus(GL_RENDERBUFFER); in check_framebuffer_status()
1077 ctx.expectError(GL_INVALID_ENUM); in check_framebuffer_status()
1078 ctx.endSection(); in check_framebuffer_status()
1081 void gen_framebuffers (NegativeTestContext& ctx) in gen_framebuffers() argument
1083 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative."); in gen_framebuffers()
1084 ctx.glGenFramebuffers(-1, 0); in gen_framebuffers()
1085 ctx.expectError(GL_INVALID_VALUE); in gen_framebuffers()
1086 ctx.endSection(); in gen_framebuffers()
1089 void gen_renderbuffers (NegativeTestContext& ctx) in gen_renderbuffers() argument
1091 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative."); in gen_renderbuffers()
1092 ctx.glGenRenderbuffers(-1, 0); in gen_renderbuffers()
1093 ctx.expectError(GL_INVALID_VALUE); in gen_renderbuffers()
1094 ctx.endSection(); in gen_renderbuffers()
1097 void delete_framebuffers (NegativeTestContext& ctx) in delete_framebuffers() argument
1099 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative."); in delete_framebuffers()
1100 ctx.glDeleteFramebuffers(-1, 0); in delete_framebuffers()
1101 ctx.expectError(GL_INVALID_VALUE); in delete_framebuffers()
1102 ctx.endSection(); in delete_framebuffers()
1105 void delete_renderbuffers (NegativeTestContext& ctx) in delete_renderbuffers() argument
1107 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative."); in delete_renderbuffers()
1108 ctx.glDeleteRenderbuffers(-1, 0); in delete_renderbuffers()
1109 ctx.expectError(GL_INVALID_VALUE); in delete_renderbuffers()
1110 ctx.endSection(); in delete_renderbuffers()
1113 void framebuffer_renderbuffer (NegativeTestContext& ctx) in framebuffer_renderbuffer() argument
1117 ctx.glGenFramebuffers(1, &fbo); in framebuffer_renderbuffer()
1118 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in framebuffer_renderbuffer()
1119 ctx.glGenRenderbuffers(1, &rbo); in framebuffer_renderbuffer()
1121 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); in framebuffer_renderbuffer()
1122 ctx.glFramebufferRenderbuffer(-1, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0); in framebuffer_renderbuffer()
1123 ctx.expectError(GL_INVALID_ENUM); in framebuffer_renderbuffer()
1124 ctx.endSection(); in framebuffer_renderbuffer()
1126 ctx.beginSection("GL_INVALID_ENUM is generated if attachment is not one of the accepted tokens."); in framebuffer_renderbuffer()
1127 ctx.glFramebufferRenderbuffer(GL_FRAMEBUFFER, -1, GL_RENDERBUFFER, 0); in framebuffer_renderbuffer()
1128 ctx.expectError(GL_INVALID_ENUM); in framebuffer_renderbuffer()
1129 ctx.endSection(); in framebuffer_renderbuffer()
1131 ctx.beginSection("GL_INVALID_ENUM is generated if renderbuffertarget is not GL_RENDERBUFFER."); in framebuffer_renderbuffer()
1132 ctx.glBindRenderbuffer(GL_RENDERBUFFER, rbo); in framebuffer_renderbuffer()
1133 ctx.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -1, rbo); in framebuffer_renderbuffer()
1134 ctx.expectError(GL_INVALID_ENUM); in framebuffer_renderbuffer()
1135 ctx.glBindRenderbuffer(GL_RENDERBUFFER, 0); in framebuffer_renderbuffer()
1136 ctx.endSection(); in framebuffer_renderbuffer()
1138ctx.beginSection("GL_INVALID_OPERATION is generated if renderbuffer is neither 0 nor the name of a… in framebuffer_renderbuffer()
1139 ctx.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, -1); in framebuffer_renderbuffer()
1140 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_renderbuffer()
1141 ctx.endSection(); in framebuffer_renderbuffer()
1143 ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to target."); in framebuffer_renderbuffer()
1144 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0); in framebuffer_renderbuffer()
1145 ctx.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0); in framebuffer_renderbuffer()
1146 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_renderbuffer()
1147 ctx.endSection(); in framebuffer_renderbuffer()
1149 ctx.glDeleteRenderbuffers(1, &rbo); in framebuffer_renderbuffer()
1150 ctx.glDeleteFramebuffers(1, &fbo); in framebuffer_renderbuffer()
1153 void framebuffer_texture (NegativeTestContext& ctx) in framebuffer_texture() argument
1155 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in framebuffer_texture()
1160 ctx.glGenFramebuffers(1, &fbo); in framebuffer_texture()
1161 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in framebuffer_texture()
1162 ctx.glGenTextures(2, texture); in framebuffer_texture()
1163 ctx.glBindTexture(GL_TEXTURE_2D, texture[0]); in framebuffer_texture()
1164 ctx.glBindTexture(GL_TEXTURE_BUFFER, texture[1]); in framebuffer_texture()
1165 ctx.expectError(GL_NO_ERROR); in framebuffer_texture()
1167 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); in framebuffer_texture()
1168 ctx.glFramebufferTexture(-1, GL_COLOR_ATTACHMENT0, texture[0], 0); in framebuffer_texture()
1169 ctx.expectError(GL_INVALID_ENUM); in framebuffer_texture()
1170 ctx.endSection(); in framebuffer_texture()
1172 ctx.beginSection("GL_INVALID_ENUM is generated if attachment is not one of the accepted tokens."); in framebuffer_texture()
1173 ctx.glFramebufferTexture(GL_FRAMEBUFFER, -1, texture[0], 0); in framebuffer_texture()
1174 ctx.expectError(GL_INVALID_ENUM); in framebuffer_texture()
1175 ctx.endSection(); in framebuffer_texture()
1177ctx.beginSection("GL_INVALID_OPERATION is generated if texture is neither 0 nor the name of an exi… in framebuffer_texture()
1178 ctx.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -1, 0); in framebuffer_texture()
1179 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture()
1180 ctx.endSection(); in framebuffer_texture()
1182 ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to target."); in framebuffer_texture()
1183 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0); in framebuffer_texture()
1184 ctx.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 0, 0); in framebuffer_texture()
1185 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture()
1186 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in framebuffer_texture()
1187 ctx.endSection(); in framebuffer_texture()
1189 ctx.beginSection("GL_INVALID_OPERATION is generated by if texture is a buffer texture."); in framebuffer_texture()
1190 ctx.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture[1], 0); in framebuffer_texture()
1191 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture()
1192 ctx.endSection(); in framebuffer_texture()
1194 ctx.glDeleteFramebuffers(1, &fbo); in framebuffer_texture()
1195 ctx.glDeleteBuffers(2, texture); in framebuffer_texture()
1199 void framebuffer_texture2d (NegativeTestContext& ctx) in framebuffer_texture2d() argument
1209 ctx.glGenFramebuffers(1, &fbo); in framebuffer_texture2d()
1210 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in framebuffer_texture2d()
1211 ctx.glGenTextures(1, &tex2D); in framebuffer_texture2d()
1212 ctx.glBindTexture(GL_TEXTURE_2D, tex2D); in framebuffer_texture2d()
1213 ctx.glGenTextures(1, &texCube); in framebuffer_texture2d()
1214 ctx.glBindTexture(GL_TEXTURE_CUBE_MAP, texCube); in framebuffer_texture2d()
1215 ctx.glGenTextures(1, &tex2DMS); in framebuffer_texture2d()
1216 ctx.glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, tex2DMS); in framebuffer_texture2d()
1217 ctx.glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTexSize); in framebuffer_texture2d()
1218 ctx.glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &maxTexCubeSize); in framebuffer_texture2d()
1219 ctx.expectError(GL_NO_ERROR); in framebuffer_texture2d()
1221 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); in framebuffer_texture2d()
1222 ctx.glFramebufferTexture2D(-1, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); in framebuffer_texture2d()
1223 ctx.expectError(GL_INVALID_ENUM); in framebuffer_texture2d()
1224 ctx.endSection(); in framebuffer_texture2d()
1226 ctx.beginSection("GL_INVALID_ENUM is generated if textarget is not an accepted texture target."); in framebuffer_texture2d()
1227 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -1, tex2D, 0); in framebuffer_texture2d()
1228 ctx.expectError(GL_INVALID_ENUM); in framebuffer_texture2d()
1229 ctx.endSection(); in framebuffer_texture2d()
1231 ctx.beginSection("GL_INVALID_ENUM is generated if attachment is not an accepted token."); in framebuffer_texture2d()
1232 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, -1, GL_TEXTURE_2D, tex2D, 0); in framebuffer_texture2d()
1233 ctx.expectError(GL_INVALID_ENUM); in framebuffer_texture2d()
1234 ctx.endSection(); in framebuffer_texture2d()
1236ctx.beginSection("GL_INVALID_VALUE is generated if level is less than 0 or larger than log_2 of ma… in framebuffer_texture2d()
1237 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, -1); in framebuffer_texture2d()
1238 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1240 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, maxSize); in framebuffer_texture2d()
1241 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1243ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X, t… in framebuffer_texture2d()
1244 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1245 ctx.endSection(); in framebuffer_texture2d()
1247 ctx.beginSection("GL_INVALID_VALUE is generated if level is larger than maximum texture size."); in framebuffer_texture2d()
1248ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, maxTexSize … in framebuffer_texture2d()
1249 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1250 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, -1); in framebuffer_texture2d()
1251 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1252ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, t… in framebuffer_texture2d()
1253 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1254ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, t… in framebuffer_texture2d()
1255 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1256ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, tex2DM… in framebuffer_texture2d()
1257 ctx.expectError(GL_INVALID_VALUE); in framebuffer_texture2d()
1258 ctx.endSection(); in framebuffer_texture2d()
1260ctx.beginSection("GL_INVALID_OPERATION is generated if texture is neither 0 nor the name of an exi… in framebuffer_texture2d()
1261 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, -1, 0); in framebuffer_texture2d()
1262 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1263 ctx.endSection(); in framebuffer_texture2d()
1265 ctx.beginSection("GL_INVALID_OPERATION is generated if textarget and texture are not compatible."); in framebuffer_texture2d()
1266ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X, t… in framebuffer_texture2d()
1267 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1268ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, tex2D,… in framebuffer_texture2d()
1269 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1270 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texCube, 0); in framebuffer_texture2d()
1271 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1272 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2DMS, 0); in framebuffer_texture2d()
1273 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1274 ctx.glDeleteTextures(1, &tex2D); in framebuffer_texture2d()
1275 ctx.glDeleteTextures(1, &texCube); in framebuffer_texture2d()
1276 ctx.glDeleteTextures(1, &tex2DMS); in framebuffer_texture2d()
1277 ctx.endSection(); in framebuffer_texture2d()
1279 ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to target."); in framebuffer_texture2d()
1280 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0); in framebuffer_texture2d()
1281 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); in framebuffer_texture2d()
1282 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1283 ctx.endSection(); in framebuffer_texture2d()
1285 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in framebuffer_texture2d()
1288ctx.beginSection("GL_INVALID_OPERATION error is generated if texture is the name of a buffer textu… in framebuffer_texture2d()
1289 ctx.glGenTextures(1, &texBuf); in framebuffer_texture2d()
1290 ctx.glBindTexture(GL_TEXTURE_BUFFER, texBuf); in framebuffer_texture2d()
1291 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in framebuffer_texture2d()
1292 ctx.expectError(GL_NO_ERROR); in framebuffer_texture2d()
1293 ctx.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texBuf, 0); in framebuffer_texture2d()
1294 ctx.expectError(GL_INVALID_OPERATION); in framebuffer_texture2d()
1295 ctx.endSection(); in framebuffer_texture2d()
1298 ctx.glDeleteFramebuffers(1, &fbo); in framebuffer_texture2d()
1301 void renderbuffer_storage (NegativeTestContext& ctx) in renderbuffer_storage() argument
1306 ctx.glGenRenderbuffers (1, &rbo); in renderbuffer_storage()
1307 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo); in renderbuffer_storage()
1309 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER."); in renderbuffer_storage()
1310 ctx.glRenderbufferStorage (-1, GL_RGBA4, 1, 1); in renderbuffer_storage()
1311 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage()
1312 ctx.glRenderbufferStorage (GL_FRAMEBUFFER, GL_RGBA4, 1, 1); in renderbuffer_storage()
1313 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage()
1314 ctx.endSection(); in renderbuffer_storage()
1316ctx.beginSection("GL_INVALID_ENUM is generated if internalformat is not a color-renderable, depth-… in renderbuffer_storage()
1317 ctx.glRenderbufferStorage (GL_RENDERBUFFER, -1, 1, 1); in renderbuffer_storage()
1318 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage()
1320 …if (!ctx.isExtensionSupported("GL_EXT_color_buffer_half_float")) // GL_EXT_color_buffer_half_float… in renderbuffer_storage()
1322 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGB16F, 1, 1); in renderbuffer_storage()
1323 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage()
1326 if (!ctx.isExtensionSupported("GL_EXT_render_snorm")) // GL_EXT_render_snorm disables error in renderbuffer_storage()
1328 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA8_SNORM, 1, 1); in renderbuffer_storage()
1329 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage()
1332 ctx.endSection(); in renderbuffer_storage()
1334 ctx.beginSection("GL_INVALID_VALUE is generated if width or height is less than zero."); in renderbuffer_storage()
1335 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, -1, 1); in renderbuffer_storage()
1336 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage()
1337 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, 1, -1); in renderbuffer_storage()
1338 ctx.expectError (GL_INVALID_VALUE); 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.endSection(); in renderbuffer_storage()
1343ctx.beginSection("GL_INVALID_VALUE is generated if width or height is greater than GL_MAX_RENDERBU… in renderbuffer_storage()
1344 ctx.glGetIntegerv (GL_MAX_RENDERBUFFER_SIZE, &maxSize); in renderbuffer_storage()
1345 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, 1, maxSize+1); in renderbuffer_storage()
1346 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage()
1347 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, maxSize+1, 1); in renderbuffer_storage()
1348 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage()
1349 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, maxSize+1, maxSize+1); in renderbuffer_storage()
1350 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage()
1351 ctx.endSection(); in renderbuffer_storage()
1353 ctx.glDeleteRenderbuffers(1, &rbo); in renderbuffer_storage()
1356 void blit_framebuffer (NegativeTestContext& ctx) in blit_framebuffer() argument
1363 ctx.glGenFramebuffers (1, &blankFrameBuffer); in blit_framebuffer()
1364 ctx.glGenFramebuffers (2, fbo); in blit_framebuffer()
1365 ctx.glGenTextures (2, texture); in blit_framebuffer()
1366 ctx.glGenRenderbuffers (2, rbo); in blit_framebuffer()
1368 ctx.glBindTexture (GL_TEXTURE_2D, texture[0]); in blit_framebuffer()
1369 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[0]); in blit_framebuffer()
1370 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, fbo[0]); in blit_framebuffer()
1372 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in blit_framebuffer()
1373 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 32, 32); in blit_framebuffer()
1374ctx.glFramebufferTexture2D (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[0], … in blit_framebuffer()
1375ctx.glFramebufferRenderbuffer(GL_READ_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, r… in blit_framebuffer()
1376 ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER); in blit_framebuffer()
1378 ctx.glBindTexture (GL_TEXTURE_2D, texture[1]); in blit_framebuffer()
1379 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[1]); in blit_framebuffer()
1380 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[1]); in blit_framebuffer()
1382 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in blit_framebuffer()
1383 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 32, 32); in blit_framebuffer()
1384ctx.glFramebufferTexture2D (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[1], … in blit_framebuffer()
1385ctx.glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, r… in blit_framebuffer()
1386 ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); in blit_framebuffer()
1387 ctx.expectError (GL_NO_ERROR); in blit_framebuffer()
1389ctx.beginSection("GL_INVALID_VALUE is generated if mask contains any bits other than GL_COLOR_BUFF… in blit_framebuffer()
1390 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, 1, GL_NEAREST); in blit_framebuffer()
1391 ctx.expectError (GL_INVALID_VALUE); in blit_framebuffer()
1392 ctx.endSection(); in blit_framebuffer()
1394 ctx.beginSection("GL_INVALID_ENUM is generated if filter is not GL_LINEAR or GL_NEAREST."); in blit_framebuffer()
1395 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, 0); in blit_framebuffer()
1396 ctx.expectError (GL_INVALID_ENUM); in blit_framebuffer()
1397 ctx.endSection(); in blit_framebuffer()
1399ctx.beginSection("GL_INVALID_OPERATION is generated if mask contains any of the GL_DEPTH_BUFFER_BI… in blit_framebuffer()
1400ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, G… in blit_framebuffer()
1401 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1402ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_… in blit_framebuffer()
1403 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1404ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, G… in blit_framebuffer()
1405 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1406 ctx.endSection(); in blit_framebuffer()
1408ctx.beginSection("GL_INVALID_OPERATION is generated if mask contains GL_COLOR_BUFFER_BIT and read … in blit_framebuffer()
1409 ctx.glBindTexture (GL_TEXTURE_2D, texture[0]); in blit_framebuffer()
1411ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32UI, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, NU… in blit_framebuffer()
1412ctx.glFramebufferTexture2D (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[0], … in blit_framebuffer()
1413ctx.getLog() << TestLog::Message << "// Read buffer: GL_RGBA32UI, draw buffer: GL_RGBA" << TestLog… in blit_framebuffer()
1414 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1415 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1417 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32I, 32, 32, 0, GL_RGBA_INTEGER, GL_INT, NULL); in blit_framebuffer()
1418ctx.glFramebufferTexture2D (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[0], … in blit_framebuffer()
1419ctx.getLog() << TestLog::Message << "// Read buffer: GL_RGBA32I, draw buffer: GL_RGBA" << TestLog:… in blit_framebuffer()
1420 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1421 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1423 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in blit_framebuffer()
1424ctx.glFramebufferTexture2D (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[0], … in blit_framebuffer()
1425 ctx.glBindTexture (GL_TEXTURE_2D, texture[1]); in blit_framebuffer()
1426 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32I, 32, 32, 0, GL_RGBA_INTEGER, GL_INT, NULL); in blit_framebuffer()
1427ctx.glFramebufferTexture2D (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[1], … in blit_framebuffer()
1428ctx.getLog() << TestLog::Message << "// Read buffer: GL_RGBA8, draw buffer: GL_RGBA32I" << TestLog… in blit_framebuffer()
1429 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1430 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1431 ctx.endSection(); in blit_framebuffer()
1433ctx.beginSection("GL_INVALID_OPERATION is generated if filter is GL_LINEAR and the read buffer con… in blit_framebuffer()
1434 ctx.glBindTexture (GL_TEXTURE_2D, texture[0]); in blit_framebuffer()
1435ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32UI, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, NU… in blit_framebuffer()
1436ctx.glFramebufferTexture2D (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[0], … in blit_framebuffer()
1437 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in blit_framebuffer()
1438ctx.glFramebufferTexture2D (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture[1], … in blit_framebuffer()
1439ctx.getLog() << TestLog::Message << "// Read buffer: GL_RGBA32I, draw buffer: GL_RGBA8" << TestLog… in blit_framebuffer()
1440 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_LINEAR); in blit_framebuffer()
1441 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1442 ctx.endSection(); in blit_framebuffer()
1444ctx.beginSection("GL_INVALID_OPERATION is generated if mask contains GL_DEPTH_BUFFER_BIT or GL_STE… in blit_framebuffer()
1445 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[0]); in blit_framebuffer()
1446 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH32F_STENCIL8, 32, 32); in blit_framebuffer()
1447ctx.glFramebufferRenderbuffer(GL_READ_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, r… in blit_framebuffer()
1448 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_DEPTH_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1449 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1450 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_STENCIL_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1451 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1452 ctx.endSection(); in blit_framebuffer()
1454ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the read or draw framebuffer is… in blit_framebuffer()
1455 ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER); in blit_framebuffer()
1456 ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); in blit_framebuffer()
1457 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, 0, GL_NEAREST); in blit_framebuffer()
1458 ctx.expectError (GL_NO_ERROR); in blit_framebuffer()
1459 ctx.getLog() << TestLog::Message << "// incomplete read framebuffer" << TestLog::EndMessage; in blit_framebuffer()
1460 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, blankFrameBuffer); in blit_framebuffer()
1461 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[1]); in blit_framebuffer()
1462 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1463 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1464 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, 0, GL_NEAREST); in blit_framebuffer()
1465 ctx.expectError (GL_INVALID_FRAMEBUFFER_OPERATION); in blit_framebuffer()
1466 ctx.getLog() << TestLog::Message << "// incomplete draw framebuffer" << TestLog::EndMessage; in blit_framebuffer()
1467 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, fbo[1]); in blit_framebuffer()
1468 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, blankFrameBuffer); in blit_framebuffer()
1469 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1470 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1471 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, 0, GL_NEAREST); in blit_framebuffer()
1472 ctx.expectError (GL_INVALID_FRAMEBUFFER_OPERATION); in blit_framebuffer()
1473ctx.getLog() << TestLog::Message << "// incomplete read and draw framebuffer" << TestLog::EndMessa… in blit_framebuffer()
1474 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, blankFrameBuffer); in blit_framebuffer()
1475 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, blankFrameBuffer); in blit_framebuffer()
1476 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1477 TCU_CHECK(ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE); in blit_framebuffer()
1478 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, 0, GL_NEAREST); in blit_framebuffer()
1479 ctx.expectError (GL_INVALID_FRAMEBUFFER_OPERATION); in blit_framebuffer()
1481 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, fbo[0]); in blit_framebuffer()
1482 ctx.glCheckFramebufferStatus(GL_READ_FRAMEBUFFER); in blit_framebuffer()
1483 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[1]); in blit_framebuffer()
1484 ctx.glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); in blit_framebuffer()
1485 ctx.endSection(); in blit_framebuffer()
1487ctx.beginSection("GL_INVALID_OPERATION is generated if the source and destination buffers are iden… in blit_framebuffer()
1488 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[0]); in blit_framebuffer()
1489 ctx.expectError (GL_NO_ERROR); in blit_framebuffer()
1490 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_DEPTH_BUFFER_BIT, GL_NEAREST); in blit_framebuffer()
1491 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer()
1493 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[1]); in blit_framebuffer()
1494 ctx.endSection(); in blit_framebuffer()
1496 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in blit_framebuffer()
1497 ctx.glBindRenderbuffer (GL_RENDERBUFFER, 0); in blit_framebuffer()
1498 ctx.glDeleteFramebuffers (2, fbo); in blit_framebuffer()
1499 ctx.glDeleteFramebuffers (1, &blankFrameBuffer); in blit_framebuffer()
1500 ctx.glDeleteTextures (2, texture); in blit_framebuffer()
1501 ctx.glDeleteRenderbuffers (2, rbo); in blit_framebuffer()
1504 void blit_framebuffer_multisample (NegativeTestContext& ctx) in blit_framebuffer_multisample() argument
1509 ctx.glGenFramebuffers (2, fbo); in blit_framebuffer_multisample()
1510 ctx.glGenRenderbuffers (2, rbo); in blit_framebuffer_multisample()
1512 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[0]); in blit_framebuffer_multisample()
1513 ctx.glBindFramebuffer (GL_READ_FRAMEBUFFER, fbo[0]); in blit_framebuffer_multisample()
1514 ctx.glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_RGBA8, 32, 32); in blit_framebuffer_multisample()
1515ctx.glFramebufferRenderbuffer (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo[0]… in blit_framebuffer_multisample()
1516 ctx.glCheckFramebufferStatus (GL_READ_FRAMEBUFFER); in blit_framebuffer_multisample()
1518 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[1]); in blit_framebuffer_multisample()
1519 ctx.glBindFramebuffer (GL_DRAW_FRAMEBUFFER, fbo[1]); in blit_framebuffer_multisample()
1521 ctx.expectError (GL_NO_ERROR); in blit_framebuffer_multisample()
1523 if (!ctx.isExtensionSupported("GL_NV_framebuffer_multisample")) in blit_framebuffer_multisample()
1525ctx.beginSection("GL_INVALID_OPERATION is generated if the value of GL_SAMPLE_BUFFERS for the draw… in blit_framebuffer_multisample()
1526 ctx.glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_RGBA8, 32, 32); in blit_framebuffer_multisample()
1527ctx.glFramebufferRenderbuffer (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo[1]… in blit_framebuffer_multisample()
1528 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer_multisample()
1529 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer_multisample()
1530 ctx.endSection(); in blit_framebuffer_multisample()
1532ctx.beginSection("GL_INVALID_OPERATION is generated if GL_SAMPLE_BUFFERS for the read buffer is gr… in blit_framebuffer_multisample()
1533 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA4, 32, 32); in blit_framebuffer_multisample()
1534ctx.glFramebufferRenderbuffer (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo[1]… in blit_framebuffer_multisample()
1535 ctx.glBlitFramebuffer (0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer_multisample()
1536 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer_multisample()
1537 ctx.endSection(); in blit_framebuffer_multisample()
1539ctx.beginSection("GL_INVALID_OPERATION is generated if GL_SAMPLE_BUFFERS for the read buffer is gr… in blit_framebuffer_multisample()
1540 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA8, 32, 32); in blit_framebuffer_multisample()
1541ctx.glFramebufferRenderbuffer (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo[1]… in blit_framebuffer_multisample()
1542 ctx.glBlitFramebuffer (0, 0, 16, 16, 2, 2, 18, 18, GL_COLOR_BUFFER_BIT, GL_NEAREST); in blit_framebuffer_multisample()
1543 ctx.expectError (GL_INVALID_OPERATION); in blit_framebuffer_multisample()
1544 ctx.endSection(); in blit_framebuffer_multisample()
1547 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in blit_framebuffer_multisample()
1548 ctx.glDeleteRenderbuffers (2, rbo); in blit_framebuffer_multisample()
1549 ctx.glDeleteFramebuffers (2, fbo); in blit_framebuffer_multisample()
1552 void framebuffer_texture_layer (NegativeTestContext& ctx) in framebuffer_texture_layer() argument
1568 ctx.glGetIntegerv (GL_MAX_3D_TEXTURE_SIZE, &max3DTexSize); in framebuffer_texture_layer()
1569 ctx.glGetIntegerv (GL_MAX_TEXTURE_SIZE, &maxTexSize); in framebuffer_texture_layer()
1571 ctx.glGenFramebuffers (1, &fbo); in framebuffer_texture_layer()
1572 ctx.glGenTextures (1, &tex3D); in framebuffer_texture_layer()
1573 ctx.glGenTextures (1, &tex2DArray); in framebuffer_texture_layer()
1574 ctx.glGenTextures (1, &tex2D); in framebuffer_texture_layer()
1575 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in framebuffer_texture_layer()
1577 ctx.glBindTexture (GL_TEXTURE_3D, tex3D); in framebuffer_texture_layer()
1578 ctx.glTexImage3D (GL_TEXTURE_3D, 0, GL_RGBA, 4, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in framebuffer_texture_layer()
1579 ctx.glBindTexture (GL_TEXTURE_2D_ARRAY, tex2DArray); in framebuffer_texture_layer()
1580 ctx.glTexImage3D (GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, 4, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in framebuffer_texture_layer()
1581 ctx.glBindTexture (GL_TEXTURE_2D, tex2D); in framebuffer_texture_layer()
1582 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in framebuffer_texture_layer()
1584 ctx.expectError (GL_NO_ERROR); in framebuffer_texture_layer()
1586 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); in framebuffer_texture_layer()
1587 ctx.glFramebufferTextureLayer (-1, GL_COLOR_ATTACHMENT0, tex3D, 0, 1); in framebuffer_texture_layer()
1588 ctx.expectError (GL_INVALID_ENUM); in framebuffer_texture_layer()
1589 ctx.glFramebufferTextureLayer (GL_RENDERBUFFER, GL_COLOR_ATTACHMENT0, tex3D, 0, 1); in framebuffer_texture_layer()
1590 ctx.expectError (GL_INVALID_ENUM); in framebuffer_texture_layer()
1591 ctx.endSection(); in framebuffer_texture_layer()
1593 ctx.beginSection("GL_INVALID_ENUM is generated if attachment is not one of the accepted tokens."); in framebuffer_texture_layer()
1594 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, -1, tex3D, 0, 1); in framebuffer_texture_layer()
1595 ctx.expectError (GL_INVALID_ENUM); in framebuffer_texture_layer()
1596 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_BACK, tex3D, 0, 1); in framebuffer_texture_layer()
1597 ctx.expectError (GL_INVALID_ENUM); in framebuffer_texture_layer()
1598 ctx.endSection(); in framebuffer_texture_layer()
1600ctx.beginSection("GL_INVALID_OPERATION is generated if texture is non-zero and not the name of a 3… in framebuffer_texture_layer()
1601 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -1, 0, 0); in framebuffer_texture_layer()
1602 ctx.expectError (GL_INVALID_OPERATION); in framebuffer_texture_layer()
1603 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex2D, 0, 0); in framebuffer_texture_layer()
1604 ctx.expectError (GL_INVALID_OPERATION); in framebuffer_texture_layer()
1605 ctx.endSection(); in framebuffer_texture_layer()
1607 ctx.beginSection("GL_INVALID_VALUE is generated if texture is not zero and layer is negative."); in framebuffer_texture_layer()
1608 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex3D, 0, -1); in framebuffer_texture_layer()
1609 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1610 ctx.endSection(); in framebuffer_texture_layer()
1612ctx.beginSection("GL_INVALID_VALUE is generated if texture is not zero and layer is greater than G… in framebuffer_texture_layer()
1613 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex3D, 0, max3DTexSize); in framebuffer_texture_layer()
1614 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1615 ctx.endSection(); in framebuffer_texture_layer()
1617ctx.beginSection("GL_INVALID_VALUE is generated if texture is not zero and layer is greater than G… in framebuffer_texture_layer()
1618 ctx.glGetIntegerv (GL_MAX_ARRAY_TEXTURE_LAYERS, &maxArrayTexLayers); in framebuffer_texture_layer()
1619ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex2DArray, 0, maxArrayTexLay… in framebuffer_texture_layer()
1620 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1621 ctx.endSection(); in framebuffer_texture_layer()
1623 ctx.beginSection("GL_INVALID_OPERATION is generated if zero is bound to target."); in framebuffer_texture_layer()
1624 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in framebuffer_texture_layer()
1625 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex3D, 0, 1); in framebuffer_texture_layer()
1626 ctx.expectError (GL_INVALID_OPERATION); in framebuffer_texture_layer()
1627 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in framebuffer_texture_layer()
1628 ctx.endSection(); in framebuffer_texture_layer()
1630ctx.beginSection("GL_INVALID_VALUE is generated if texture is a 3D texture and level is less than … in framebuffer_texture_layer()
1632 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex3D, -1, max3DTexSize - 1); in framebuffer_texture_layer()
1633 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1634ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex3D, log2Max3DTexSize + 1, … in framebuffer_texture_layer()
1635 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1636 ctx.endSection(); in framebuffer_texture_layer()
1638ctx.beginSection("GL_INVALID_VALUE is generated if texture is a 2D array texture and layer is less… in framebuffer_texture_layer()
1640ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex2DArray, -1, maxArrayTexLa… in framebuffer_texture_layer()
1641 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1642ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex2DArray, log2MaxTexSize + … in framebuffer_texture_layer()
1643 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1644 ctx.endSection(); in framebuffer_texture_layer()
1646 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in framebuffer_texture_layer()
1648 ctx.glGetIntegerv (GL_MAX_CUBE_MAP_TEXTURE_SIZE, &maxCubeTexSize); in framebuffer_texture_layer()
1649 ctx.glGenTextures (1, &tex2DMSArray); in framebuffer_texture_layer()
1650 ctx.glGenTextures (1, &texCube); in framebuffer_texture_layer()
1651 ctx.glGenTextures (1, &texBuffer); in framebuffer_texture_layer()
1652 ctx.glBindTexture (GL_TEXTURE_2D_MULTISAMPLE_ARRAY, tex2DMSArray); in framebuffer_texture_layer()
1653 ctx.glBindTexture (GL_TEXTURE_CUBE_MAP, texCube); in framebuffer_texture_layer()
1654 ctx.glBindTexture (GL_TEXTURE_BUFFER, texBuffer); in framebuffer_texture_layer()
1655 ctx.expectError (GL_NO_ERROR); in framebuffer_texture_layer()
1657ctx.beginSection("GL_INVALID_VALUE is generated if texture is a 2D multisample array texture and l… in framebuffer_texture_layer()
1658 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex2DMSArray, 0, -1); in framebuffer_texture_layer()
1659 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1660 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex2DMSArray, 0, 1); in framebuffer_texture_layer()
1661 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1662 ctx.endSection(); in framebuffer_texture_layer()
1664ctx.beginSection("GL_INVALID_VALUE is generated if texture is a cube map array texture and layer i… in framebuffer_texture_layer()
1665 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texCube, 0, maxCubeTexSize); in framebuffer_texture_layer()
1666 ctx.expectError (GL_INVALID_VALUE); in framebuffer_texture_layer()
1667 ctx.endSection(); in framebuffer_texture_layer()
1669 ctx.beginSection("GL_INVALID_OPERATION is generated if texture is the name of a buffer texture."); in framebuffer_texture_layer()
1670 ctx.glFramebufferTextureLayer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texBuffer, 0, 0); in framebuffer_texture_layer()
1671 ctx.expectError (GL_INVALID_OPERATION); in framebuffer_texture_layer()
1672 ctx.endSection(); in framebuffer_texture_layer()
1674 ctx.glDeleteTextures (1, &tex2DMSArray); in framebuffer_texture_layer()
1675 ctx.glDeleteTextures (1, &texCube); in framebuffer_texture_layer()
1676 ctx.glDeleteTextures (1, &texBuffer); in framebuffer_texture_layer()
1679 ctx.glDeleteTextures (1, &tex3D); in framebuffer_texture_layer()
1680 ctx.glDeleteTextures (1, &tex2DArray); in framebuffer_texture_layer()
1681 ctx.glDeleteTextures (1, &tex2D); in framebuffer_texture_layer()
1682 ctx.glDeleteFramebuffers (1, &fbo); in framebuffer_texture_layer()
1685 void invalidate_framebuffer (NegativeTestContext& ctx) in invalidate_framebuffer() argument
1692 ctx.glGetIntegerv (GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments); in invalidate_framebuffer()
1697 ctx.glGenFramebuffers (1, &fbo); in invalidate_framebuffer()
1698 ctx.glGenTextures (1, &texture); in invalidate_framebuffer()
1699 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in invalidate_framebuffer()
1700 ctx.glBindTexture (GL_TEXTURE_2D, texture); in invalidate_framebuffer()
1701 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in invalidate_framebuffer()
1702 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in invalidate_framebuffer()
1703 ctx.glCheckFramebufferStatus (GL_FRAMEBUFFER); in invalidate_framebuffer()
1704 ctx.expectError (GL_NO_ERROR); in invalidate_framebuffer()
1706ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER, GL_READ_FRAMEBUFFE… in invalidate_framebuffer()
1707 ctx.glInvalidateFramebuffer (-1, 1, &attachments[0]); in invalidate_framebuffer()
1708 ctx.expectError (GL_INVALID_ENUM); in invalidate_framebuffer()
1709 ctx.glInvalidateFramebuffer (GL_BACK, 1, &attachments[0]); in invalidate_framebuffer()
1710 ctx.expectError (GL_INVALID_ENUM); in invalidate_framebuffer()
1711 ctx.endSection(); in invalidate_framebuffer()
1713ctx.beginSection("GL_INVALID_OPERATION is generated if attachments contains GL_COLOR_ATTACHMENTm a… in invalidate_framebuffer()
1714 ctx.glInvalidateFramebuffer (GL_FRAMEBUFFER, 1, &attachments[1]); in invalidate_framebuffer()
1715 ctx.expectError (GL_INVALID_OPERATION); in invalidate_framebuffer()
1716 ctx.endSection(); in invalidate_framebuffer()
1718 ctx.beginSection("GL_INVALID_VALUE is generated if numAttachments is negative."); in invalidate_framebuffer()
1719 ctx.glInvalidateFramebuffer (GL_FRAMEBUFFER, -1, &attachments[0]); in invalidate_framebuffer()
1720 ctx.expectError (GL_INVALID_VALUE); in invalidate_framebuffer()
1721 ctx.endSection(); in invalidate_framebuffer()
1723ctx.beginSection("GL_INVALID_ENUM is generated if the default framebuffer is bound to target and a… in invalidate_framebuffer()
1724 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in invalidate_framebuffer()
1725 ctx.glInvalidateFramebuffer (GL_FRAMEBUFFER, 1, &attachments[2]); in invalidate_framebuffer()
1726 ctx.expectError (GL_INVALID_ENUM); in invalidate_framebuffer()
1727 ctx.endSection(); in invalidate_framebuffer()
1730 ctx.glDeleteTextures (1, &texture); in invalidate_framebuffer()
1731 ctx.glDeleteFramebuffers (1, &fbo); in invalidate_framebuffer()
1734 void invalidate_sub_framebuffer (NegativeTestContext& ctx) in invalidate_sub_framebuffer() argument
1741 ctx.glGetIntegerv (GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments); in invalidate_sub_framebuffer()
1746 ctx.glGenFramebuffers (1, &fbo); in invalidate_sub_framebuffer()
1747 ctx.glGenTextures (1, &texture); in invalidate_sub_framebuffer()
1748 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in invalidate_sub_framebuffer()
1749 ctx.glBindTexture (GL_TEXTURE_2D, texture); in invalidate_sub_framebuffer()
1750 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in invalidate_sub_framebuffer()
1751 ctx.glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); in invalidate_sub_framebuffer()
1752 ctx.glCheckFramebufferStatus (GL_FRAMEBUFFER); in invalidate_sub_framebuffer()
1753 ctx.expectError (GL_NO_ERROR); in invalidate_sub_framebuffer()
1755ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER, GL_READ_FRAMEBUFFE… in invalidate_sub_framebuffer()
1756 ctx.glInvalidateSubFramebuffer (-1, 1, &attachments[0], 0, 0, 16, 16); in invalidate_sub_framebuffer()
1757 ctx.expectError (GL_INVALID_ENUM); in invalidate_sub_framebuffer()
1758 ctx.glInvalidateSubFramebuffer (GL_BACK, 1, &attachments[0], 0, 0, 16, 16); in invalidate_sub_framebuffer()
1759 ctx.expectError (GL_INVALID_ENUM); in invalidate_sub_framebuffer()
1760 ctx.endSection(); in invalidate_sub_framebuffer()
1762ctx.beginSection("GL_INVALID_OPERATION is generated if attachments contains GL_COLOR_ATTACHMENTm a… in invalidate_sub_framebuffer()
1763 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, 1, &attachments[1], 0, 0, 16, 16); in invalidate_sub_framebuffer()
1764 ctx.expectError (GL_INVALID_OPERATION); in invalidate_sub_framebuffer()
1765 ctx.endSection(); in invalidate_sub_framebuffer()
1767 ctx.beginSection("GL_INVALID_VALUE is generated if numAttachments, width, or heigh is negative."); in invalidate_sub_framebuffer()
1768 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, -1, &attachments[0], 0, 0, 16, 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, -1, 16); in invalidate_sub_framebuffer()
1771 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1772 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, -1, &attachments[0], 0, 0, 16, -1); in invalidate_sub_framebuffer()
1773 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1774 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, -1, &attachments[0], 0, 0, -1, -1); in invalidate_sub_framebuffer()
1775 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1776 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, 1, &attachments[0], 0, 0, -1, 16); in invalidate_sub_framebuffer()
1777 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1778 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, 1, &attachments[0], 0, 0, 16, -1); in invalidate_sub_framebuffer()
1779 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1780 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, 1, &attachments[0], 0, 0, -1, -1); in invalidate_sub_framebuffer()
1781 ctx.expectError (GL_INVALID_VALUE); in invalidate_sub_framebuffer()
1782 ctx.endSection(); in invalidate_sub_framebuffer()
1784ctx.beginSection("GL_INVALID_ENUM is generated if the default framebuffer is bound to target and a… in invalidate_sub_framebuffer()
1785 ctx.glBindFramebuffer (GL_FRAMEBUFFER, 0); in invalidate_sub_framebuffer()
1786 ctx.glInvalidateSubFramebuffer (GL_FRAMEBUFFER, 1, &attachments[2], 0, 0, 16, 16); in invalidate_sub_framebuffer()
1787 ctx.expectError (GL_INVALID_ENUM); in invalidate_sub_framebuffer()
1788 ctx.endSection(); in invalidate_sub_framebuffer()
1790 ctx.glDeleteTextures (1, &texture); in invalidate_sub_framebuffer()
1791 ctx.glDeleteFramebuffers (1, &fbo); in invalidate_sub_framebuffer()
1794 void renderbuffer_storage_multisample (NegativeTestContext& ctx) in renderbuffer_storage_multisample() argument
1801 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA4, GL_SAMPLES, 1, &maxSamplesSupportedRGBA4); in renderbuffer_storage_multisample()
1802ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA8UI, GL_SAMPLES, 1, &maxSamplesSupportedRGBA… in renderbuffer_storage_multisample()
1804 ctx.glGenRenderbuffers (1, &rbo); in renderbuffer_storage_multisample()
1805 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo); in renderbuffer_storage_multisample()
1807 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER."); in renderbuffer_storage_multisample()
1808 ctx.glRenderbufferStorageMultisample (-1, 2, GL_RGBA4, 1, 1); in renderbuffer_storage_multisample()
1809 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage_multisample()
1810 ctx.glRenderbufferStorageMultisample (GL_FRAMEBUFFER, 2, GL_RGBA4, 1, 1); in renderbuffer_storage_multisample()
1811 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage_multisample()
1812 ctx.endSection(); in renderbuffer_storage_multisample()
1814ctx.beginSection("GL_INVALID_OPERATION is generated if samples is greater than the maximum number … in renderbuffer_storage_multisample()
1815 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, maxSamplesSupportedRGBA4+1, GL_RGBA4, 1, 1); in renderbuffer_storage_multisample()
1816 ctx.expectError (GL_INVALID_OPERATION); in renderbuffer_storage_multisample()
1817 ctx.endSection(); in renderbuffer_storage_multisample()
1819ctx.beginSection("GL_INVALID_ENUM is generated if internalformat is not a color-renderable, depth-… in renderbuffer_storage_multisample()
1820 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, -1, 1, 1); in renderbuffer_storage_multisample()
1821 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage_multisample()
1823 …if (!ctx.isExtensionSupported("GL_EXT_color_buffer_half_float")) // GL_EXT_color_buffer_half_float… in renderbuffer_storage_multisample()
1825 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, GL_RGB16F, 1, 1); in renderbuffer_storage_multisample()
1826 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage_multisample()
1829 if (!ctx.isExtensionSupported("GL_EXT_render_snorm")) // GL_EXT_render_snorm disables error in renderbuffer_storage_multisample()
1831 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, GL_RGBA8_SNORM, 1, 1); in renderbuffer_storage_multisample()
1832 ctx.expectError (GL_INVALID_ENUM); in renderbuffer_storage_multisample()
1835 ctx.endSection(); in renderbuffer_storage_multisample()
1837ctx.beginSection("GL_INVALID_OPERATION is generated if samples is greater than the maximum number … in renderbuffer_storage_multisample()
1838ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, maxSamplesSupportedRGBA8UI+1, GL_RGBA8UI, 1… in renderbuffer_storage_multisample()
1839 ctx.expectError (GL_INVALID_OPERATION); in renderbuffer_storage_multisample()
1840 ctx.endSection(); in renderbuffer_storage_multisample()
1842 ctx.beginSection("GL_INVALID_VALUE is generated if width or height is less than zero."); in renderbuffer_storage_multisample()
1843 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, GL_RGBA4, -1, 1); in renderbuffer_storage_multisample()
1844 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1845 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, GL_RGBA4, 1, -1); in renderbuffer_storage_multisample()
1846 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1847 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 2, GL_RGBA4, -1, -1); in renderbuffer_storage_multisample()
1848 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1849 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, -1, GL_RGBA4, 1, 1); in renderbuffer_storage_multisample()
1850 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1851 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, -1, GL_RGBA4, -1, 1); in renderbuffer_storage_multisample()
1852 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1853 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, -1, GL_RGBA4, 1, -1); in renderbuffer_storage_multisample()
1854 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1855 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, -1, GL_RGBA4, -1, -1); in renderbuffer_storage_multisample()
1856 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1857 ctx.endSection(); in renderbuffer_storage_multisample()
1859ctx.beginSection("GL_INVALID_VALUE is generated if width or height is greater than GL_MAX_RENDERBU… in renderbuffer_storage_multisample()
1860 ctx.glGetIntegerv (GL_MAX_RENDERBUFFER_SIZE, &maxSize); in renderbuffer_storage_multisample()
1861 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 4, GL_RGBA4, 1, maxSize+1); in renderbuffer_storage_multisample()
1862 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1863 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 4, GL_RGBA4, maxSize+1, 1); in renderbuffer_storage_multisample()
1864 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1865 ctx.glRenderbufferStorageMultisample (GL_RENDERBUFFER, 4, GL_RGBA4, maxSize+1, maxSize+1); in renderbuffer_storage_multisample()
1866 ctx.expectError (GL_INVALID_VALUE); in renderbuffer_storage_multisample()
1867 ctx.endSection(); in renderbuffer_storage_multisample()
1869 ctx.glDeleteRenderbuffers(1, &rbo); in renderbuffer_storage_multisample()
1872 void copy_image_sub_data (NegativeTestContext& ctx) in copy_image_sub_data() argument
1874 if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))) in copy_image_sub_data()
1879 ctx.glGenTextures (5, texture); in copy_image_sub_data()
1880 ctx.glGenRenderbuffers (1, &rbo); in copy_image_sub_data()
1881 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo); in copy_image_sub_data()
1883 ctx.glBindTexture (GL_TEXTURE_2D, texture[0]); in copy_image_sub_data()
1884 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in copy_image_sub_data()
1885 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in copy_image_sub_data()
1886 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in copy_image_sub_data()
1887 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_RGBA8, 32, 32); in copy_image_sub_data()
1888 ctx.glBindTexture (GL_TEXTURE_2D, texture[1]); in copy_image_sub_data()
1889 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in copy_image_sub_data()
1890 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in copy_image_sub_data()
1891 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in copy_image_sub_data()
1892 ctx.expectError (GL_NO_ERROR); in copy_image_sub_data()
1894 ctx.glBindTexture (GL_TEXTURE_3D, texture[2]); in copy_image_sub_data()
1895 ctx.glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in copy_image_sub_data()
1896 ctx.glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in copy_image_sub_data()
1897 ctx.glTexImage3D (GL_TEXTURE_3D, 0, GL_RGBA8, 32, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in copy_image_sub_data()
1898 ctx.expectError (GL_NO_ERROR); in copy_image_sub_data()
1900 ctx.glBindTexture (GL_TEXTURE_3D, texture[3]); in copy_image_sub_data()
1901 ctx.glTexImage3D (GL_TEXTURE_3D, 0, GL_RGBA8, 32, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); in copy_image_sub_data()
1902 ctx.expectError (GL_NO_ERROR); in copy_image_sub_data()
1904 ctx.glBindTexture (GL_TEXTURE_2D, texture[4]); in copy_image_sub_data()
1905 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in copy_image_sub_data()
1906 ctx.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in copy_image_sub_data()
1907 ctx.glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA32F, 32, 32, 0, GL_RGBA, GL_FLOAT, NULL); in copy_image_sub_data()
1908 ctx.expectError (GL_NO_ERROR); in copy_image_sub_data()
1910ctx.beginSection("GL_INVALID_VALUE is generated if srcWidth, srcHeight, or srcDepth is negative."); 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()
1917ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1918 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1919ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1920 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1921ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1922 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1923ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1924 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1925 ctx.endSection(); in copy_image_sub_data()
1927ctx.beginSection("GL_INVALID_VALUE is generated if srcLevel and dstLevel are not valid levels for … in copy_image_sub_data()
1928ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 1, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1929 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1930ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 1, 0, 0… in copy_image_sub_data()
1931 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1932ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 1, 0, 0, 0, texture[1], GL_TEXTURE_2D, 1, 0, 0… in copy_image_sub_data()
1933 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1934ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, -1, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, … in copy_image_sub_data()
1935 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1936ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, -1, 0, … in copy_image_sub_data()
1937 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1938ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, -1, 0, 0, 0, texture[1], GL_TEXTURE_2D, -1, 0,… in copy_image_sub_data()
1939 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1940ctx.glCopyImageSubData (rbo, GL_RENDERBUFFER, -1, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0, 0,… in copy_image_sub_data()
1941 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1942ctx.glCopyImageSubData (rbo, GL_RENDERBUFFER, 1, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0, 0, … in copy_image_sub_data()
1943 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1944ctx.glCopyImageSubData (texture[1], GL_TEXTURE_2D, 0, 0, 0, 0, rbo, GL_RENDERBUFFER, -1, 0, 0, 0,… in copy_image_sub_data()
1945 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1946ctx.glCopyImageSubData (texture[1], GL_TEXTURE_2D, 0, 0, 0, 0, rbo, GL_RENDERBUFFER, 1, 0, 0, 0, … in copy_image_sub_data()
1947 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1948 ctx.endSection(); in copy_image_sub_data()
1950ctx.beginSection("GL_INVALID_ENUM is generated if either target does not match the type of the obj… in copy_image_sub_data()
1954ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_3D, 0, 0, 0… in copy_image_sub_data()
1955 ctx.expectError (GL_INVALID_ENUM); in copy_image_sub_data()
1956ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[2], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1957 ctx.expectError (GL_INVALID_ENUM); in copy_image_sub_data()
1958ctx.glCopyImageSubData (texture[0], GL_TEXTURE_3D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1959 ctx.expectError (GL_INVALID_ENUM); in copy_image_sub_data()
1960ctx.glCopyImageSubData (texture[2], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1961 ctx.expectError (GL_INVALID_ENUM); in copy_image_sub_data()
1962 ctx.endSection(); in copy_image_sub_data()
1964ctx.beginSection("GL_INVALID_OPERATION is generated if either object is a texture and the texture … in copy_image_sub_data()
1965ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[3], GL_TEXTURE_3D, 0, 0, 0… in copy_image_sub_data()
1966 ctx.expectError (GL_INVALID_OPERATION); in copy_image_sub_data()
1967ctx.glCopyImageSubData (texture[3], GL_TEXTURE_3D, 0, 0, 0, 0, texture[0], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1968 ctx.expectError (GL_INVALID_OPERATION); in copy_image_sub_data()
1969ctx.glCopyImageSubData (texture[3], GL_TEXTURE_3D, 0, 0, 0, 0, texture[3], GL_TEXTURE_3D, 0, 0, 0… in copy_image_sub_data()
1970 ctx.expectError (GL_INVALID_OPERATION); in copy_image_sub_data()
1971 ctx.endSection(); in copy_image_sub_data()
1973ctx.beginSection("GL_INVALID_VALUE is generated if the dimensions of either subregion exceeds the … in copy_image_sub_data()
1974ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1975 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1976ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[1], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1977 ctx.expectError (GL_INVALID_VALUE); in copy_image_sub_data()
1978 ctx.endSection(); in copy_image_sub_data()
1980ctx.beginSection("GL_INVALID_OPERATION error is generated if the source and destination internal f… in copy_image_sub_data()
1981ctx.glCopyImageSubData (texture[0], GL_TEXTURE_2D, 0, 0, 0, 0, texture[4], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1982 ctx.expectError (GL_INVALID_OPERATION); in copy_image_sub_data()
1983ctx.glCopyImageSubData (texture[4], GL_TEXTURE_2D, 0, 0, 0, 0, texture[0], GL_TEXTURE_2D, 0, 0, 0… in copy_image_sub_data()
1984 ctx.expectError (GL_INVALID_OPERATION); in copy_image_sub_data()
1985 ctx.endSection(); in copy_image_sub_data()
1987 ctx.glDeleteTextures (5, texture); in copy_image_sub_data()
1988 ctx.glDeleteRenderbuffers (1, &rbo); in copy_image_sub_data()