<div dir="ltr">Reviewed-by: Brian Paul <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>><br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 1, 2014 at 1:54 PM, <span dir="ltr"><<a href="mailto:jfonseca@vmware.com" target="_blank">jfonseca@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: José Fonseca <<a href="mailto:jose.r.fonseca@gmail.com">jose.r.fonseca@gmail.com</a>><br>
<br>
Mesa didn't get this quite right, causing problems to ApiTrace --<br>
<a href="https://github.com/apitrace/apitrace/issues/261" target="_blank">https://github.com/apitrace/apitrace/issues/261</a> .<br>
---<br>
tests/all.py | 1 +<br>
tests/spec/arb_vertex_array_bgra/CMakeLists.gl.txt | 1 +<br>
tests/spec/arb_vertex_array_bgra/get.c | 81 ++++++++++++++++++++++<br>
3 files changed, 83 insertions(+)<br>
create mode 100644 tests/spec/arb_vertex_array_bgra/get.c<br>
<br>
diff --git a/tests/all.py b/tests/all.py<br>
index a67e725..8128b4f 100644<br>
--- a/tests/all.py<br>
+++ b/tests/all.py<br>
@@ -2157,6 +2157,7 @@ add_plain_test(apple_vertex_array_object, 'vao-02')<br>
apple_vertex_array_object['isvertexarray'] = concurrent_test('arb_vertex_array-isvertexarray apple')<br>
<br>
profile.test_list['spec/ARB_vertex_array_bgra/api-errors'] = PiglitTest('arb_vertex_array_bgra-api-errors -auto')<br>
+profile.test_list['spec/ARB_vertex_array_bgra/get'] = PiglitTest('arb_vertex_array_bgra-get -auto')<br>
<br>
arb_vertex_array_object = {}<br>
spec['ARB_vertex_array_object'] = arb_vertex_array_object<br>
diff --git a/tests/spec/arb_vertex_array_bgra/CMakeLists.gl.txt b/tests/spec/arb_vertex_array_bgra/CMakeLists.gl.txt<br>
index 3f3579b..4ae8eca 100644<br>
--- a/tests/spec/arb_vertex_array_bgra/CMakeLists.gl.txt<br>
+++ b/tests/spec/arb_vertex_array_bgra/CMakeLists.gl.txt<br>
@@ -10,5 +10,6 @@ link_libraries (<br>
)<br>
<br>
piglit_add_executable (arb_vertex_array_bgra-api-errors api-errors.c)<br>
+piglit_add_executable (arb_vertex_array_bgra-get get.c)<br>
<br>
# vim: ft=cmake:<br>
diff --git a/tests/spec/arb_vertex_array_bgra/get.c b/tests/spec/arb_vertex_array_bgra/get.c<br>
new file mode 100644<br>
index 0000000..05dc2f3<br>
--- /dev/null<br>
+++ b/tests/spec/arb_vertex_array_bgra/get.c<br>
@@ -0,0 +1,81 @@<br>
+/*<br>
+ * Copyright 2014 VMware, Inc<br>
+ * Copyright 2013 Intel Corporation<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a<br>
+ * copy of this software and associated documentation files (the "Software"),<br>
+ * to deal in the Software without restriction, including without limitation<br>
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+ * and/or sell copies of the Software, and to permit persons to whom the<br>
+ * Software is furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice (including the next<br>
+ * paragraph) shall be included in all copies or substantial portions of the<br>
+ * Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL<br>
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER<br>
+ * DEALINGS IN THE SOFTWARE.<br>
+ */<br>
+<br>
+/*<br>
+ * This tests that glGet*(GL_*_ARRAY_SIZE) returns GL_BGRA.<br>
+ *<br>
+ * Tools like ApiTrace rely on this to work correctly. See for example<br>
+ * <a href="https://github.com/apitrace/apitrace/issues/261" target="_blank">https://github.com/apitrace/apitrace/issues/261</a> .<br>
+ */<br>
+<br>
+#include "piglit-util-gl-common.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+ config.supports_gl_compat_version = 10;<br>
+ config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+void<br>
+piglit_init(int argc, char **argv)<br>
+{<br>
+ static const GLubyte ubytes[4] = { 255, 0, 0, 127 };<br>
+ bool pass = true;<br>
+ GLint size;<br>
+<br>
+ piglit_require_gl_version(20);<br>
+ piglit_require_extension("GL_ARB_vertex_array_bgra");<br>
+<br>
+ glColorPointer(GL_BGRA, GL_UNSIGNED_BYTE, sizeof ubytes, ubytes);<br>
+ size = 0;<br>
+ glGetIntegerv(GL_COLOR_ARRAY_SIZE, &size);<br>
+ if (size != GL_BGRA) {<br>
+ fprintf(stderr, "glGetIntegerv(GL_COLOR_ARRAY_SIZE) returned %i, GL_BGRA expected\n", size);<br>
+ pass = false;<br>
+ }<br>
+<br>
+ glSecondaryColorPointer(GL_BGRA, GL_UNSIGNED_BYTE, sizeof ubytes, ubytes);<br>
+ size = 0;<br>
+ glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_SIZE, &size);<br>
+ if (size != GL_BGRA) {<br>
+ fprintf(stderr, "glGetIntegerv(GL_SECONDARY_COLOR_ARRAY_SIZE) returned %i, GL_BGRA expected\n", size);<br>
+ pass = false;<br>
+ }<br>
+<br>
+ glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, sizeof ubytes, ubytes);<br>
+ size = 0;<br>
+ glGetVertexAttribiv(1, GL_VERTEX_ATTRIB_ARRAY_SIZE, &size);<br>
+ if (size != GL_BGRA) {<br>
+ fprintf(stderr, "glGetVertexAttribiv(GL_VERTEX_ATTRIB_ARRAY_SIZE) returned %i, GL_BGRA expected\n", size);<br>
+ pass = false;<br>
+ }<br>
+<br>
+ piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);<br>
+}<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+ /* Should never get here. */<br>
+ return PIGLIT_FAIL;<br>
+}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.0.0.rc2<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div>