zink: make batch_usage_set take a batch state param
no functional changes Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11399>
This commit is contained in:
parent
a96c6e4589
commit
6e0f552fd2
|
@ -567,13 +567,13 @@ zink_batch_reference_resource_rw(struct zink_batch *batch, struct zink_resource
|
||||||
}
|
}
|
||||||
if (write) {
|
if (write) {
|
||||||
if (stencil)
|
if (stencil)
|
||||||
zink_batch_usage_set(&stencil->obj->writes, batch->state->fence.batch_id);
|
zink_batch_usage_set(&stencil->obj->writes, batch->state);
|
||||||
zink_batch_usage_set(&res->obj->writes, batch->state->fence.batch_id);
|
zink_batch_usage_set(&res->obj->writes, batch->state);
|
||||||
res->scanout_dirty = !!res->scanout_obj;
|
res->scanout_dirty = !!res->scanout_obj;
|
||||||
} else {
|
} else {
|
||||||
if (stencil)
|
if (stencil)
|
||||||
zink_batch_usage_set(&stencil->obj->reads, batch->state->fence.batch_id);
|
zink_batch_usage_set(&stencil->obj->reads, batch->state);
|
||||||
zink_batch_usage_set(&res->obj->reads, batch->state->fence.batch_id);
|
zink_batch_usage_set(&res->obj->reads, batch->state);
|
||||||
}
|
}
|
||||||
/* multiple array entries are fine */
|
/* multiple array entries are fine */
|
||||||
if (res->obj->persistent_maps)
|
if (res->obj->persistent_maps)
|
||||||
|
@ -590,7 +590,7 @@ batch_ptr_add_usage(struct zink_batch *batch, struct set *s, void *ptr, struct z
|
||||||
return false;
|
return false;
|
||||||
_mesa_set_search_and_add(s, ptr, &found);
|
_mesa_set_search_and_add(s, ptr, &found);
|
||||||
assert(!found);
|
assert(!found);
|
||||||
zink_batch_usage_set(u, batch->state->fence.batch_id);
|
zink_batch_usage_set(u, batch->state);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,9 +181,9 @@ zink_batch_usage_unset(struct zink_batch_usage *u, struct zink_batch_state *bs)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
zink_batch_usage_set(struct zink_batch_usage *u, uint32_t batch_id)
|
zink_batch_usage_set(struct zink_batch_usage *u, struct zink_batch_state *bs)
|
||||||
{
|
{
|
||||||
u->usage = batch_id;
|
u->usage = bs->fence.batch_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
|
|
|
@ -539,7 +539,7 @@ zink_bind_sampler_states(struct pipe_context *pctx,
|
||||||
ctx->sampler_states[shader][start_slot + i] = state;
|
ctx->sampler_states[shader][start_slot + i] = state;
|
||||||
ctx->di.textures[shader][start_slot + i].sampler = state ? state->sampler : VK_NULL_HANDLE;
|
ctx->di.textures[shader][start_slot + i].sampler = state ? state->sampler : VK_NULL_HANDLE;
|
||||||
if (state)
|
if (state)
|
||||||
zink_batch_usage_set(&state->batch_uses, ctx->curr_batch);
|
zink_batch_usage_set(&state->batch_uses, ctx->batch.state);
|
||||||
}
|
}
|
||||||
ctx->di.num_samplers[shader] = start_slot + num_samplers;
|
ctx->di.num_samplers[shader] = start_slot + num_samplers;
|
||||||
}
|
}
|
||||||
|
@ -1741,7 +1741,7 @@ update_resource_refs_for_stage(struct zink_context *ctx, enum pipe_shader_type s
|
||||||
struct zink_sampler_state *sampler_state = ctx->sampler_states[stage][j];
|
struct zink_sampler_state *sampler_state = ctx->sampler_states[stage][j];
|
||||||
struct zink_image_view *iv = &ctx->image_views[stage][j];
|
struct zink_image_view *iv = &ctx->image_views[stage][j];
|
||||||
if (sampler_state && i == ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW && j <= ctx->di.num_samplers[stage])
|
if (sampler_state && i == ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW && j <= ctx->di.num_samplers[stage])
|
||||||
zink_batch_usage_set(&sampler_state->batch_uses, ctx->curr_batch);
|
zink_batch_usage_set(&sampler_state->batch_uses, ctx->batch.state);
|
||||||
if (sv && i == ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW && j <= ctx->di.num_sampler_views[stage])
|
if (sv && i == ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW && j <= ctx->di.num_sampler_views[stage])
|
||||||
zink_batch_reference_sampler_view(batch, sv);
|
zink_batch_reference_sampler_view(batch, sv);
|
||||||
else if (i == ZINK_DESCRIPTOR_TYPE_IMAGE && j <= ctx->di.num_images[stage])
|
else if (i == ZINK_DESCRIPTOR_TYPE_IMAGE && j <= ctx->di.num_images[stage])
|
||||||
|
|
|
@ -684,7 +684,7 @@ begin_query(struct zink_context *ctx, struct zink_batch *batch, struct zink_quer
|
||||||
if (needs_stats_list(q))
|
if (needs_stats_list(q))
|
||||||
list_addtail(&q->stats_list, &ctx->primitives_generated_queries);
|
list_addtail(&q->stats_list, &ctx->primitives_generated_queries);
|
||||||
p_atomic_inc(&q->fences);
|
p_atomic_inc(&q->fences);
|
||||||
zink_batch_usage_set(&q->batch_id, batch->state->fence.batch_id);
|
zink_batch_usage_set(&q->batch_id, batch->state);
|
||||||
_mesa_set_add(batch->state->active_queries, q);
|
_mesa_set_add(batch->state->active_queries, q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -718,7 +718,7 @@ end_query(struct zink_context *ctx, struct zink_batch *batch, struct zink_query
|
||||||
reset_pool(ctx, batch, q);
|
reset_pool(ctx, batch, q);
|
||||||
vkCmdWriteTimestamp(batch->state->cmdbuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
|
vkCmdWriteTimestamp(batch->state->cmdbuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
|
||||||
q->query_pool, q->curr_query);
|
q->query_pool, q->curr_query);
|
||||||
zink_batch_usage_set(&q->batch_id, batch->state->fence.batch_id);
|
zink_batch_usage_set(&q->batch_id, batch->state);
|
||||||
} else if (q->type == PIPE_QUERY_PRIMITIVES_EMITTED ||
|
} else if (q->type == PIPE_QUERY_PRIMITIVES_EMITTED ||
|
||||||
q->type == PIPE_QUERY_PRIMITIVES_GENERATED ||
|
q->type == PIPE_QUERY_PRIMITIVES_GENERATED ||
|
||||||
q->type == PIPE_QUERY_SO_OVERFLOW_PREDICATE) {
|
q->type == PIPE_QUERY_SO_OVERFLOW_PREDICATE) {
|
||||||
|
|
Loading…
Reference in New Issue