gallium: new, unified pipe_context::set_sampler_views() function
[mesa.git] / src / gallium / drivers / nouveau / nv30 / nv30_fragtex.c
index 87e66cc6d917d21da601f6623c18c860e69ce8a7..4ab31d1416966bb1d498dafb9ba6f4d453e4e193 100644 (file)
@@ -171,7 +171,7 @@ nv30_fragtex_sampler_states_bind(struct pipe_context *pipe,
 }
 
 
-static void
+void
 nv30_fragtex_set_sampler_views(struct pipe_context *pipe, unsigned nr,
                                struct pipe_sampler_view **views)
 {
@@ -194,8 +194,28 @@ nv30_fragtex_set_sampler_views(struct pipe_context *pipe, unsigned nr,
    nv30->dirty |= NV30_NEW_FRAGTEX;
 }
 
+
+static void
+nv30_set_sampler_views(struct pipe_context *pipe, unsigned shader,
+                       unsigned start, unsigned nr,
+                       struct pipe_sampler_view **views)
+{
+   assert(start == 0);
+   switch (shader) {
+   case PIPE_SHADER_FRAGMENT:
+      nv30_fragtex_set_sampler_views(pipe, nr, views);
+      break;
+   case PIPE_SHADER_VERTEX:
+      nv40_verttex_set_sampler_views(pipe, nr, views);
+      break;
+   default:
+      ;
+   }
+}
+
+
 void
 nv30_fragtex_init(struct pipe_context *pipe)
 {
-   pipe->set_fragment_sampler_views = nv30_fragtex_set_sampler_views;
+   pipe->set_sampler_views = nv30_set_sampler_views;
 }