ilo: avoid ilo_ib_state in genX_3DPRIMITIVE()

ilo_ib_state is not in core.
This commit is contained in:
Chia-I Wu
2015-06-20 00:34:29 +08:00
parent dcb5bad3a3
commit 244caba250
2 changed files with 8 additions and 10 deletions
@@ -38,14 +38,12 @@
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);
@@ -57,7 +55,7 @@ gen6_3DPRIMITIVE(struct ilo_builder *builder,
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;
@@ -66,14 +64,12 @@ gen6_3DPRIMITIVE(struct ilo_builder *builder,
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);
@@ -83,7 +79,7 @@ gen7_3DPRIMITIVE(struct ilo_builder *builder,
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;
+4 -2
View File
@@ -389,6 +389,8 @@ ilo_render_3dprimitive(struct ilo_render *r,
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)
@@ -396,9 +398,9 @@ ilo_render_3dprimitive(struct ilo_render *r,
/* 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);