radeonsi: Don't use anonymous struct trick in atom tracking
authorAdam Jackson <ajax@redhat.com>
Tue, 22 Apr 2014 16:46:08 +0000 (12:46 -0400)
committerAdam Jackson <ajax@redhat.com>
Thu, 8 May 2014 16:05:58 +0000 (12:05 -0400)
I'm somewhat impressed that current gccs will let you do this, but
sufficiently old ones (including 4.4.7 in RHEL6) won't.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_hw_context.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state_draw.c

index 0c58d5fd04585fb2dc555061d2561ad0a866a555..e0b211f264c1d6c02695db83fec0b82164858aec 100644 (file)
@@ -987,9 +987,9 @@ void si_init_all_descriptors(struct si_context *sctx)
 
                si_init_sampler_views(sctx, &sctx->samplers[i].views, i);
 
-               sctx->atoms.const_buffers[i] = &sctx->const_buffers[i].desc.atom;
-               sctx->atoms.rw_buffers[i] = &sctx->rw_buffers[i].desc.atom;
-               sctx->atoms.sampler_views[i] = &sctx->samplers[i].views.desc.atom;
+               sctx->atoms.s.const_buffers[i] = &sctx->const_buffers[i].desc.atom;
+               sctx->atoms.s.rw_buffers[i] = &sctx->rw_buffers[i].desc.atom;
+               sctx->atoms.s.sampler_views[i] = &sctx->samplers[i].views.desc.atom;
        }
 
 
index 383157b7dd3b5f0eb76f2f1b6639ebc929e711a5..d2a1dbe42171dbd738cd7f8184f15b3af0d78d2b 100644 (file)
@@ -63,7 +63,7 @@ void si_need_cs_space(struct si_context *ctx, unsigned num_dw,
        }
 
        /* Count in framebuffer cache flushes at the end of CS. */
-       num_dw += ctx->atoms.cache_flush->num_dw;
+       num_dw += ctx->atoms.s.cache_flush->num_dw;
 
 #if SI_TRACE_CS
        if (ctx->screen->b.trace_bo) {
index 3837c3733b8f93f4c43bd51a49b67152e3fa13e1..e5d0a95e18e2a691f77b6123a51edfdc5570a7b7 100644 (file)
@@ -105,10 +105,10 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, void *
 
        /* Initialize cache_flush. */
        sctx->cache_flush = si_atom_cache_flush;
-       sctx->atoms.cache_flush = &sctx->cache_flush;
+       sctx->atoms.s.cache_flush = &sctx->cache_flush;
 
-       sctx->atoms.streamout_begin = &sctx->b.streamout.begin_atom;
-       sctx->atoms.streamout_enable = &sctx->b.streamout.enable_atom;
+       sctx->atoms.s.streamout_begin = &sctx->b.streamout.begin_atom;
+       sctx->atoms.s.streamout_enable = &sctx->b.streamout.enable_atom;
 
        switch (sctx->b.chip_class) {
        case SI:
index a74bbcf5c6185526ffbf91c06001057ce84a8b2b..1601a4b58cbf968ef7e1a7dcb32b974a318a57e4 100644 (file)
@@ -110,7 +110,7 @@ struct si_context {
                        struct r600_atom *streamout_begin;
                        struct r600_atom *streamout_enable; /* must be after streamout_begin */
                        struct r600_atom *framebuffer;
-               };
+               } s;
                struct r600_atom *array[0];
        } atoms;
 
index d25dc60cec851a603a61dde17d93c1a798fb5dfd..9d048c53e7224a3bf7fd2a168c479e3fc0c91efc 100644 (file)
@@ -2962,7 +2962,7 @@ void si_init_state_functions(struct si_context *sctx)
 {
        int i;
 
-       si_init_atom(&sctx->framebuffer.atom, &sctx->atoms.framebuffer, si_emit_framebuffer_state, 0);
+       si_init_atom(&sctx->framebuffer.atom, &sctx->atoms.s.framebuffer, si_emit_framebuffer_state, 0);
 
        sctx->b.b.create_blend_state = si_create_blend_state;
        sctx->b.b.bind_blend_state = si_bind_blend_state;
index 0676b154faeb55f778bb6ea617becf3d36e36144..c7c94fcc490d38e2c9cc5bbec360634f85449ee0 100644 (file)
@@ -964,7 +964,7 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
 
        /* Check flush flags. */
        if (sctx->b.flags)
-               sctx->atoms.cache_flush->dirty = true;
+               sctx->atoms.s.cache_flush->dirty = true;
 
        si_need_cs_space(sctx, 0, TRUE);