2 * Copyright (c) 2010 VMware, Inc.
3 * Copyright (c) 2015 Red Hat Inc.
4 * Copyright (C) 2017 Valve Corporation
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28 * Test inherited vertex attributes from NV_vertex_attrib_integer_64bit.
29 * Derived from Brian's gpu_shader4 tests and Dave's vertex_attrib_64bit tests.
36 PIGLIT_GL_TEST_CONFIG_BEGIN
38 config
.supports_gl_core_version
= 33;
40 config
.window_visual
= PIGLIT_GL_VISUAL_RGBA
| PIGLIT_GL_VISUAL_DOUBLE
;
41 config
.khr_no_error_support
= PIGLIT_NO_ERRORS
;
43 PIGLIT_GL_TEST_CONFIG_END
45 static const char *TestName
= "uint64_attribs";
46 static const GLuint Index
= 3;
49 check_uint64_attrib(const GLuint64EXT expected
, const char *func
)
53 glGetVertexAttribLui64vARB(Index
, GL_CURRENT_VERTEX_ATTRIB_ARB
, vals
);
55 if (expected
!= vals
[0]) {
56 fprintf(stderr
, "%s: %s failed\n", TestName
, func
);
57 fprintf(stderr
, " Expected: %"PRIu64
" Found: %"PRIu64
"\n",
71 piglit_init(int argc
, char **argv
)
73 GLuint64EXT val
= 1844674407370955165;
75 piglit_require_extension("GL_ARB_bindless_texture");
77 /* The ARB_bindless_texture spec says:
79 * "Interactions with NV_vertex_attrib_integer_64bit"
81 * "If NV_vertex_attrib_integer_64bit is not supported, this
82 * extension inherits the {Get}VertexAttribL1ui64{v}ARB entry points
83 * and UNSIGNED_INT64_ARB enum, as well as the functional edits
84 * describing them. However, references to the uint64_t type in the
85 * shader and providing 64-bit unsigned integer data to the shader
88 glVertexAttribL1ui64ARB(Index
, val
);
89 if (!check_uint64_attrib(val
, "glVertexAttribL1ui64ARB"))
90 piglit_report_result(PIGLIT_FAIL
);
92 glVertexAttribL1ui64vARB(Index
, &val
);
93 if (!check_uint64_attrib(val
, "glVertexAttribL1ui64vARB"))
94 piglit_report_result(PIGLIT_FAIL
);
96 piglit_report_result(PIGLIT_PASS
);