[Piglit] [PATCH v4] GL3.2 GL_ARB_sync: Test for valid return values from ClientWaitSync
Eric Anholt
eric at anholt.net
Mon Oct 28 22:32:57 CET 2013
Chad Versace <chad.versace at linux.intel.com> writes:
> On 10/21/2013 02:11 PM, Nicholas Mack wrote:
>> v2: Fix comments, initialize variables. Still need to figure out if GPU commands
>> needed before testing these.
>>
>> v3: Rewrite test cases, fix comment and config block and add to all.tests
>>
>> v4: Make test work with POSIX_CLOCKS and some other minor changes
>> ---
>> tests/all.tests | 1 +
>> tests/spec/arb_sync/CMakeLists.gl.txt | 1 +
>> tests/spec/arb_sync/ClientWaitSync-returns.c | 183 +++++++++++++++++++++++++++
>> 3 files changed, 185 insertions(+)
>> create mode 100644 tests/spec/arb_sync/ClientWaitSync-returns.c
>
>
> Ken, Eric, Ian, I want your opinion on this GL_ARB_sync testcase.
>
> It sets up a simple draw call, does *not* call glFlush, inserts a fence
> with a one second timeout, waits for the fence to signal, then verifies
> that the elapsed time is approximately the timeout value.
>
> The testcase's intent is to verify that fence's correctly timeout.
>
> Of course, i965 fails this test because have a stupid implementation of
> glClientWaitSync. For glClientWaitSync, i965 flushes, waits for the batch to complete,
> then returns.
>
> Test case #1 below currently reports PIGLIT_FAIL on i965.
> i965 conforms to a strict interpretation of the GL_ARB_sync, but I don't
> want to the test to simply pass. It really feels like i965 is cheating, so
> I want the test to report PIGLIT_WARN.
>
> What's your opinion?
>
>
>> + /* Test Case 1: Verify that fence times out correctly after set time */
>> +
>> + /* queue a draw command */
>> + piglit_draw_rect(-1, -1, 2, 2);
>> +
>> + /* create fence sync */
>> + fence1 = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
>> +
>> + /* get initial time */
>> + start = piglit_get_microseconds();
>> + if (start == -1) piglit_report_result(PIGLIT_SKIP);
>> +
>> + /* check fence status */
>> + status1 = glClientWaitSync(fence1, GL_SYNC_FLUSH_COMMANDS_BIT,
>> + ONE_SECOND);
>> +
>> + /* draw call should not be complete since glFlush() wasn't called */
>> + if (status1 != GL_TIMEOUT_EXPIRED) {
>> + printf("Expected: status1 == GL_TIMEOUT_EXPIRED\n"
>> + "Actual: status1 == %s\n",
>> + piglit_get_gl_enum_name(status1));
>> + pass = false;
>> + }
The ClientWaitSync() up there explicitly asked for the batch to get
flushed (GL_SYNC_FLUSH_COMMANDS_BIT), so the "since glFlush() wasn't
called" bit is wrong. I also disagree in general with tests that assert
that batchbuffers haven't been flushed -- that's a driver detail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20131028/7d66f911/attachment.pgp>
More information about the Piglit
mailing list