vl: use pipe_context::bind_sampler_states() if non-null
authorBrian Paul <brianp@vmware.com>
Thu, 12 Sep 2013 21:06:44 +0000 (15:06 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 3 Oct 2013 20:05:26 +0000 (14:05 -0600)
src/gallium/auxiliary/vl/vl_compositor.c
src/gallium/auxiliary/vl/vl_idct.c
src/gallium/auxiliary/vl/vl_matrix_filter.c
src/gallium/auxiliary/vl/vl_mc.c
src/gallium/auxiliary/vl/vl_median_filter.c
src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
src/gallium/auxiliary/vl/vl_zscan.c

index 4b8308796ebe537e4c5f6e36ada81acd6a159edd..a2a113999adfb7a4f1ba79c3145357ba6bd7f92a 100644 (file)
@@ -725,7 +725,12 @@ draw_layers(struct vl_compositor *c, struct vl_compositor_state *s, struct u_rec
          c->pipe->bind_blend_state(c->pipe, blend);
          c->pipe->set_viewport_states(c->pipe, 0, 1, &layer->viewport);
          c->pipe->bind_fs_state(c->pipe, layer->fs);
-         c->pipe->bind_fragment_sampler_states(c->pipe, num_sampler_views, layer->samplers);
+         if (c->pipe->bind_sampler_states)
+            c->pipe->bind_sampler_states(c->pipe, PIPE_SHADER_FRAGMENT, 0,
+                                         num_sampler_views, layer->samplers);
+         else
+            c->pipe->bind_fragment_sampler_states(c->pipe, num_sampler_views,
+                                                  layer->samplers);
          c->pipe->set_fragment_sampler_views(c->pipe, num_sampler_views, samplers);
          util_draw_arrays(c->pipe, PIPE_PRIM_QUADS, vb_index * 4, 4);
          vb_index++;
index 5346cbc0ed76a5aa30db2578d392d7af1dedfffd..d31bf4120e955213b9230539db2fe7e5ab3dab2e 100644 (file)
@@ -825,7 +825,13 @@ vl_idct_flush(struct vl_idct *idct, struct vl_idct_buffer *buffer, unsigned num_
 
    idct->pipe->bind_rasterizer_state(idct->pipe, idct->rs_state);
    idct->pipe->bind_blend_state(idct->pipe, idct->blend);
-   idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers);
+
+   if (idct->pipe->bind_sampler_states)
+      idct->pipe->bind_sampler_states(idct->pipe, PIPE_SHADER_FRAGMENT,
+                                      0, 2, idct->samplers);
+   else
+      idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers);
+
    idct->pipe->set_fragment_sampler_views(idct->pipe, 2, buffer->sampler_views.stage[0]);
 
    /* mismatch control */
@@ -850,7 +856,11 @@ vl_idct_prepare_stage2(struct vl_idct *idct, struct vl_idct_buffer *buffer)
 
    /* second stage */
    idct->pipe->bind_rasterizer_state(idct->pipe, idct->rs_state);
-   idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers);
+   if (idct->pipe->bind_sampler_states)
+      idct->pipe->bind_sampler_states(idct->pipe, PIPE_SHADER_FRAGMENT,
+                                      0, 2, idct->samplers);
+   else
+      idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers);
    idct->pipe->set_fragment_sampler_views(idct->pipe, 2, buffer->sampler_views.stage[1]);
 }
 
index 9bd7ed150199cf28fe9faf9c1956ef26e218a9df..f4fd07d865f1b4cb542afdf1d737d26d974cab02 100644 (file)
@@ -306,7 +306,12 @@ vl_matrix_filter_render(struct vl_matrix_filter *filter,
 
    filter->pipe->bind_rasterizer_state(filter->pipe, filter->rs_state);
    filter->pipe->bind_blend_state(filter->pipe, filter->blend);
-   filter->pipe->bind_fragment_sampler_states(filter->pipe, 1, &filter->sampler);
+   if (filter->pipe->bind_sampler_states)
+      filter->pipe->bind_sampler_states(filter->pipe, PIPE_SHADER_FRAGMENT,
+                                        0, 1, &filter->sampler);
+   else
+      filter->pipe->bind_fragment_sampler_states(filter->pipe,
+                                                 1, &filter->sampler);
    filter->pipe->set_fragment_sampler_views(filter->pipe, 1, &src);
    filter->pipe->bind_vs_state(filter->pipe, filter->vs);
    filter->pipe->bind_fs_state(filter->pipe, filter->fs);
index 4877f5ee6c7f57082b9fc18c1d54c54395a78059..b864b2104761d93dd07c425615761d6042c2d59c 100644 (file)
@@ -614,7 +614,12 @@ vl_mc_render_ref(struct vl_mc *renderer, struct vl_mc_buffer *buffer, struct pip
    renderer->pipe->bind_fs_state(renderer->pipe, renderer->fs_ref);
 
    renderer->pipe->set_fragment_sampler_views(renderer->pipe, 1, &ref);
-   renderer->pipe->bind_fragment_sampler_states(renderer->pipe, 1, &renderer->sampler_ref);
+   if (renderer->pipe->bind_sampler_states)
+      renderer->pipe->bind_sampler_states(renderer->pipe, PIPE_SHADER_FRAGMENT,
+                                          0, 1, &renderer->sampler_ref);
+   else
+      renderer->pipe->bind_fragment_sampler_states(renderer->pipe,
+                                                   1, &renderer->sampler_ref);
 
    util_draw_arrays_instanced(renderer->pipe, PIPE_PRIM_QUADS, 0, 4, 0,
                               renderer->buffer_width / VL_MACROBLOCK_WIDTH *
index 158751a22b3190a9f21fae7a957e97e62a7f880e..9a4a54beeff86acada436e0024f48c4080f9c9a4 100644 (file)
@@ -385,7 +385,12 @@ vl_median_filter_render(struct vl_median_filter *filter,
 
    filter->pipe->bind_rasterizer_state(filter->pipe, filter->rs_state);
    filter->pipe->bind_blend_state(filter->pipe, filter->blend);
-   filter->pipe->bind_fragment_sampler_states(filter->pipe, 1, &filter->sampler);
+   if (filter->pipe->bind_sampler_states)
+      filter->pipe->bind_sampler_states(filter->pipe, PIPE_SHADER_FRAGMENT,
+                                        0, 1, &filter->sampler);
+   else
+      filter->pipe->bind_fragment_sampler_states(filter->pipe, 1,
+                                                 &filter->sampler);
    filter->pipe->set_fragment_sampler_views(filter->pipe, 1, &src);
    filter->pipe->bind_vs_state(filter->pipe, filter->vs);
    filter->pipe->bind_fs_state(filter->pipe, filter->fs);
index f91f90b7ac64279e1fcf90b44aee137c77d81437..3b577ace4d56b1a3f09de05e2922f580470100f8 100644 (file)
@@ -747,7 +747,13 @@ vl_mpeg12_end_frame(struct pipe_video_codec *decoder,
             vl_idct_prepare_stage2(i ? &dec->idct_c : &dec->idct_y, &buf->idct[plane]);
          else {
             dec->base.context->set_fragment_sampler_views(dec->base.context, 1, &mc_source_sv[plane]);
-            dec->base.context->bind_fragment_sampler_states(dec->base.context, 1, &dec->sampler_ycbcr);
+            if (dec->base.context->bind_sampler_states)
+               dec->base.context->bind_sampler_states(dec->base.context,
+                                                      PIPE_SHADER_FRAGMENT,
+                                                      0, 1,
+                                                      &dec->sampler_ycbcr);
+            else
+               dec->base.context->bind_fragment_sampler_states(dec->base.context, 1, &dec->sampler_ycbcr);
          }
          vl_mc_render_ycbcr(i ? &dec->mc_c : &dec->mc_y, &buf->mc[i], j, buf->num_ycbcr_blocks[plane]);
       }
index 33baa3d99020b5b420a151ca4ede4fdf8be8c759..706a8094703586845d0cd4489411f0f484f249ab 100644 (file)
@@ -574,7 +574,12 @@ vl_zscan_render(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, unsigned
 
    zscan->pipe->bind_rasterizer_state(zscan->pipe, zscan->rs_state);
    zscan->pipe->bind_blend_state(zscan->pipe, zscan->blend);
-   zscan->pipe->bind_fragment_sampler_states(zscan->pipe, 3, zscan->samplers);
+   if (zscan->pipe->bind_sampler_states)
+      zscan->pipe->bind_sampler_states(zscan->pipe, PIPE_SHADER_FRAGMENT,
+                                       0, 3, zscan->samplers);
+   else
+      zscan->pipe->bind_fragment_sampler_states(zscan->pipe, 3,
+                                                zscan->samplers);
    zscan->pipe->set_framebuffer_state(zscan->pipe, &buffer->fb_state);
    zscan->pipe->set_viewport_states(zscan->pipe, 0, 1, &buffer->viewport);
    zscan->pipe->set_fragment_sampler_views(zscan->pipe, 3, &buffer->src);