mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-24 12:30:19 +01:00
zink: fixup boolean queries
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
69189417ae
commit
e084211c08
1 changed files with 21 additions and 4 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "util/u_dump.h"
|
||||
|
||||
struct zink_query {
|
||||
enum pipe_query_type type;
|
||||
VkQueryPool queryPool;
|
||||
VkQueryType vkqtype;
|
||||
bool use_64bit;
|
||||
|
|
@ -47,6 +48,7 @@ zink_create_query(struct pipe_context *pctx,
|
|||
if (!query)
|
||||
return NULL;
|
||||
|
||||
query->type = query_type;
|
||||
query->vkqtype = convert_query_type(query_type, &query->use_64bit, &query->precise);
|
||||
if (query->vkqtype == -1)
|
||||
return NULL;
|
||||
|
|
@ -127,10 +129,25 @@ zink_get_query_result(struct pipe_context *pctx,
|
|||
if (query->use_64bit)
|
||||
flags |= VK_QUERY_RESULT_64_BIT;
|
||||
|
||||
VkResult status = vkGetQueryPoolResults(screen->dev, query->queryPool,
|
||||
0, 1, sizeof(*result), result,
|
||||
0, flags);
|
||||
return status == VK_SUCCESS;
|
||||
if (vkGetQueryPoolResults(screen->dev, query->queryPool,
|
||||
0, 1, sizeof(*result), result,
|
||||
0, flags) != VK_SUCCESS)
|
||||
return false;
|
||||
|
||||
switch (query->type) {
|
||||
case PIPE_QUERY_OCCLUSION_PREDICATE:
|
||||
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
|
||||
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
|
||||
case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
|
||||
case PIPE_QUERY_GPU_FINISHED:
|
||||
/* fixup bool-queries */
|
||||
result->b = result->u32 != 0;
|
||||
break;
|
||||
default:
|
||||
; /* nothing */
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue