draw: remove use of old bind_fragment_sampler_states()
authorBrian Paul <brianp@vmware.com>
Thu, 12 Sep 2013 21:25:08 +0000 (15:25 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 3 Oct 2013 20:05:28 +0000 (14:05 -0600)
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_pstipple.c

index bb4261c9f9cde0c45127838d5748ecf432a22652..3c93bf7f7224fabfcd5eb34f634610c28135597d 100644 (file)
@@ -120,8 +120,6 @@ struct aaline_stage
 
    void (*driver_bind_sampler_states)(struct pipe_context *, unsigned, unsigned,
                                       unsigned, void **);
-   void (*driver_bind_fragment_sampler_states)(struct pipe_context *, unsigned,
-                                               void **);
 
    void (*driver_set_sampler_views)(struct pipe_context *,
                                     unsigned,
@@ -706,12 +704,9 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
                                aaline->sampler_view);
 
    draw->suspend_flushing = TRUE;
-   if (aaline->driver_bind_sampler_states)
-      aaline->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
-                                         num_samplers, aaline->state.sampler);
-   else
-      aaline->driver_bind_fragment_sampler_states(pipe, num_samplers,
-                                                  aaline->state.sampler);
+
+   aaline->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
+                                      num_samplers, aaline->state.sampler);
 
    aaline->driver_set_sampler_views(pipe, num_samplers, aaline->state.sampler_views);
 
@@ -741,13 +736,9 @@ aaline_flush(struct draw_stage *stage, unsigned flags)
    draw->suspend_flushing = TRUE;
    aaline->driver_bind_fs_state(pipe, aaline->fs ? aaline->fs->driver_fs : NULL);
 
-   if (aaline->driver_bind_sampler_states)
-      aaline->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
-                                         aaline->num_samplers,
-                                         aaline->state.sampler);
-   else
-      aaline->driver_bind_fragment_sampler_states(pipe, aaline->num_samplers,
-                                                  aaline->state.sampler);
+   aaline->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
+                                      aaline->num_samplers,
+                                      aaline->state.sampler);
 
    aaline->driver_set_sampler_views(pipe,
                                     aaline->num_sampler_views,
@@ -800,7 +791,6 @@ aaline_destroy(struct draw_stage *stage)
    pipe->delete_fs_state = aaline->driver_delete_fs_state;
 
    pipe->bind_sampler_states = aaline->driver_bind_sampler_states;
-   pipe->bind_fragment_sampler_states = aaline->driver_bind_fragment_sampler_states;
    pipe->set_fragment_sampler_views = aaline->driver_set_sampler_views;
 
    FREE( stage );
@@ -941,26 +931,6 @@ aaline_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
 }
 
 
-/* XXX deprecated / remove */
-static void
-aaline_bind_fragment_sampler_states(struct pipe_context *pipe,
-                                    unsigned num, void **sampler)
-{
-   struct aaline_stage *aaline = aaline_stage_from_pipe(pipe);
-
-   if (aaline == NULL) {
-      return;
-   }
-
-   /* save current */
-   memcpy(aaline->state.sampler, sampler, num * sizeof(void *));
-   aaline->num_samplers = num;
-
-   /* pass-through */
-   aaline->driver_bind_fragment_sampler_states(pipe, num, sampler);
-}
-
-
 static void
 aaline_set_sampler_views(struct pipe_context *pipe,
                          unsigned num,
@@ -1038,7 +1008,6 @@ draw_install_aaline_stage(struct draw_context *draw, struct pipe_context *pipe)
    aaline->driver_delete_fs_state = pipe->delete_fs_state;
 
    aaline->driver_bind_sampler_states = pipe->bind_sampler_states;
-   aaline->driver_bind_fragment_sampler_states = pipe->bind_fragment_sampler_states;
    aaline->driver_set_sampler_views = pipe->set_fragment_sampler_views;
 
    /* override the driver's functions */
@@ -1046,11 +1015,7 @@ draw_install_aaline_stage(struct draw_context *draw, struct pipe_context *pipe)
    pipe->bind_fs_state = aaline_bind_fs_state;
    pipe->delete_fs_state = aaline_delete_fs_state;
 
-   if (pipe->bind_sampler_states)
-      pipe->bind_sampler_states = aaline_bind_sampler_states;
-   else
-      pipe->bind_fragment_sampler_states = aaline_bind_fragment_sampler_states;
-
+   pipe->bind_sampler_states = aaline_bind_sampler_states;
    pipe->set_fragment_sampler_views = aaline_set_sampler_views;
    
    /* Install once everything is known to be OK:
index 5e501d7b43a8513b6833d073276ea922197b8097..e39276a55d38b0bb2e6de29759bbbfa1551190ba 100644 (file)
@@ -99,8 +99,6 @@ struct pstip_stage
    void (*driver_bind_fs_state)(struct pipe_context *, void *);
    void (*driver_delete_fs_state)(struct pipe_context *, void *);
 
-   void (*driver_bind_fragment_sampler_states)(struct pipe_context *, unsigned, void **);
-
    void (*driver_bind_sampler_states)(struct pipe_context *, unsigned,
                                       unsigned, unsigned, void **);
 
@@ -551,12 +549,8 @@ pstip_first_tri(struct draw_stage *stage, struct prim_header *header)
 
    draw->suspend_flushing = TRUE;
 
-   if (pstip->driver_bind_sampler_states)
-      pstip->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
-                                        num_samplers, pstip->state.samplers);
-   else
-      pstip->driver_bind_fragment_sampler_states(pipe, num_samplers,
-                                                 pstip->state.samplers);
+   pstip->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
+                                     num_samplers, pstip->state.samplers);
 
    pstip->driver_set_sampler_views(pipe, num_samplers, pstip->state.sampler_views);
    draw->suspend_flushing = FALSE;
@@ -581,13 +575,9 @@ pstip_flush(struct draw_stage *stage, unsigned flags)
    draw->suspend_flushing = TRUE;
    pstip->driver_bind_fs_state(pipe, pstip->fs ? pstip->fs->driver_fs : NULL);
 
-   if (pstip->driver_bind_sampler_states)
-      pstip->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
-                                        pstip->num_samplers,
-                                        pstip->state.samplers);
-   else
-      pstip->driver_bind_fragment_sampler_states(pipe, pstip->num_samplers,
-                                                 pstip->state.samplers);
+   pstip->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
+                                     pstip->num_samplers,
+                                     pstip->state.samplers);
 
    pstip->driver_set_sampler_views(pipe,
                                    pstip->num_sampler_views,
@@ -740,27 +730,6 @@ pstip_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
 }
 
 
-/* XXX deprecated / remove */
-static void
-pstip_bind_fragment_sampler_states(struct pipe_context *pipe,
-                                   unsigned num, void **sampler)
-{
-   struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
-   uint i;
-
-   /* save current */
-   memcpy(pstip->state.samplers, sampler, num * sizeof(void *));
-   for (i = num; i < PIPE_MAX_SAMPLERS; i++) {
-      pstip->state.samplers[i] = NULL;
-   }
-
-   pstip->num_samplers = num;
-   /* pass-through */
-   pstip->driver_bind_fragment_sampler_states(pstip->pipe, num, sampler);
-}
-
-
-
 static void
 pstip_set_sampler_views(struct pipe_context *pipe,
                         unsigned num,
@@ -835,7 +804,6 @@ draw_install_pstipple_stage(struct draw_context *draw,
    pstip->driver_delete_fs_state = pipe->delete_fs_state;
 
    pstip->driver_bind_sampler_states = pipe->bind_sampler_states;
-   pstip->driver_bind_fragment_sampler_states = pipe->bind_fragment_sampler_states;
    pstip->driver_set_sampler_views = pipe->set_fragment_sampler_views;
    pstip->driver_set_polygon_stipple = pipe->set_polygon_stipple;
 
@@ -844,9 +812,7 @@ draw_install_pstipple_stage(struct draw_context *draw,
    pipe->bind_fs_state = pstip_bind_fs_state;
    pipe->delete_fs_state = pstip_delete_fs_state;
 
-   if (pipe->bind_sampler_states)
-      pipe->bind_sampler_states = pstip_bind_sampler_states;
-   pipe->bind_fragment_sampler_states = pstip_bind_fragment_sampler_states;
+   pipe->bind_sampler_states = pstip_bind_sampler_states;
    pipe->set_fragment_sampler_views = pstip_set_sampler_views;
    pipe->set_polygon_stipple = pstip_set_polygon_stipple;