summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_gpe_gen7.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2013-06-26 13:44:27 +0800
committerChia-I Wu <[email protected]>2013-06-26 16:42:46 +0800
commit95c21f12f321bb33ae8e1f1b255680ac8eeffade (patch)
treebe15c847df41f9b7b82c7ad18c2891b0b7c0bb12 /src/gallium/drivers/ilo/ilo_gpe_gen7.c
parent5fb5d4f0a6208e720998bbdbfe83df1035957f4a (diff)
ilo: support PIPE_CAP_USER_INDEX_BUFFERS
We want to access the user buffer, if available, when primitive restart is enabled and the restart index/primitive type is not natively supported. And since we are handling index buffer uploads in the driver with this change, we can also work around misalignment of index buffer offsets.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_gpe_gen7.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_gpe_gen7.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/ilo/ilo_gpe_gen7.c b/src/gallium/drivers/ilo/ilo_gpe_gen7.c
index 21764c9ff3c..2a590be2ddc 100644
--- a/src/gallium/drivers/ilo/ilo_gpe_gen7.c
+++ b/src/gallium/drivers/ilo/ilo_gpe_gen7.c
@@ -1182,6 +1182,7 @@ gen7_emit_3DSTATE_SO_BUFFER(const struct ilo_dev_info *dev,
static void
gen7_emit_3DPRIMITIVE(const struct ilo_dev_info *dev,
const struct pipe_draw_info *info,
+ const struct ilo_ib_state *ib,
bool rectlist,
struct ilo_cp *cp)
{
@@ -1192,6 +1193,8 @@ gen7_emit_3DPRIMITIVE(const struct ilo_dev_info *dev,
const int vb_access = (info->indexed) ?
GEN7_3DPRIM_VERTEXBUFFER_ACCESS_RANDOM :
GEN7_3DPRIM_VERTEXBUFFER_ACCESS_SEQUENTIAL;
+ const uint32_t vb_start = info->start +
+ ((info->indexed) ? ib->draw_start_offset : 0);
ILO_GPE_VALID_GEN(dev, 7, 7);
@@ -1199,7 +1202,7 @@ gen7_emit_3DPRIMITIVE(const struct ilo_dev_info *dev,
ilo_cp_write(cp, cmd | (cmd_len - 2));
ilo_cp_write(cp, vb_access | prim);
ilo_cp_write(cp, info->count);
- ilo_cp_write(cp, info->start);
+ ilo_cp_write(cp, vb_start);
ilo_cp_write(cp, info->instance_count);
ilo_cp_write(cp, info->start_instance);
ilo_cp_write(cp, info->index_bias);