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/mesa/state_tracker | |
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/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 5c9f7ea7917..29381b654dd 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -264,6 +264,7 @@ st_indirect_draw_vbo(struct gl_context *ctx, { struct st_context *st = st_context(ctx); struct pipe_draw_info info; + struct pipe_draw_indirect_info indirect; /* Mesa core state should have been validated already */ assert(ctx->NewState == 0x0); @@ -281,6 +282,7 @@ st_indirect_draw_vbo(struct gl_context *ctx, return; } + memset(&indirect, 0, sizeof(indirect)); util_draw_init_info(&info); if (ib) { @@ -294,8 +296,9 @@ st_indirect_draw_vbo(struct gl_context *ctx, info.mode = translate_prim(ctx, mode); info.vertices_per_patch = ctx->TessCtrlProgram.patch_vertices; - info.indirect = st_buffer_object(indirect_data)->buffer; - info.indirect_offset = indirect_offset; + info.indirect = &indirect; + indirect.buffer = st_buffer_object(indirect_data)->buffer; + indirect.offset = indirect_offset; if (ST_DEBUG & DEBUG_DRAW) { debug_printf("st/draw indirect: mode %s drawcount %d indexed %d\n", @@ -308,18 +311,18 @@ st_indirect_draw_vbo(struct gl_context *ctx, int i; assert(!indirect_params); - info.indirect_count = 1; + indirect.draw_count = 1; for (i = 0; i < draw_count; i++) { info.drawid = i; cso_draw_vbo(st->cso_context, &info); - info.indirect_offset += stride; + indirect.offset += stride; } } else { - info.indirect_count = draw_count; - info.indirect_stride = stride; + indirect.draw_count = draw_count; + indirect.stride = stride; if (indirect_params) { - info.indirect_params = st_buffer_object(indirect_params)->buffer; - info.indirect_params_offset = indirect_params_offset; + indirect.indirect_draw_count = st_buffer_object(indirect_params)->buffer; + indirect.indirect_draw_count_offset = indirect_params_offset; } cso_draw_vbo(st->cso_context, &info); } |