From: Henri Verbeet Subject: Re: [PATCH] wined3d: Use query buffer objects for occlusion queries. Message-Id: Date: Thu, 6 Sep 2018 16:46:17 +0200 In-Reply-To: <1535933403-23092-1-git-send-email-awesie@gmail.com> References: <1535933403-23092-1-git-send-email-awesie@gmail.com> On 3 September 2018 at 04:40, Andrew Wesie wrote: > +#define INVALID_QUERY_RESULT ((UINT64)-1) While at least for occlusion queries this would be a very unlikely result, it's not in general an invalid query result. I think ideally we'd write QUERY_RESULT_AVAILABLE to the buffer object as well, but based on the language in the extension spec, I don't see the requirement that that should flush lifted. On the other hand, based on a quick look at the Mesa source, it's not obvious to me that it actually does flush. Perhaps this is ok in practice, and just an oversight in the spec language. Something else that's not entirely clear from the extension spec is when glGetQueryObjectui64v(..., QUERY_RESULT,...) should return. I think in practice it will return immediately, but based on the spec language, perhaps an argument could be made that it should wait until the data is in the buffer object, especially when that has been mapped with MAP_COHERENT_BIT.