From 244caba2502402b93876cb89952ac05e6d87c5b2 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sat, 20 Jun 2015 00:34:29 +0800 Subject: [PATCH] ilo: avoid ilo_ib_state in genX_3DPRIMITIVE() ilo_ib_state is not in core. --- src/gallium/drivers/ilo/core/ilo_builder_3d.h | 12 ++++-------- src/gallium/drivers/ilo/ilo_render_gen.h | 6 ++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/ilo/core/ilo_builder_3d.h b/src/gallium/drivers/ilo/core/ilo_builder_3d.h index 6cf1732ee1c..8d8a79599bd 100644 --- a/src/gallium/drivers/ilo/core/ilo_builder_3d.h +++ b/src/gallium/drivers/ilo/core/ilo_builder_3d.h @@ -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; diff --git a/src/gallium/drivers/ilo/ilo_render_gen.h b/src/gallium/drivers/ilo/ilo_render_gen.h index 6bbc0a8e3f1..00c8113a45d 100644 --- a/src/gallium/drivers/ilo/ilo_render_gen.h +++ b/src/gallium/drivers/ilo/ilo_render_gen.h @@ -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); -- 2.30.2