framework/replay: disable AA accounting when comparing with no tolerance
[piglit.git] / tests / spec / arb_texture_buffer_range / dlist.c
blob4d2b643ab82f178b49397288ed65543b03603b55
1 /*
2 * Copyright © 2011 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"
26 /**
27 * @file dlist.c
29 * Tests display list behavior for GL_ARB_texture_buffer_range.
31 * The new entrypoint was added to the list of buffer-object related
32 * commands that are executed immediately and not added to the display
33 * list.
36 PIGLIT_GL_TEST_CONFIG_BEGIN
38 config.supports_gl_compat_version = 10;
40 config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
41 config.khr_no_error_support = PIGLIT_NO_ERRORS;
43 PIGLIT_GL_TEST_CONFIG_END
45 enum piglit_result
46 piglit_display(void)
48 /* UNREACHED */
49 return PIGLIT_FAIL;
52 void
53 piglit_init(int argc, char **argv)
55 bool pass = true;
56 GLuint list, tex, bo;
57 GLint ret;
59 piglit_require_gl_version(20);
60 piglit_require_extension("GL_ARB_texture_buffer_range");
62 glGenTextures(1, &tex);
63 glBindTexture(GL_TEXTURE_BUFFER, tex);
65 glGenBuffers(1, &bo);
66 glBindBuffer(GL_TEXTURE_BUFFER, bo);
67 glBufferData(GL_TEXTURE_BUFFER, 128, NULL, GL_STATIC_DRAW);
69 list = glGenLists(1);
70 glNewList(list, GL_COMPILE);
71 glTexBufferRange(GL_TEXTURE_BUFFER, GL_RGBA8, bo, 0, 128);
72 glEndList();
74 ret = 0xd0d0d0d0;
75 glGetIntegerv(GL_TEXTURE_BUFFER_DATA_STORE_BINDING, &ret);
76 if (ret != bo) {
77 fprintf(stderr,
78 "GL_TEXTURE_BUFFER_DATA_STORE after display list "
79 "compile was %d, expected %d\n", ret, bo);
80 pass = false;
83 /* Make sure the list is empty. */
84 glTexBufferRange(GL_TEXTURE_BUFFER, GL_RGBA8, 0, 0, 0);
85 glCallList(list);
86 if (!piglit_check_gl_error(0))
87 pass = false;
89 glGetIntegerv(GL_TEXTURE_BUFFER_DATA_STORE_BINDING, &ret);
90 if (ret != 0) {
91 fprintf(stderr,
92 "GL_TEXTURE_BUFFER_DATA_STORE after display list "
93 "compile was %d, expected %d\n", ret, 0);
94 pass = false;
97 piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);