aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_context.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-11-20 09:00:22 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:10 -0800
commitf1a7392be17573169460971b487ad25cb2ce43df (patch)
treec77fc1e0687c6af4cfbfc500ebb765520315810b /src/gallium/drivers/iris/iris_context.c
parentc2a77efa71f4b36708575652b89165745c4ad054 (diff)
iris: Put batches in an array
We keep re-making this array all over the place
Diffstat (limited to 'src/gallium/drivers/iris/iris_context.c')
-rw-r--r--src/gallium/drivers/iris/iris_context.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/gallium/drivers/iris/iris_context.c b/src/gallium/drivers/iris/iris_context.c
index efcdf128e71..75b1be27306 100644
--- a/src/gallium/drivers/iris/iris_context.c
+++ b/src/gallium/drivers/iris/iris_context.c
@@ -115,8 +115,8 @@ iris_destroy_context(struct pipe_context *ctx)
slab_destroy_child(&ice->transfer_pool);
- iris_batch_free(&ice->render_batch);
- iris_batch_free(&ice->compute_batch);
+ iris_batch_free(&ice->batches[IRIS_BATCH_RENDER]);
+ iris_batch_free(&ice->batches[IRIS_BATCH_COMPUTE]);
iris_destroy_binder(&ice->state.binder);
ralloc_free(ice);
@@ -194,21 +194,16 @@ iris_create_context(struct pipe_screen *pscreen, void *priv, unsigned flags)
genX_call(devinfo, init_state, ice);
genX_call(devinfo, init_blorp, ice);
- struct iris_batch *batches[IRIS_BATCH_COUNT] = {
- &ice->render_batch,
- &ice->compute_batch,
- };
- const char *batch_names[IRIS_BATCH_COUNT] = { "render", "compute", };
-
for (int i = 0; i < IRIS_BATCH_COUNT; i++) {
- iris_init_batch(batches[i], screen, &ice->vtbl, &ice->dbg,
- batches, batch_names[i], I915_EXEC_RENDER);
+ iris_init_batch(&ice->batches[i], screen, &ice->vtbl, &ice->dbg,
+ ice->batches, (enum iris_batch_name) i,
+ I915_EXEC_RENDER);
}
- ice->vtbl.init_render_context(screen, &ice->render_batch, &ice->vtbl,
- &ice->dbg);
- ice->vtbl.init_compute_context(screen, &ice->compute_batch, &ice->vtbl,
- &ice->dbg);
+ ice->vtbl.init_render_context(screen, &ice->batches[IRIS_BATCH_RENDER],
+ &ice->vtbl, &ice->dbg);
+ ice->vtbl.init_compute_context(screen, &ice->batches[IRIS_BATCH_COMPUTE],
+ &ice->vtbl, &ice->dbg);
return ctx;
}