diff options
author | Marek Olšák <[email protected]> | 2017-04-02 15:24:19 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-05-10 19:00:16 +0200 |
commit | 22f6624ed318e8131681ec1f2e7b3a59449df412 (patch) | |
tree | ba8d1d3e12d2a75fdf82eea5ac409974e76153ad /src/gallium/drivers/nouveau/nvc0 | |
parent | c24c3b94ed29ecd99b1101c74c6c4606f9b5580e (diff) |
gallium: separate indirect stuff from pipe_draw_info - 80 -> 56 bytes
For faster initialization of non-indirect draws.
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0')
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c index b42b4685607..7cea5fb692e 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c @@ -818,10 +818,10 @@ static void nvc0_draw_indirect(struct nvc0_context *nvc0, const struct pipe_draw_info *info) { struct nouveau_pushbuf *push = nvc0->base.pushbuf; - struct nv04_resource *buf = nv04_resource(info->indirect); - struct nv04_resource *buf_count = nv04_resource(info->indirect_params); - unsigned size, macro, count = info->indirect_count, drawid = info->drawid; - uint32_t offset = buf->offset + info->indirect_offset; + struct nv04_resource *buf = nv04_resource(info->indirect->buffer); + struct nv04_resource *buf_count = nv04_resource(info->indirect->indirect_draw_count); + unsigned size, macro, count = info->indirect->draw_count, drawid = info->drawid; + uint32_t offset = buf->offset + info->indirect->offset; struct nvc0_screen *screen = nvc0->screen; PUSH_SPACE(push, 7); @@ -870,7 +870,7 @@ nvc0_draw_indirect(struct nvc0_context *nvc0, const struct pipe_draw_info *info) */ while (count) { unsigned draws = count, pushes, i; - if (info->indirect_stride == size * 4) { + if (info->indirect->stride == size * 4) { draws = MIN2(draws, (NV04_PFIFO_MAX_PACKET_LEN - 4) / size); pushes = 1; } else { @@ -890,20 +890,20 @@ nvc0_draw_indirect(struct nvc0_context *nvc0, const struct pipe_draw_info *info) if (buf_count) { nouveau_pushbuf_data(push, buf_count->bo, - buf_count->offset + info->indirect_params_offset, + buf_count->offset + info->indirect->indirect_draw_count_offset, NVC0_IB_ENTRY_1_NO_PREFETCH | 4); } if (pushes == 1) { nouveau_pushbuf_data(push, buf->bo, offset, NVC0_IB_ENTRY_1_NO_PREFETCH | (size * 4 * draws)); - offset += draws * info->indirect_stride; + offset += draws * info->indirect->stride; } else { for (i = 0; i < pushes; i++) { nouveau_pushbuf_data(push, buf->bo, offset, NVC0_IB_ENTRY_1_NO_PREFETCH | (size * 4)); - offset += info->indirect_stride; + offset += info->indirect->stride; } } count -= draws; |