From 28a1bc82ec7183357e359fede42c500bb3d6b8e8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 7 Oct 2016 08:39:36 +0100 Subject: [PATCH] arb_query_buffer_object: have_cpu_result is only accurate for 64bit reads when reading a 64bit value through glGetQueryObjectiv() or glGetQueryObjectuiv() the result is truncated. This means that we can not use the result as an accurate value unless the full glGetQueryObjectui64v() is used - i.e. have_cpu_result should only be true when using GL_UNSIGNED_INT64_ARB datatypes. This is partciularly noticeable when reading the GL_TIMESTAMP. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98139 --- tests/spec/arb_query_buffer_object/qbo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/spec/arb_query_buffer_object/qbo.c b/tests/spec/arb_query_buffer_object/qbo.c index 44c2482..6fe319b 100644 --- a/tests/spec/arb_query_buffer_object/qbo.c +++ b/tests/spec/arb_query_buffer_object/qbo.c @@ -220,7 +220,7 @@ run_subtest(void) if (sync_mode == QBO_ASYNC_CPU_READ_BEFORE) { if (cpu_gather_query(exact, expected, &cpu_result)) return PIGLIT_FAIL; - have_cpu_result = true; + have_cpu_result = result_type == GL_UNSIGNED_INT64_ARB; } glBindBuffer(GL_QUERY_BUFFER, qbo); @@ -256,7 +256,7 @@ run_subtest(void) sync_mode == QBO_ASYNC_CPU_READ_AFTER) { if (cpu_gather_query(exact, expected, &cpu_result)) return PIGLIT_FAIL; - have_cpu_result = true; + have_cpu_result = result_type == GL_UNSIGNED_INT64_ARB; } /* Make it available to shader as uniform buffer 0 */ -- 1.9.1