radeonsi: properly declare context sampler states
authorMarek Olšák <marek.olsak@amd.com>
Fri, 2 Dec 2016 02:39:04 +0000 (03:39 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Dec 2016 17:46:54 +0000 (18:46 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_blit.c
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_state.h

index f5f49c1380ca395d71dbb74178f39df0e5409731..83870e507b9df53a4564d08885311603031d1d9a 100644 (file)
@@ -78,7 +78,7 @@ static void si_blitter_begin(struct pipe_context *ctx, enum si_blitter_op op)
        if (op & SI_SAVE_TEXTURES) {
                util_blitter_save_fragment_sampler_states(
                        sctx->blitter, 2,
-                       sctx->samplers[PIPE_SHADER_FRAGMENT].views.sampler_states);
+                       (void**)sctx->samplers[PIPE_SHADER_FRAGMENT].views.sampler_states);
 
                util_blitter_save_fragment_sampler_views(sctx->blitter, 2,
                        sctx->samplers[PIPE_SHADER_FRAGMENT].views.views);
index cf661022d28d1991cbcd513efdffc1c23deacb91..8b6e0bbb3a7a5fdfd3515d2d4976743a6d1d5471 100644 (file)
@@ -456,7 +456,7 @@ static void si_set_sampler_view(struct si_context *sctx,
 
                        if (views->sampler_states[slot])
                                memcpy(desc + 12,
-                                      views->sampler_states[slot], 4*4);
+                                      views->sampler_states[slot]->val, 4*4);
                }
 
                views->enabled_mask |= 1u << slot;
@@ -474,7 +474,7 @@ static void si_set_sampler_view(struct si_context *sctx,
                /* Re-set the sampler state if we are transitioning from FMASK. */
                if (views->sampler_states[slot])
                        memcpy(desc + 12,
-                              views->sampler_states[slot], 4*4);
+                              views->sampler_states[slot]->val, 4*4);
 
                views->enabled_mask &= ~(1u << slot);
        }
index 3a9f0cf1acf10b713d32365aa9afa04e6df05a07..eb7a69f0bcb356729473453314c41f20edba1713 100644 (file)
@@ -245,7 +245,7 @@ struct si_descriptors {
 
 struct si_sampler_views {
        struct pipe_sampler_view        *views[SI_NUM_SAMPLERS];
-       void                            *sampler_states[SI_NUM_SAMPLERS];
+       struct si_sampler_state         *sampler_states[SI_NUM_SAMPLERS];
 
        /* The i-th bit is set if that element is enabled (non-NULL resource). */
        unsigned                        enabled_mask;