From ac8c795429f9552c9bb626d0adee46786d3c810a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 9 Jul 2019 01:20:44 +0200 Subject: GPU: added debug value to investigate lagging issue in T6147 --- source/blender/gpu/intern/gpu_select_sample_query.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/blender/gpu/intern') diff --git a/source/blender/gpu/intern/gpu_select_sample_query.c b/source/blender/gpu/intern/gpu_select_sample_query.c index 56f9ef69221..9dc225b4190 100644 --- a/source/blender/gpu/intern/gpu_select_sample_query.c +++ b/source/blender/gpu/intern/gpu_select_sample_query.c @@ -40,6 +40,8 @@ #include "PIL_time.h" +#include "BKE_global.h" + #include "gpu_select_private.h" /* Ad hoc number of queries to allocate to skip doing many glGenQueries */ @@ -177,9 +179,11 @@ uint gpu_select_query_end(void) while (result == 0) { glGetQueryObjectuiv(g_query_state.queries[i], GL_QUERY_RESULT_AVAILABLE, &result); if (result == 0) { - /* (fclem) Not sure if this is better than calling - * glGetQueryObjectuiv() indefinitely. */ - PIL_sleep_ms(1); + /* (fclem) Not sure if this is better than calling glGetQueryObjectuiv() indefinitely. + * (brecht) Added debug test for lagging issue in T61474. */ + if (G.debug_value != 474) { + PIL_sleep_ms(1); + } } } glGetQueryObjectuiv(g_query_state.queries[i], GL_QUERY_RESULT, &result); -- cgit v1.2.3