diff options
author | Marek Olšák <[email protected]> | 2015-08-29 00:03:02 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-09-01 21:51:14 +0200 |
commit | 2fe040ee61d3c08e8d38c3552ad4e7b5060074a1 (patch) | |
tree | 588f644d320bc2c6b69f3df6fbf5497d794f1918 | |
parent | 5bb0ad7ccc74e3aa69a1d55d2f7935587288312c (diff) |
radeonsi: initialize atom IDs for external atoms
Reviewed-by: Alex Deucher <[email protected]>
Acked-by: Christian König <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 03b0ee4a465..e95824add40 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -142,10 +142,6 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, sctx->b.rings.gfx.flush = si_context_gfx_flush; si_init_all_descriptors(sctx); - - sctx->atoms.s.streamout_begin = &sctx->b.streamout.begin_atom; - sctx->atoms.s.streamout_enable = &sctx->b.streamout.enable_atom; - si_init_state_functions(sctx); si_init_shader_functions(sctx); diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index cc34f3bc4f6..88964e1a545 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -35,6 +35,16 @@ #include "util/u_memory.h" #include "util/u_pstipple.h" +/* Initialize an external atom (owned by ../radeon). */ +static void +si_init_external_atom(struct si_context *sctx, struct r600_atom *atom, + struct r600_atom **list_elem) +{ + atom->id = list_elem - sctx->atoms.array + 1; + *list_elem = atom; +} + +/* Initialize an atom owned by radeonsi. */ void si_init_atom(struct si_context *sctx, struct r600_atom *atom, struct r600_atom **list_elem, void (*emit_func)(struct si_context *ctx, struct r600_atom *state), @@ -3027,6 +3037,9 @@ static void si_init_config(struct si_context *sctx); void si_init_state_functions(struct si_context *sctx) { + si_init_external_atom(sctx, &sctx->b.streamout.begin_atom, &sctx->atoms.s.streamout_begin); + si_init_external_atom(sctx, &sctx->b.streamout.enable_atom, &sctx->atoms.s.streamout_enable); + si_init_atom(sctx, &sctx->cache_flush, &sctx->atoms.s.cache_flush, si_emit_cache_flush, 24); si_init_atom(sctx, &sctx->framebuffer.atom, &sctx->atoms.s.framebuffer, si_emit_framebuffer_state, 0); si_init_atom(sctx, &sctx->msaa_sample_locs, &sctx->atoms.s.msaa_sample_locs, si_emit_msaa_sample_locs, 18); |