<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>Thanks for testing. I'll get to work removing the unneeded bits in Mesa.<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 8:53 PM, Fabian Bieler <fabianbieler@fastmail.fm> wrote:<br> </font> </div> <div class="y_msg_container">It seems nvidia just aliased DebugInsertMessage, as well.<div class="yqt7384342516" id="yqtfd44563"><br clear="none">On 2014-03-02 04:28, Timothy Arceri wrote:<br clear="none">> Hi guys, I don't own a Nvidia card and I'm interested in how the binary driver
treats interactions<br clear="none">> between these two extension. This is a modified version of my KHR_debug push/pop test with<br clear="none">> ARB_debug_ouput calls mixed in that should let me know how they interact.<br clear="none">> I would be greatful if someone could run this on the Nvidia binary and send me the results in<br clear="none">> the main output file.<br clear="none">><br clear="none">> FYI I've run this on Catalyst and it seems AMD just uses an alias and shares the similar functions.<br clear="none">><br clear="none">> Thanks<br clear="none">> Tim<br clear="none">><br clear="none">> V2: Test DebugMessageControlARB() with KHR_debug type, and GetDebugMessageLogARB() with<br clear="none">> push/pop types<br clear="none">> ---<br clear="none">> tests/all.py | 1 +<br
clear="none">> tests/spec/khr_debug/CMakeLists.gl.txt | 1 +<br clear="none">> tests/spec/khr_debug/debug-push-pop-group.c | 293 +++++++++++++++++++++++++++<br clear="none">> 3 files changed, 295 insertions(+)<br clear="none">> create mode 100644 tests/spec/khr_debug/debug-push-pop-group.c<br clear="none">><br clear="none">> diff --git a/tests/all.py b/tests/all.py<br clear="none">> index 590c832..93e38b3 100644<br clear="none">> --- a/tests/all.py<br clear="none">> +++ b/tests/all.py<br clear="none">> @@ -1835,6 +1835,7 @@ add_plain_test(arb_debug_output, 'arb_debug_output-api_error')<br clear="none">> khr_debug = Group()<br clear="none">> spec['KHR_debug'] = khr_debug<br clear="none">> khr_debug['object-label'] = concurrent_test('khr_debug-object-label')<br clear="none">> +khr_debug['push-pop-group'] =
concurrent_test('khr_debug-push-pop-group')<br clear="none">><br clear="none">> # Group ARB_occlusion_query2<br clear="none">> arb_occlusion_query2 = Group()<br clear="none">> diff --git a/tests/spec/khr_debug/CMakeLists.gl.txt b/tests/spec/khr_debug/CMakeLists.gl.txt<br clear="none">> index b0079df..f7b32bd 100644<br clear="none">> --- a/tests/spec/khr_debug/CMakeLists.gl.txt<br clear="none">> +++ b/tests/spec/khr_debug/CMakeLists.gl.txt<br clear="none">> @@ -10,5 +10,6 @@ link_libraries (<br clear="none">> )<br clear="none">><br clear="none">> piglit_add_executable (khr_debug-object-label debug-object-label.c)<br clear="none">> +piglit_add_executable (khr_debug-push-pop-group debug-push-pop-group.c)<br clear="none">><br clear="none">> # vim: ft=cmake:<br clear="none">> diff --git a/tests/spec/khr_debug/debug-push-pop-group.c b/tests/spec/khr_debug/debug-push-pop-group.c<br
clear="none">> new file mode 100644<br clear="none">> index 0000000..fbfdf85<br clear="none">> --- /dev/null<br clear="none">> +++ b/tests/spec/khr_debug/debug-push-pop-group.c<br clear="none">> @@ -0,0 +1,293 @@<br clear="none">> +/*<br clear="none">> + * Copyright (c) 2013 Timothy Arceri <<a shape="rect" ymailto="mailto:t_arceri@yahoo.com.au" href="mailto:t_arceri@yahoo.com.au">t_arceri@yahoo.com.au</a>><br clear="none">> + *<br clear="none">> + * Permission is hereby granted, free of charge, to any person obtaining a<br clear="none">> + * copy of this software and associated documentation files (the "Software"),<br clear="none">> + * to deal in the Software without restriction, including without limitation<br clear="none">> + * on the rights to use, copy, modify, merge, publish, distribute, sub<br clear="none">> + * license, and/or sell copies of the Software, and to permit persons to whom<br
clear="none">> + * the Software is furnished to do so, subject to the following conditions:<br clear="none">> + *<br clear="none">> + * The above copyright notice and this permission notice (including the next<br clear="none">> + * paragraph) shall be included in all copies or substantial portions of the<br clear="none">> + * Software.<br clear="none">> + *<br clear="none">> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,<br clear="none">> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br clear="none">> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND<br clear="none">> + * NON-INFRINGEMENT. IN NO EVENT SHALL AUTHORS AND/OR THEIR SUPPLIERS<br clear="none">> + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN<br clear="none">> + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN<br clear="none">> + * CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br clear="none">> + * SOFTWARE.<br clear="none">> + */<br clear="none">> +<br clear="none">> +#include "piglit-util-gl-common.h"<br clear="none">> +<br clear="none">> +static const char *TestMessage1 = "Piglit Message 1";<br clear="none">> +static const char *TestMessage2 = "Piglit Message 2";<br clear="none">> +static const char *TestMessage3 = "Piglit Message 3";<br clear="none">> +static const char *TestMessage4 = "Piglit Message 4";<br clear="none">> +<br clear="none">> +static const int MessageId1 = 101;<br clear="none">> +static const int MessageId2 = 202;<br clear="none">> +static const int MessageId3 = 303;<br clear="none">> +static const int MessageId4 = 404;<br clear="none">> +<br clear="none">> +PIGLIT_GL_TEST_CONFIG_BEGIN<br clear="none">> +<br clear="none">> + config.supports_gl_compat_version = 11;<br clear="none">>
+ config.require_debug_context = true;<br clear="none">> +<br clear="none">> + config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;<br clear="none">> +<br clear="none">> +PIGLIT_GL_TEST_CONFIG_END<br clear="none">> +<br clear="none">> +enum piglit_result<br clear="none">> +piglit_display(void)<br clear="none">> +{<br clear="none">> + return PIGLIT_PASS;<br clear="none">> +}<br clear="none">> +<br clear="none">> +static GLboolean fetch_one_log_message()<br clear="none">> +{<br clear="none">> + char log[4096];<br clear="none">> + GLboolean ret =<br clear="none">> + !!glGetDebugMessageLogARB(1, 4096, NULL, NULL, NULL, NULL, NULL, log);<br clear="none">> +<br clear="none">> + if (ret) {<br clear="none">> +
printf("Log: %s\n", log);<br clear="none">> + }<br clear="none">> + return ret;<br clear="none">> +}<br clear="none">> +<br clear="none">> +static bool check_inheritance_messages(int expectedCount, GLuint* expectedIds)<br clear="none">> +{<br clear="none">> + bool pass = true;<br clear="none">> + int max_messages = 5;<br clear="none">> + int bufSize = 1280;<br clear="none">> + int i;<br clear="none">> + GLuint count;<br clear="none">> + GLenum types[max_messages];<br clear="none">> + GLuint ids[max_messages];<br clear="none">> +<br clear="none">> + GLchar messageLog[bufSize];<br clear="none">> +<br clear="none">> + count = glGetDebugMessageLogARB(max_messages,<br clear="none">>
+ bufSize,<br clear="none">> + NULL,<br clear="none">> + types,<br clear="none">> + ids,<br clear="none">> + NULL,<br clear="none">> + NULL,<br clear="none">> + messageLog);<br clear="none">> +<br clear="none">> + if (count != expectedCount) {<br clear="none">> +
fprintf(stderr, "Expected message count: %i Actual message count: %i\n",<br clear="none">> + expectedCount, count);<br clear="none">> + pass = false;<br clear="none">> + } else {<br clear="none">> + for (i = 0; i < expectedCount; i++) {<br clear="none">> + printf("Type: %x", types[i]);<br clear="none">> + if (expectedIds[i] != ids[i]) {<br clear="none">> + fprintf(stderr, "Expected id: %i Actual id: %i\n",<br clear="none">> + expectedIds[i], ids[i]);<br
clear="none">> + pass = false;<br clear="none">> + }<br clear="none">> + }<br clear="none">> + }<br clear="none">> +<br clear="none">> + return pass;<br clear="none">> +}<br clear="none">> +<br clear="none">> +static void insert_inheritance_messages()<br clear="none">> +{<br clear="none">> + glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId1,<br clear="none">> + GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage1);<br clear="none">> +<br clear="none">> + glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId2,<br clear="none">> +
GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage2);<br clear="none">> +<br clear="none">> + glDebugMessageInsertARB(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId3,<br clear="none">> + GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage3);<br clear="none">> +<br clear="none">> + glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId4,<br clear="none">> + GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage4);<br clear="none">> +}<br clear="none">> +<br clear="none">> +/*<br clear="none">> + * Test inheritance of group filtering (nesting)<br clear="none">> + */<br clear="none">> +static bool test_push_pop_group_inheritance()<br clear="none">> +{<br
clear="none">> + bool pass = true;<br clear="none">> + GLuint allowedIds1[] = {MessageId1};<br clear="none">> + GLuint allowedIds2[] = {MessageId2};<br clear="none">> + GLuint allowedIds3[] = {MessageId3};<br clear="none">> +<br clear="none">> + GLuint expectedIds1[] = {MessageId1};<br clear="none">> + GLuint expectedIds2[] = {MessageId1, MessageId2};<br clear="none">> + GLuint expectedIds3[] = {MessageId1, MessageId2, MessageId3};<br clear="none">> +<br clear="none">> + puts("Testing Push debug group inheritance");<br clear="none">> +<br clear="none">> + /* Setup of the default active debug group: Filter everything out */<br clear="none">> + glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE,<br clear="none">> +
GL_DONT_CARE, 0, NULL, GL_FALSE);<br clear="none">> +<br clear="none">> + /* Push debug group 1 and allow messages with the id 101*/<br clear="none">> + glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 1, 11, "Push_Pop 1");<br clear="none">> + glDebugMessageControlARB(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER,<br clear="none">> + GL_DONT_CARE, 1, allowedIds1, GL_TRUE);<br clear="none">> + insert_inheritance_messages();<br clear="none">> + pass = check_inheritance_messages(1, expectedIds1);<br clear="none">> +<br clear="none">> + /* Push debug group 1 and allow messages with the id 101 and 202*/<br clear="none">> + glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 1,
11, "Push_Pop 2");<br clear="none">> + glDebugMessageControl(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER,<br clear="none">> + GL_DONT_CARE, 1, allowedIds2, GL_TRUE);<br clear="none">> + insert_inheritance_messages();<br clear="none">> + pass = check_inheritance_messages(2, expectedIds2) && pass;<br clear="none">> +<br clear="none">> + /* Push debug group 1 and allow messages with the id 101, 202 and 303*/<br clear="none">> + glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 1, 11, "Push_Pop 3");<br clear="none">> + glDebugMessageControl(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER,<br clear="none">> + GL_DONT_CARE, 1, allowedIds3, GL_TRUE);<br
clear="none">> + insert_inheritance_messages();<br clear="none">> + pass = check_inheritance_messages(3, expectedIds3) && pass;<br clear="none">> +<br clear="none">> + puts("Testing Pop debug group inheritance");<br clear="none">> +<br clear="none">> + /* Pop debug group 3 */<br clear="none">> + glPopDebugGroup();<br clear="none">> + insert_inheritance_messages();<br clear="none">> + pass = check_inheritance_messages(2, expectedIds2) && pass;<br clear="none">> +<br clear="none">> + /* Pop debug group 2 */<br clear="none">> + glPopDebugGroup();<br clear="none">> + insert_inheritance_messages();<br clear="none">> + pass = check_inheritance_messages(1, expectedIds1) && pass;<br clear="none">>
+<br clear="none">> + /* Pop group 1, restore the volume control of the default debug group. */<br clear="none">> + glPopDebugGroup();<br clear="none">> + insert_inheritance_messages();<br clear="none">> +<br clear="none">> + if (fetch_one_log_message()) {<br clear="none">> + fprintf(stderr, "The message log should be empty\n");<br clear="none">> + pass = false;<br clear="none">> + }<br clear="none">> +<br clear="none">> + return pass;<br clear="none">> +}<br clear="none">> +<br clear="none">> +/*<br clear="none">> + * Test Push/Pop Debug Group<br clear="none">> + */<br clear="none">> +static bool test_push_pop_debug_group()<br clear="none">> +{<br clear="none">> + bool pass = true;<br clear="none">>
+ int max_messages = 5;<br clear="none">> + int bufSize = 1280;<br clear="none">> + GLuint count;<br clear="none">> +<br clear="none">> + GLsizei lengths[max_messages];<br clear="none">> + GLchar messageLog[bufSize];<br clear="none">> +<br clear="none">> + puts("Testing Push Pop debug message group");<br clear="none">> +<br clear="none">> + /* Setup of the default active debug group: Filter everything in */<br clear="none">> + glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE,<br clear="none">> + 0, NULL, GL_TRUE);<br clear="none">> +<br clear="none">> + /* Generate a debug marker debug output message */<br clear="none">> +
glDebugMessageInsertARB(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId1,<br clear="none">> + GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage1);<br clear="none">> +<br clear="none">> + /* Push debug group 1 */<br clear="none">> + glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 1, 17, TestMessage2);<br clear="none">> +<br clear="none">> + /* Setup of the debug group 1: Filter everything out */<br clear="none">> + glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE,<br clear="none">> + 0, NULL, GL_FALSE);<br clear="none">> +<br clear="none">> + /* This message shouldn't appear in the debug output log */<br clear="none">> +
glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId1,<br clear="none">> + GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage3);<br clear="none">> +<br clear="none">> + /* Pop group 1, restore the volume control of the default debug group. */<br clear="none">> + glPopDebugGroup();<br clear="none">> +<br clear="none">> + /* Generate a debug marker debug output message */<br clear="none">> + glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, MessageId1,<br clear="none">> + GL_DEBUG_SEVERITY_NOTIFICATION, -1, TestMessage4);<br clear="none">> +<br clear="none">> + /* Check that message log has done correct filtering */<br clear="none">>
+ count = glGetDebugMessageLog(max_messages,<br clear="none">> + bufSize,<br clear="none">> + NULL,<br clear="none">> + NULL,<br clear="none">> + NULL,<br clear="none">> + NULL,<br clear="none">> + lengths,<br clear="none">> + messageLog);<br clear="none">> +<br clear="none">>
+ if (count != 4) {<br clear="none">> + fprintf(stderr, "The message log should contain 4 messages not %i messages\n", count);<br clear="none">> + pass = false;<br clear="none">> + int nextMessage = lengths[0];<br clear="none">> + if (strcmp(TestMessage2, messageLog+nextMessage) != 0) {<br clear="none">> + fprintf(stderr, "Expected: %s Message: %s\n", TestMessage2, messageLog+nextMessage);<br clear="none">> + pass = false;<br clear="none">> + }<br clear="none">> + }<br clear="none">> +<br clear="none">> + if (pass) {<br clear="none">> + int
i;<br clear="none">> +<br clear="none">> + /* the thrid message should be TestMessage2 from glPopDebugGroup() */<br clear="none">> + int nextMessage = lengths[0] + lengths[1];<br clear="none">> + if (strcmp(TestMessage2, messageLog+nextMessage) != 0) {<br clear="none">> + fprintf(stderr, "Expected: %s Message: %s\n", TestMessage2, messageLog+nextMessage);<br clear="none">> + pass = false;<br clear="none">> + }<br clear="none">> +<br clear="none">> + /* double check that TestMessage3 didnt sneak into the list */<br clear="none">> + nextMessage = 0;<br clear="none">> +
for (i = 0; i < count; i++) {<br clear="none">> + if (strcmp(TestMessage3, messageLog+nextMessage) == 0) {<br clear="none">> + fprintf(stderr, "The log should not contain the message: %s",<br clear="none">> + messageLog+nextMessage);<br clear="none">> + pass = false;<br clear="none">> + }<br clear="none">> + nextMessage += lengths[i];<br clear="none">> + }<br clear="none">> +<br clear="none">> + /* the forth message should be
TestMessage4 */<br clear="none">> + nextMessage = lengths[0] + lengths[1] + lengths[3];<br clear="none">> + if (strcmp(TestMessage4, messageLog+nextMessage) != 0) {<br clear="none">> + fprintf(stderr, "Expected: %s Message: %s\n", TestMessage4, messageLog+nextMessage);<br clear="none">> + pass = false;<br clear="none">> + }<br clear="none">> + }<br clear="none">> +<br clear="none">> + return pass;<br clear="none">> +}<br clear="none">> +<br clear="none">> +void piglit_init(int argc, char **argv)<br clear="none">> +{<br clear="none">> + bool pass = true;<br clear="none">> +<br clear="none">> +
piglit_require_extension("GL_KHR_debug");<br clear="none">> +<br clear="none">> + glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);<br clear="none">> + glEnable(GL_DEBUG_OUTPUT);<br clear="none">> +<br clear="none">> + if (!piglit_check_gl_error(GL_NO_ERROR))<br clear="none">> + piglit_report_result(PIGLIT_FAIL);<br clear="none">> +<br clear="none">> + /* test message control and debug groups */<br clear="none">> + pass = test_push_pop_debug_group();<br clear="none">> + pass = test_push_pop_group_inheritance() && pass;<br clear="none">> +<br clear="none">> + piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);<br clear="none">> +}<br clear="none">><br clear="none"></div><br><br></div> </div> </div> </div> </div></body></html>