ext_gpu_shader4: add compiler tests for everything
[piglit.git] / tests / spec / arb_transform_feedback3 / draw_using_invalid_stream_index.c
blob7087c28d26899cb867fd1d0e988bfee6297f08b4
1 /*
2 * Copyright © 2013 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
24 #include "piglit-util-gl.h"
25 #include "xfb3_common.h"
27 /**
28 * @file draw_using_invalid_stream_index.c
30 * "The error INVALID_VALUE is generated by DrawTransformFeedbackStream
31 * if <stream> is greater than or equal to the value of MAX_VERTEX_STREAMS."
34 PIGLIT_GL_TEST_CONFIG_BEGIN
36 config.supports_gl_compat_version = 32;
37 config.supports_gl_core_version = 32;
38 config.khr_no_error_support = PIGLIT_HAS_ERRORS;
40 PIGLIT_GL_TEST_CONFIG_END
42 void
43 piglit_init(int argc, char **argv)
45 GLuint tfb;
46 GLint max_stream;
47 bool pass;
49 piglit_require_extension("GL_ARB_transform_feedback3");
50 piglit_require_extension("GL_ARB_gpu_shader5");
52 glGetIntegerv(GL_MAX_VERTEX_STREAMS, &max_stream);
53 if (!piglit_check_gl_error(GL_NO_ERROR)) {
54 printf("failed to resolve the maximum number of streams\n");
55 piglit_report_result(PIGLIT_FAIL);
58 glGenTransformFeedbacks(1, &tfb);
59 glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, tfb);
61 glDrawTransformFeedbackStream(GL_TRIANGLE_STRIP, tfb, max_stream);
63 pass = piglit_check_gl_error(GL_INVALID_VALUE);
65 glDeleteTransformFeedbacks(1, &tfb);
67 piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
70 enum piglit_result
71 piglit_display(void)
73 /* Should never be reached */
74 return PIGLIT_FAIL;