mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 21:30:09 +01:00
asahi: Only touch batch->occlusion_queries for occlusion
We will soon have other types of queries with non-null writers. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
This commit is contained in:
parent
dfde9345d7
commit
a13f233219
1 changed files with 14 additions and 1 deletions
|
|
@ -18,6 +18,19 @@ agx_create_query(struct pipe_context *ctx, unsigned query_type, unsigned index)
|
|||
return (struct pipe_query *)query;
|
||||
}
|
||||
|
||||
static bool
|
||||
is_occlusion(struct agx_query *query)
|
||||
{
|
||||
switch (query->type) {
|
||||
case PIPE_QUERY_OCCLUSION_COUNTER:
|
||||
case PIPE_QUERY_OCCLUSION_PREDICATE:
|
||||
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
agx_destroy_query(struct pipe_context *ctx, struct pipe_query *pquery)
|
||||
{
|
||||
|
|
@ -27,7 +40,7 @@ agx_destroy_query(struct pipe_context *ctx, struct pipe_query *pquery)
|
|||
* particularly during application teardown. In this case, don't leave a
|
||||
* dangling reference to the query.
|
||||
*/
|
||||
if (query->writer) {
|
||||
if (query->writer && is_occlusion(query)) {
|
||||
*util_dynarray_element(&query->writer->occlusion_queries,
|
||||
struct agx_query *, query->writer_index) = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue