needs_border |= fd6_emit_textures(ctx->pipe, stateobj, type, tex,
bcolor_offset, v, ctx);
- fd6_emit_add_group(emit, stateobj, s[type].state_id,
+ fd6_emit_take_group(emit, stateobj, s[type].state_id,
s[type].enable_mask);
-
- fd_ringbuffer_del(stateobj);
}
}
struct fd_ringbuffer *state;
state = build_vbo_state(emit, emit->vs);
- fd6_emit_add_group(emit, state, FD6_GROUP_VBO, 0x6);
- fd_ringbuffer_del(state);
+ fd6_emit_take_group(emit, state, FD6_GROUP_VBO, 0x6);
state = build_vbo_state(emit, emit->bs);
- fd6_emit_add_group(emit, state, FD6_GROUP_VBO_BINNING, 0x1);
- fd_ringbuffer_del(state);
+ fd6_emit_take_group(emit, state, FD6_GROUP_VBO_BINNING, 0x1);
}
if (dirty & FD_DIRTY_ZSA) {
struct fd_ringbuffer *state;
state = build_lrz(emit, false);
- fd6_emit_add_group(emit, state, FD6_GROUP_LRZ, 0x6);
- fd_ringbuffer_del(state);
+ fd6_emit_take_group(emit, state, FD6_GROUP_LRZ, 0x6);
state = build_lrz(emit, true);
- fd6_emit_add_group(emit, state, FD6_GROUP_LRZ_BINNING, 0x1);
- fd_ringbuffer_del(state);
+ fd6_emit_take_group(emit, state, FD6_GROUP_LRZ_BINNING, 0x1);
}
if (dirty & FD_DIRTY_STENCIL_REF) {
if (ir3_needs_vs_driver_params(vp))
ir3_emit_vs_driver_params(vp, vsconstobj, ctx, emit->info);
- fd6_emit_add_group(emit, vsconstobj, FD6_GROUP_VS_CONST, 0x7);
- fd_ringbuffer_del(vsconstobj);
+ fd6_emit_take_group(emit, vsconstobj, FD6_GROUP_VS_CONST, 0x7);
}
if (ctx->dirty_shader[PIPE_SHADER_FRAGMENT] & DIRTY_CONST) {
ir3_emit_image_dims(ctx->screen, fp, fsconstobj,
&ctx->shaderimg[PIPE_SHADER_FRAGMENT]);
- fd6_emit_add_group(emit, fsconstobj, FD6_GROUP_FS_CONST, 0x6);
- fd_ringbuffer_del(fsconstobj);
+ fd6_emit_take_group(emit, fsconstobj, FD6_GROUP_FS_CONST, 0x6);
}
struct ir3_stream_output_info *info = &vp->shader->stream_output;
OUT_PKT4(obj, REG_A6XX_SP_IBO_COUNT, 1);
OUT_RING(obj, mapping->num_ibo);
- fd6_emit_add_group(emit, obj, FD6_GROUP_IBO, 0x6);
- fd_ringbuffer_del(obj);
+ fd6_emit_take_group(emit, obj, FD6_GROUP_IBO, 0x6);
fd_ringbuffer_del(state);
}
}
static inline void
-fd6_emit_add_group(struct fd6_emit *emit, struct fd_ringbuffer *stateobj,
+fd6_emit_take_group(struct fd6_emit *emit, struct fd_ringbuffer *stateobj,
enum fd6_state_id group_id, unsigned enable_mask)
{
debug_assert(emit->num_groups < ARRAY_SIZE(emit->groups));
struct fd6_state_group *g = &emit->groups[emit->num_groups++];
- g->stateobj = fd_ringbuffer_ref(stateobj);
+ g->stateobj = stateobj;
g->group_id = group_id;
g->enable_mask = enable_mask;
}
+static inline void
+fd6_emit_add_group(struct fd6_emit *emit, struct fd_ringbuffer *stateobj,
+ enum fd6_state_id group_id, unsigned enable_mask)
+{
+ fd6_emit_take_group(emit, fd_ringbuffer_ref(stateobj), group_id, enable_mask);
+}
+
static inline unsigned
fd6_event_write(struct fd_batch *batch, struct fd_ringbuffer *ring,
enum vgt_event_type evt, bool timestamp)