<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 5, 2015 at 12:49 AM, Martin Peres <span dir="ltr"><<a href="mailto:martin.peres@linux.intel.com" target="_blank">martin.peres@linux.intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On 05/03/15 03:48, Ilia Mirkin wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On Wed, Mar 4, 2015 at 8:38 PM, Laura Ekstrand <<a href="mailto:laura@jlekstrand.net" target="_blank">laura@jlekstrand.net</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
  tests/all.py                                       |  1 +<br>
  .../spec/arb_direct_state_<u></u>access/CMakeLists.gl.txt |  1 +<br>
  .../spec/arb_direct_state_<u></u>access/create-buffers.c  | 78 ++++++++++++++++++++++<br>
  3 files changed, 80 insertions(+)<br>
  create mode 100644 tests/spec/arb_direct_state_<u></u>access/create-buffers.c<br>
<br>
diff --git a/tests/all.py b/tests/all.py<br>
index 0f07105..e60a02c 100644<br>
--- a/tests/all.py<br>
+++ b/tests/all.py<br>
@@ -4006,6 +4006,7 @@ spec['ARB_direct_state_access'<u></u>]['compressedtexturesubimage'] = PiglitGLTest(['ar<br>
  spec['ARB_direct_state_access'<u></u>]['texture-storage-<u></u>multisample'] = PiglitGLTest(['arb_direct_<u></u>state_access-texture-storage-<u></u>multisample'], run_concurrent=True)<br>
  spec['ARB_direct_state_access'<u></u>]['texture-buffer'] = PiglitGLTest(['arb_direct_<u></u>state_access-texture-buffer'], run_concurrent=True)<br>
  spec['ARB_direct_state_access'<u></u>]['texture-buffer-range'] = PiglitGLTest(['arb_direct_<u></u>state_access-texture-buffer-<u></u>range'], run_concurrent=True)<br>
+spec['ARB_direct_state_<u></u>access']['create-buffers'] = PiglitGLTest(['arb_direct_<u></u>state_access-create-buffers'], run_concurrent=True)<br>
  spec['ARB_direct_state_access'<u></u>]['namedbufferstorage-<u></u>persistent'] = PiglitGLTest(['arb_direct_<u></u>state_access-<u></u>namedbufferstorage-persistent'<u></u>], run_concurrent=True)<br>
  spec['ARB_direct_state_access'<u></u>]['namedbuffersubdata-vbo-<u></u>sync'] = PiglitGLTest(['arb_direct_<u></u>state_access-<u></u>namedbuffersubdata-vbo-sync'], run_concurrent=True)<br>
  spec['ARB_direct_state_access'<u></u>]['clearnamedbufferdata-<u></u>invalid-internal-format'] = PiglitGLTest(['arb_direct_<u></u>state_access-<u></u>clearnamedbufferdata-invalid-<u></u>internal-format'], run_concurrent=True)<br>
diff --git a/tests/spec/arb_direct_state_<u></u>access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_<u></u>access/CMakeLists.gl.txt<br>
index b2b7465..2a4915d 100644<br>
--- a/tests/spec/arb_direct_state_<u></u>access/CMakeLists.gl.txt<br>
+++ b/tests/spec/arb_direct_state_<u></u>access/CMakeLists.gl.txt<br>
@@ -10,6 +10,7 @@ link_libraries (<br>
  )<br>
<br>
  piglit_add_executable (arb_direct_state_access-<u></u>create-transformfeedbacks create-transformfeedbacks.c)<br>
+piglit_add_executable (arb_direct_state_access-<u></u>create-buffers create-buffers.c)<br>
  piglit_add_executable (arb_direct_state_access-<u></u>namedbufferstorage-persistent namedbufferstorage.c)<br>
  piglit_add_executable (arb_direct_state_access-<u></u>namedbuffersubdata-vbo-sync namedbuffersubdata-vbo-sync.c)<br>
  piglit_add_executable (arb_direct_state_access-<u></u>clearnamedbufferdata-invalid-<u></u>internal-format clearnamedbufferdata-invalid-<u></u>internal-format.c)<br>
diff --git a/tests/spec/arb_direct_state_<u></u>access/create-buffers.c b/tests/spec/arb_direct_state_<u></u>access/create-buffers.c<br>
new file mode 100644<br>
index 0000000..12fcf0b<br>
--- /dev/null<br>
+++ b/tests/spec/arb_direct_state_<u></u>access/create-buffers.c<br>
@@ -0,0 +1,78 @@<br>
+/*<br>
+ * Copyright 2014 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>
+/** @file create_buffers.c<br>
+ *<br>
+ * Tests glCreateBuffers to see if it behaves in the expected way,<br>
+ * throwing the correct errors, etc.<br>
+ */<br>
+<br>
+#include "piglit-util-gl.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+<br>
+       config.supports_gl_compat_<u></u>version = 32;<br>
</blockquote>
This will never run on mesa, right? I assume you meant<br>
<br>
supports_gl_core_version = 31 (or 32?)<br>
</blockquote>
<br></div></div>
Why 32? 31 should be enough and that is also what I used on all my tests.</blockquote><div>Oddly enough, there is no "core context" for 3.1.  It's not a thing.  31 is strange like that.  Core contexts start at 3.2.  The reason why your tests work with core_compat = 31 is because Piglit jumps through some hoops, often promoting the user automatically to 32 or above behind the scenes.  If we are going to only test on core contexts, then we should probably start at 32 since 31 is such a strange beast.<br><br></div><div>Now, as far as whether or not we should test on compat contexts, most of the discussion is confusing to me.  Often DSA entry points work as long as the system has the appropriate related extension (i.e. you can't call CreateSamplers if you don't have samplers).  Whenever the battle over core vs. compat and what version to use is finally decided, we will probably have to go back and redo these statements in the tests. (Ouch :( )<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+       config.window_visual = PIGLIT_GL_VISUAL_RGBA |<br>
+               PIGLIT_GL_VISUAL_DOUBLE;<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+void<br>
+piglit_init(int argc, char **argv)<br>
+{<br>
+       piglit_require_extension("GL_<u></u>ARB_direct_state_access");<br>
+}<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+       bool pass = true;<br>
+       GLuint name;<br>
+       GLboolean ret;<br>
+<br>
+       /* Throw some invalid inputs at glCreateBuffers. */<br>
+<br>
+       /* n is negative */<br>
+       glCreateBuffers(-1, &name);<br>
+       pass = piglit_check_gl_error(GL_<u></u>INVALID_VALUE) && pass;<br>
+<br>
+       /* name is not a valid pointer */<br>
+       glCreateBuffers(1, 0);<br>
+       pass = piglit_check_gl_error(GL_NO_<u></u>ERROR) && pass;<br>
+       glCreateBuffers(1, NULL);<br>
+       pass = piglit_check_gl_error(GL_NO_<u></u>ERROR) && pass;<br>
</blockquote></blockquote>
<br></div></div>
Good idea to tests this! No need to test for both 0 and NULL though.<span class=""><br></span></blockquote><div>Fixed. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+<br>
+       /* Check if it actually generates a real buffer object */<br>
+<br>
+       glCreateBuffers(1, &name);<br>
+       pass = piglit_check_gl_error(GL_NO_<u></u>ERROR) && pass;<br>
+<br>
+       ret = glIsBuffer(name);<br>
+       pass = (ret == GL_TRUE) && pass;<br>
+       pass = piglit_check_gl_error(GL_NO_<u></u>ERROR) && pass;<br>
+<br>
+       return pass ? PIGLIT_PASS : PIGLIT_FAIL;<br>
+}<br>
+<br>
--<br>
2.1.0<br>
</blockquote></blockquote>
<br></span>
I would really like to have multiple subtests here to show what we really test and not to have to open the test c file to know what went wrong.<br>
<br>
Could you use the SUBTEST macros and give the same name to the tests that I had in all my create-* tests? [0]<br></blockquote><div>Sure, that's done.<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Don't forget to delete the buffer at the end. Not that it should matter but some people apparently run valgrind / coverty on piglit and they find this kind of "bugs".''</blockquote><div>Fixed: <a href="http://cgit.freedesktop.org/~ldeks/piglit/commit/?h=adsa-framebuffers&id=826afe77a56d266680938f8eab6108c94e6e6622">http://cgit.freedesktop.org/~ldeks/piglit/commit/?h=adsa-framebuffers&id=826afe77a56d266680938f8eab6108c94e6e6622</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks!<br>
<br>
[0] <a href="http://cgit.freedesktop.org/piglit/commit/?id=0c8acebafefbe5cb400c055d9880788f22339ce3" target="_blank">http://cgit.freedesktop.org/<u></u>piglit/commit/?id=<u></u>0c8acebafefbe5cb400c055d988078<u></u>8f22339ce3</a><br>
</blockquote></div><br></div></div>