mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
zink: add zink_context::unordered_blitting to preserve unordered flags
not currently used but will be used to wrap u_blitter Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
This commit is contained in:
parent
887f72990e
commit
4593f335f6
4 changed files with 24 additions and 9 deletions
|
|
@ -1465,7 +1465,8 @@ zink_set_constant_buffer(struct pipe_context *pctx,
|
|||
zink_screen(ctx->base.screen)->buffer_barrier(ctx, new_res, VK_ACCESS_UNIFORM_READ_BIT,
|
||||
new_res->gfx_barrier);
|
||||
zink_batch_resource_usage_set(&ctx->batch, new_res, false, true);
|
||||
new_res->obj->unordered_read = false;
|
||||
if (!ctx->unordered_blitting)
|
||||
new_res->obj->unordered_read = false;
|
||||
}
|
||||
update |= ctx->ubos[shader][index].buffer_offset != offset ||
|
||||
!!res != !!buffer || (res && res->obj->buffer != new_res->obj->buffer) ||
|
||||
|
|
@ -1553,6 +1554,7 @@ zink_set_shader_buffers(struct pipe_context *pctx,
|
|||
|
||||
unsigned modified_bits = u_bit_consecutive(start_slot, count);
|
||||
unsigned old_writable_mask = ctx->writable_ssbos[p_stage];
|
||||
assert(!ctx->unordered_blitting);
|
||||
ctx->writable_ssbos[p_stage] &= ~modified_bits;
|
||||
ctx->writable_ssbos[p_stage] |= writable_bitmask << start_slot;
|
||||
|
||||
|
|
@ -1780,6 +1782,7 @@ zink_set_shader_images(struct pipe_context *pctx,
|
|||
struct zink_screen *screen = zink_screen(pctx->screen);
|
||||
bool update = false;
|
||||
bool is_compute = shader_type == MESA_SHADER_COMPUTE;
|
||||
assert(!ctx->unordered_blitting);
|
||||
for (unsigned i = 0; i < count; i++) {
|
||||
struct zink_image_view *a = &ctx->image_views[shader_type][start_slot + i];
|
||||
const struct pipe_image_view *b = images ? &images[i] : NULL;
|
||||
|
|
@ -2033,7 +2036,8 @@ zink_set_sampler_views(struct pipe_context *pctx,
|
|||
}
|
||||
}
|
||||
res->sampler_binds[shader_type] |= BITFIELD_BIT(start_slot + i);
|
||||
res->obj->unordered_read = false;
|
||||
if (!ctx->unordered_blitting)
|
||||
res->obj->unordered_read = false;
|
||||
} else if (a) {
|
||||
unbind_samplerview(ctx, shader_type, start_slot + i);
|
||||
update = true;
|
||||
|
|
@ -3735,11 +3739,12 @@ zink_get_cmdbuf(struct zink_context *ctx, struct zink_resource *src, struct zink
|
|||
src->obj->unordered_read = unordered_exec;
|
||||
if (dst)
|
||||
dst->obj->unordered_write = unordered_exec;
|
||||
if (!unordered_exec || ctx->unordered_blitting)
|
||||
zink_batch_no_rp(ctx);
|
||||
if (unordered_exec) {
|
||||
ctx->batch.state->has_barriers = true;
|
||||
return ctx->batch.state->barrier_cmdbuf;
|
||||
}
|
||||
zink_batch_no_rp(ctx);
|
||||
return ctx->batch.state->cmdbuf;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ zink_emit_xfb_counter_barrier(struct zink_context *ctx)
|
|||
stage |= VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT;
|
||||
}
|
||||
zink_screen(ctx->base.screen)->buffer_barrier(ctx, res, access, stage);
|
||||
res->obj->unordered_read = false;
|
||||
if (!ctx->unordered_blitting)
|
||||
res->obj->unordered_read = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +89,8 @@ check_buffer_barrier(struct zink_context *ctx, struct pipe_resource *pres, VkAcc
|
|||
{
|
||||
struct zink_resource *res = zink_resource(pres);
|
||||
zink_screen(ctx->base.screen)->buffer_barrier(ctx, res, flags, pipeline);
|
||||
res->obj->unordered_read = false;
|
||||
if (!ctx->unordered_blitting)
|
||||
res->obj->unordered_read = false;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE static void
|
||||
|
|
@ -415,7 +417,8 @@ zink_draw(struct pipe_context *pctx,
|
|||
struct zink_resource *res = zink_resource(t->base.buffer);
|
||||
zink_screen(ctx->base.screen)->buffer_barrier(ctx, res,
|
||||
VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT, VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT);
|
||||
res->obj->unordered_read = res->obj->unordered_write = false;
|
||||
if (!ctx->unordered_blitting)
|
||||
res->obj->unordered_read = res->obj->unordered_write = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -434,7 +437,8 @@ zink_draw(struct pipe_context *pctx,
|
|||
zink_screen(ctx->base.screen)->buffer_barrier(ctx, res,
|
||||
VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT,
|
||||
VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT);
|
||||
res->obj->unordered_read = false;
|
||||
if (!ctx->unordered_blitting)
|
||||
res->obj->unordered_read = false;
|
||||
}
|
||||
|
||||
zink_query_update_gs_states(ctx);
|
||||
|
|
@ -806,7 +810,8 @@ zink_draw(struct pipe_context *pctx,
|
|||
struct zink_resource *res = zink_resource(t->counter_buffer);
|
||||
t->stride = ctx->last_vertex_stage->sinfo.so_info.stride[i] * sizeof(uint32_t);
|
||||
zink_batch_reference_resource_rw(batch, res, true);
|
||||
res->obj->unordered_read = res->obj->unordered_write = false;
|
||||
if (!ctx->unordered_blitting)
|
||||
res->obj->unordered_read = res->obj->unordered_write = false;
|
||||
if (t->counter_buffer_valid) {
|
||||
counter_buffers[i] = res->obj->buffer;
|
||||
counter_buffer_offsets[i] = t->counter_buffer_offset;
|
||||
|
|
@ -946,7 +951,8 @@ zink_draw_vertex_state(struct pipe_context *pctx,
|
|||
struct zink_resource *res = zink_resource(vstate->input.vbuffer.buffer.resource);
|
||||
zink_screen(ctx->base.screen)->buffer_barrier(ctx, res, VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT,
|
||||
VK_PIPELINE_STAGE_VERTEX_INPUT_BIT);
|
||||
res->obj->unordered_read = false;
|
||||
if (!ctx->unordered_blitting)
|
||||
res->obj->unordered_read = false;
|
||||
struct zink_vertex_elements_hw_state *hw_state = ctx->gfx_pipeline_state.element_state;
|
||||
ctx->gfx_pipeline_state.element_state = &((struct zink_vertex_state*)vstate)->velems.hw_state;
|
||||
|
||||
|
|
|
|||
|
|
@ -1237,6 +1237,9 @@ static void
|
|||
zink_set_active_query_state(struct pipe_context *pctx, bool enable)
|
||||
{
|
||||
struct zink_context *ctx = zink_context(pctx);
|
||||
/* unordered blits already disable queries */
|
||||
if (ctx->unordered_blitting)
|
||||
return;
|
||||
ctx->queries_disabled = !enable;
|
||||
|
||||
struct zink_batch *batch = &ctx->batch;
|
||||
|
|
|
|||
|
|
@ -1842,6 +1842,7 @@ struct zink_context {
|
|||
bool is_device_lost;
|
||||
bool primitive_restart;
|
||||
bool blitting : 1;
|
||||
bool unordered_blitting : 1;
|
||||
bool vertex_state_changed : 1;
|
||||
bool blend_state_changed : 1;
|
||||
bool sample_mask_changed : 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue