<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div><span>By the way I'm testing this as the spec doesn't say how they should interact and its likely that the current Mesa implementation is acting differently to everyone else. <br></span></div><div style="display: block;" class="yahoo_quoted"> <br> <br> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Sunday, 2 March 2014 2:07 PM, Timothy Arceri <t_arceri@yahoo.com.au> wrote:<br> </font> </div> <div class="y_msg_container">Hi guys, I don't own a Nvidia card and I'm interested in how the binary driver treats interactions<br>between these two extension. This is a modified version of my
KHR_debug push/pop test with<br>ARB_debug_ouput calls mixed in that should let me know how they interact.<br>I would be greatful if someone could run this on the Nvidia binary and send me the results in<br>the main output file.<br><br>FYI I've run this on Catalyst and it seems AMD just uses an alias and shares the similar functions.<br><br>Thanks<br>Tim <br><br>---<br> tests/all.py | 1 +<br> tests/spec/khr_debug/CMakeLists.gl.txt | 1 +<br> tests/spec/khr_debug/debug-push-pop-group.c | 293 +++++++++++++++++++++++++++<br> 3 files changed, 295 insertions(+)<br> create mode 100644 tests/spec/khr_debug/debug-push-pop-group.c<br><br>diff --git a/tests/all.py b/tests/all.py<br>index 590c832..93e38b3 100644<br>--- a/tests/all.py<br>+++ b/tests/all.py<br>@@ -1835,6 +1835,7 @@
add_plain_test(arb_debug_output, 'arb_debug_output-api_error')<br> khr_debug = Group()<br> spec['KHR_debug'] = khr_debug<br> khr_debug['object-label'] = concurrent_test('khr_debug-object-label')<br>+khr_debug['push-pop-group'] = concurrent_test('khr_debug-push-pop-group')<br> <br> # Group ARB_occlusion_query2<br> arb_occlusion_query2 = Group()<br>diff --git a/tests/spec/khr_debug/CMakeLists.gl.txt b/tests/spec/khr_debug/CMakeLists.gl.txt<br>index b0079df..f7b32bd 100644<br>--- a/tests/spec/khr_debug/CMakeLists.gl.txt<br>+++ b/tests/spec/khr_debug/CMakeLists.gl.txt<br>@@ -10,5 +10,6 @@ link_libraries (<br> )<br> <br> piglit_add_executable (khr_debug-object-label debug-object-label.c)<br>+piglit_add_executable (khr_debug-push-pop-group debug-push-pop-group.c)<br> <br> # vim: ft=cmake:<br>diff --git a/tests/spec/khr_debug/debug-push-pop-group.c b/tests/spec/khr_debug/debug-push-pop-group.c<br>new file mode 100644<br>index 0000000..01caa98<br>---
/dev/null<br>+++ b/tests/spec/khr_debug/debug-push-pop-group.c<br>@@ -0,0 +1,293 @@<br>+/*<br>+ * Copyright (c) 2013 Timothy Arceri <<a ymailto="mailto:t_arceri@yahoo.com.au" href="mailto:t_arceri@yahoo.com.au">t_arceri@yahoo.com.au</a>><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>+ * on the rights to use, copy, modify, merge, publish, distribute, sub<br>+ * license, and/or sell copies of the Software, and to permit persons to whom<br>+ * the 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,<br>+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br>+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND<br>+ * NON-INFRINGEMENT. IN NO EVENT SHALL AUTHORS AND/OR THEIR SUPPLIERS<br>+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN<br>+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN<br>+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br>+ * SOFTWARE.<br>+ */<br>+<br>+#include "piglit-util-gl-common.h"<br>+<br>+static const char *TestMessage1 = "Piglit Message 1";<br>+static const char *TestMessage2 = "Piglit Message 2";<br>+static const char *TestMessage3 = "Piglit Message 3";<br>+static const char *TestMessage4 = "Piglit Message 4";<br>+<br>+static const int MessageId1 = 101;<br>+static const int MessageId2 = 202;<br>+static const int MessageId3 = 303;<br>+static const int MessageId4 =
404;<br>+<br>+PIGLIT_GL_TEST_CONFIG_BEGIN<br>+<br>+ config.supports_gl_compat_version = 11;<br>+ config.require_debug_context = true;<br>+<br>+ config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;<br>+<br>+PIGLIT_GL_TEST_CONFIG_END<br>+<br>+enum piglit_result<br>+piglit_display(void)<br>+{<br>+ return PIGLIT_PASS;<br>+}<br>+<br>+static GLboolean fetch_one_log_message()<br>+{<br>+ char log[4096];<br>+ GLboolean ret =<br>+ !!glGetDebugMessageLog(1, 4096, NULL, NULL, NULL, NULL, NULL, log);<br>+<br>+ if (ret) {<br>+ printf("Log: %s\n", log);<br>+ }<br>+ return ret;<br>+}<br>+<br>+static bool check_inheritance_messages(int expectedCount, GLuint* expectedIds)<br>+{<br>+ bool pass =
true;<br>+ int max_messages = 5;<br>+ int bufSize = 1280;<br>+ int i;<br>+ GLuint count;<br>+ GLenum types[max_messages];<br>+ GLuint ids[max_messages];<br>+<br>+ GLchar messageLog[bufSize];<br>+<br>+ count = glGetDebugMessageLogARB(max_messages,<br>+ bufSize,<br>+ NULL,<br>+ types,<br>+ ids,<br>+ NULL,<br>+
NULL,<br>+ messageLog);<br>+<br>+ if (count != expectedCount) {<br>+ fprintf(stderr, "Expected message count: %i Actual message count: %i\n",<br>+ expectedCount, count);<br>+ pass = false;<br>+ } else {<br>+ for (i = 0; i < expectedCount; i++) {<br>+ printf("Type: %x", types[i]);<br>+ if (expectedIds[i] != ids[i]) {<br>+ fprintf(stderr, "Expected id: %i Actual id: %i\n",<br>+
expectedIds[i], ids[i]);<br>+ pass = false;<br>+ }<br>+ }<br>+ }<br>+<br>+ return pass;<br>+}<br>+<br>+static void insert_inheritance_messages()<br>+{<br>+ glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId1,<br>+ GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage1);<br>+<br>+ glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId2,<br>+ GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage2);<br>+<br>+ glDebugMessageInsertARB(GL_DEBUG_SOURCE_APPLICATION,
GL_DEBUG_TYPE_MARKER, MessageId3,<br>+ GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage3);<br>+<br>+ glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId4,<br>+ GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage4);<br>+}<br>+<br>+/*<br>+ * Test inheritance of group filtering (nesting)<br>+ */<br>+static bool test_push_pop_group_inheritance()<br>+{<br>+ bool pass = true;<br>+ GLuint allowedIds1[] = {MessageId1};<br>+ GLuint allowedIds2[] = {MessageId2};<br>+ GLuint allowedIds3[] = {MessageId3};<br>+<br>+ GLuint expectedIds1[] = {MessageId1};<br>+ GLuint expectedIds2[] = {MessageId1, MessageId2};<br>+ GLuint expectedIds3[] = {MessageId1, MessageId2,
MessageId3};<br>+<br>+ puts("Testing Push debug group inheritance");<br>+<br>+ /* Setup of the default active debug group: Filter everything out */<br>+ glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE,<br>+ GL_DONT_CARE, 0, NULL, GL_FALSE);<br>+<br>+ /* Push debug group 1 and allow messages with the id 101*/<br>+ glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 1, 11, "Push_Pop 1");<br>+ glDebugMessageControl(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER,<br>+ GL_DONT_CARE, 1, allowedIds1, GL_TRUE);<br>+ insert_inheritance_messages();<br>+ pass = check_inheritance_messages(1, expectedIds1);<br>+<br>+ /* Push debug group 1 and allow messages
with the id 101 and 202*/<br>+ glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 1, 11, "Push_Pop 2");<br>+ glDebugMessageControl(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER,<br>+ GL_DONT_CARE, 1, allowedIds2, GL_TRUE);<br>+ insert_inheritance_messages();<br>+ pass = check_inheritance_messages(2, expectedIds2) && pass;<br>+<br>+ /* Push debug group 1 and allow messages with the id 101, 202 and 303*/<br>+ glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 1, 11, "Push_Pop 3");<br>+ glDebugMessageControl(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER,<br>+ GL_DONT_CARE, 1, allowedIds3, GL_TRUE);<br>+ insert_inheritance_messages();<br>+
pass = check_inheritance_messages(3, expectedIds3) && pass;<br>+<br>+ puts("Testing Pop debug group inheritance");<br>+<br>+ /* Pop debug group 3 */<br>+ glPopDebugGroup();<br>+ insert_inheritance_messages();<br>+ pass = check_inheritance_messages(2, expectedIds2) && pass;<br>+<br>+ /* Pop debug group 2 */<br>+ glPopDebugGroup();<br>+ insert_inheritance_messages();<br>+ pass = check_inheritance_messages(1, expectedIds1) && pass;<br>+<br>+ /* Pop group 1, restore the volume control of the default debug group. */<br>+ glPopDebugGroup();<br>+ insert_inheritance_messages();<br>+<br>+ if (fetch_one_log_message()) {<br>+ fprintf(stderr, "The message log should be
empty\n");<br>+ pass = false;<br>+ }<br>+<br>+ return pass;<br>+}<br>+<br>+/*<br>+ * Test Push/Pop Debug Group<br>+ */<br>+static bool test_push_pop_debug_group()<br>+{<br>+ bool pass = true;<br>+ int max_messages = 5;<br>+ int bufSize = 1280;<br>+ GLuint count;<br>+<br>+ GLsizei lengths[max_messages];<br>+ GLchar messageLog[bufSize];<br>+<br>+ puts("Testing Push Pop debug message group");<br>+<br>+ /* Setup of the default active debug group: Filter everything in */<br>+ glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE,<br>+ 0, NULL, GL_TRUE);<br>+<br>+ /* Generate a debug marker debug output message
*/<br>+ glDebugMessageInsertARB(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId1,<br>+ GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage1);<br>+<br>+ /* Push debug group 1 */<br>+ glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 1, 17, TestMessage2);<br>+<br>+ /* Setup of the debug group 1: Filter everything out */<br>+ glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE,<br>+ 0, NULL, GL_FALSE);<br>+<br>+ /* This message shouldn't appear in the debug output log */<br>+ glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId1,<br>+ GL_DEBUG_SEVERITY_NOTIFICATION, -1,
TestMessage3);<br>+<br>+ /* Pop group 1, restore the volume control of the default debug group. */<br>+ glPopDebugGroup();<br>+<br>+ /* Generate a debug marker debug output message */<br>+ glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId1,<br>+ GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage4);<br>+<br>+ /* Check that message log has done correct filtering */<br>+ count = glGetDebugMessageLog(max_messages,<br>+ bufSize,<br>+ NULL,<br>+ NULL,<br>+
NULL,<br>+ NULL,<br>+ lengths,<br>+ messageLog);<br>+<br>+ if (count != 4) {<br>+ fprintf(stderr, "The message log should contain 4 messages not %i messages\n", count);<br>+ pass = false;<br>+ int nextMessage = lengths[0];<br>+ if (strcmp(TestMessage2, messageLog+nextMessage) != 0) {<br>+ fprintf(stderr, "Expected: %s Message: %s\n", TestMessage2, messageLog+nextMessage);<br>+
pass = false;<br>+ }<br>+ }<br>+<br>+ if (pass) {<br>+ int i;<br>+<br>+ /* the thrid message should be TestMessage2 from glPopDebugGroup() */<br>+ int nextMessage = lengths[0] + lengths[1];<br>+ if (strcmp(TestMessage2, messageLog+nextMessage) != 0) {<br>+ fprintf(stderr, "Expected: %s Message: %s\n", TestMessage2, messageLog+nextMessage);<br>+ pass = false;<br>+ }<br>+<br>+ /* double check that TestMessage3 didnt sneak into the list */<br>+ nextMessage = 0;<br>+
for (i = 0; i < count; i++) {<br>+ if (strcmp(TestMessage3, messageLog+nextMessage) == 0) {<br>+ fprintf(stderr, "The log should not contain the message: %s",<br>+ messageLog+nextMessage);<br>+ pass = false;<br>+ }<br>+ nextMessage += lengths[i];<br>+ }<br>+<br>+ /* the forth message should be TestMessage4 */<br>+ nextMessage = lengths[0] + lengths[1] + lengths[3];<br>+ if
(strcmp(TestMessage4, messageLog+nextMessage) != 0) {<br>+ fprintf(stderr, "Expected: %s Message: %s\n", TestMessage4, messageLog+nextMessage);<br>+ pass = false;<br>+ }<br>+ }<br>+<br>+ return pass;<br>+}<br>+<br>+void piglit_init(int argc, char **argv)<br>+{<br>+ bool pass = true;<br>+<br>+ piglit_require_extension("GL_KHR_debug");<br>+<br>+ glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);<br>+ glEnable(GL_DEBUG_OUTPUT);<br>+<br>+ if (!piglit_check_gl_error(GL_NO_ERROR))<br>+ piglit_report_result(PIGLIT_FAIL);<br>+<br>+ /* test message control and debug groups */<br>+ pass =
test_push_pop_debug_group();<br>+ pass = test_push_pop_group_inheritance() && pass;<br>+<br>+ piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);<br>+}<br>-- <br>1.7.9.5<br><br><br><br></div> </div> </div> </div> </div></body></html>