static inline void
gen6_3DPRIMITIVE(struct ilo_builder *builder,
const struct pipe_draw_info *info,
- const struct ilo_ib_state *ib)
+ int64_t start_offset)
{
const uint8_t cmd_len = 6;
const int prim = gen6_3d_translate_pipe_prim(info->mode);
const int vb_access = (info->indexed) ?
GEN6_3DPRIM_DW0_ACCESS_RANDOM : GEN6_3DPRIM_DW0_ACCESS_SEQUENTIAL;
- const uint32_t vb_start = info->start +
- ((info->indexed) ? ib->draw_start_offset : 0);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
prim << GEN6_3DPRIM_DW0_TYPE__SHIFT |
(cmd_len - 2);
dw[1] = info->count;
- dw[2] = vb_start;
+ dw[2] = info->start + start_offset;
dw[3] = info->instance_count;
dw[4] = info->start_instance;
dw[5] = info->index_bias;
static inline void
gen7_3DPRIMITIVE(struct ilo_builder *builder,
const struct pipe_draw_info *info,
- const struct ilo_ib_state *ib)
+ int64_t start_offset)
{
const uint8_t cmd_len = 7;
const int prim = gen6_3d_translate_pipe_prim(info->mode);
const int vb_access = (info->indexed) ?
GEN7_3DPRIM_DW1_ACCESS_RANDOM : GEN7_3DPRIM_DW1_ACCESS_SEQUENTIAL;
- const uint32_t vb_start = info->start +
- ((info->indexed) ? ib->draw_start_offset : 0);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 7, 8);
dw[0] = GEN6_RENDER_CMD(3D, 3DPRIMITIVE) | (cmd_len - 2);
dw[1] = vb_access | prim;
dw[2] = info->count;
- dw[3] = vb_start;
+ dw[3] = info->start + start_offset;
dw[4] = info->instance_count;
dw[5] = info->start_instance;
dw[6] = info->index_bias;
const struct pipe_draw_info *info,
const struct ilo_ib_state *ib)
{
+ const int64_t start_offset = (info->indexed) ? ib->draw_start_offset : 0;
+
ILO_DEV_ASSERT(r->dev, 6, 8);
if (r->state.deferred_pipe_control_dw1)
/* 3DPRIMITIVE */
if (ilo_dev_gen(r->dev) >= ILO_GEN(7))
- gen7_3DPRIMITIVE(r->builder, info, ib);
+ gen7_3DPRIMITIVE(r->builder, info, start_offset);
else
- gen6_3DPRIMITIVE(r->builder, info, ib);
+ gen6_3DPRIMITIVE(r->builder, info, start_offset);
r->state.current_pipe_control_dw1 = 0;
assert(!r->state.deferred_pipe_control_dw1);