mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
radeon: use radeon_bo_is_referenced_by_cs for query objects
This commit is contained in:
parent
d3fa67c9b8
commit
aa19561158
4 changed files with 3 additions and 23 deletions
|
|
@ -1147,9 +1147,6 @@ void radeonFlush(GLcontext *ctx)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
make_empty_list(&radeon->query.not_flushed_head);
|
||||
|
||||
}
|
||||
|
||||
/* Make sure all commands have been sent to the hardware and have
|
||||
|
|
|
|||
|
|
@ -265,7 +265,6 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
|
|||
radeon->texture_compressed_row_align = 64;
|
||||
}
|
||||
|
||||
make_empty_list(&radeon->query.not_flushed_head);
|
||||
radeon_init_dma(radeon);
|
||||
|
||||
return GL_TRUE;
|
||||
|
|
|
|||
|
|
@ -502,7 +502,6 @@ struct radeon_context {
|
|||
|
||||
struct {
|
||||
struct radeon_query_object *current;
|
||||
struct radeon_query_object not_flushed_head;
|
||||
struct radeon_state_atom queryobj;
|
||||
} query;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,20 +31,6 @@
|
|||
#include "main/imports.h"
|
||||
#include "main/simple_list.h"
|
||||
|
||||
static int radeonQueryIsFlushed(GLcontext *ctx, struct gl_query_object *q)
|
||||
{
|
||||
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
|
||||
struct radeon_query_object *tmp, *query = (struct radeon_query_object *)q;
|
||||
|
||||
foreach(tmp, &radeon->query.not_flushed_head) {
|
||||
if (tmp == query) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q)
|
||||
{
|
||||
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
|
||||
|
|
@ -120,10 +106,11 @@ static void radeonDeleteQuery(GLcontext *ctx, struct gl_query_object *q)
|
|||
|
||||
static void radeonWaitQuery(GLcontext *ctx, struct gl_query_object *q)
|
||||
{
|
||||
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
|
||||
struct radeon_query_object *query = (struct radeon_query_object *)q;
|
||||
|
||||
/* If the cmdbuf with packets for this query hasn't been flushed yet, do it now */
|
||||
if (!radeonQueryIsFlushed(ctx, q))
|
||||
if (radeon_bo_is_referenced_by_cs(query->bo, radeon->cmdbuf.cs))
|
||||
ctx->Driver.Flush(ctx);
|
||||
|
||||
radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s: query id %d, bo %p, offset %d\n", __FUNCTION__, q->Id, query->bo, query->curr_offset);
|
||||
|
|
@ -155,8 +142,6 @@ static void radeonBeginQuery(GLcontext *ctx, struct gl_query_object *q)
|
|||
|
||||
radeon->query.queryobj.dirty = GL_TRUE;
|
||||
radeon->hw.is_dirty = GL_TRUE;
|
||||
insert_at_tail(&radeon->query.not_flushed_head, query);
|
||||
|
||||
}
|
||||
|
||||
void radeonEmitQueryEnd(GLcontext *ctx)
|
||||
|
|
@ -204,7 +189,7 @@ static void radeonCheckQuery(GLcontext *ctx, struct gl_query_object *q)
|
|||
uint32_t domain;
|
||||
|
||||
/* Need to perform a flush, as per ARB_occlusion_query spec */
|
||||
if (!radeonQueryIsFlushed(ctx, q)) {
|
||||
if (radeon_bo_is_referenced_by_cs(query->bo, radeon->cmdbuf.cs)) {
|
||||
ctx->Driver.Flush(ctx);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue