softpipe: Fix after sampler view changes.
authorMichal Krol <michal@vmware.com>
Tue, 23 Feb 2010 15:37:42 +0000 (16:37 +0100)
committerMichal Krol <michal@vmware.com>
Tue, 23 Feb 2010 15:37:42 +0000 (16:37 +0100)
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_state.h
src/gallium/drivers/softpipe/sp_state_sampler.c

index 858e118bc66bf52f5f19b4886228d9e912c626e1..0c74b490fea4d25e87168512b91b280715e9576a 100644 (file)
@@ -254,6 +254,8 @@ softpipe_create_context( struct pipe_screen *screen,
    softpipe->pipe.set_scissor_state = softpipe_set_scissor_state;
    softpipe->pipe.set_fragment_sampler_views = softpipe_set_sampler_views;
    softpipe->pipe.set_vertex_sampler_views = softpipe_set_vertex_sampler_views;
+   softpipe->pipe.create_sampler_view = softpipe_create_sampler_view;
+   softpipe->pipe.sampler_view_destroy = softpipe_sampler_view_destroy;
    softpipe->pipe.set_viewport_state = softpipe_set_viewport_state;
 
    softpipe->pipe.set_vertex_buffers = softpipe_set_vertex_buffers;
index ba9bbfe68a4bec1f1b51dea2e0e14fe2fa623bd0..b37bb951520c802c5f11895df8976ea7948b4927 100644 (file)
@@ -175,6 +175,15 @@ softpipe_set_vertex_sampler_views(struct pipe_context *,
                                   unsigned num,
                                   struct pipe_sampler_view **);
 
+struct pipe_sampler_view *
+softpipe_create_sampler_view(struct pipe_context *pipe,
+                             struct pipe_texture *texture,
+                             const struct pipe_sampler_view *templ);
+
+void
+softpipe_sampler_view_destroy(struct pipe_context *pipe,
+                              struct pipe_sampler_view *view);
+
 void softpipe_set_viewport_state( struct pipe_context *,
                                   const struct pipe_viewport_state * );
 
index c985b5c3e085021ea19c53c6100300fb546c904d..5a92e2223ef9bfc5938c8246f6d2a80f76edffd2 100644 (file)
@@ -121,6 +121,35 @@ softpipe_bind_vertex_sampler_states(struct pipe_context *pipe,
 }
 
 
+struct pipe_sampler_view *
+softpipe_create_sampler_view(struct pipe_context *pipe,
+                             struct pipe_texture *texture,
+                             const struct pipe_sampler_view *templ)
+{
+   struct softpipe_context *softpipe = softpipe_context(pipe);
+   struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
+
+   *view = *templ;
+   view->reference.count = 1;
+   view->texture = NULL;
+   pipe_texture_reference(&view->texture, texture);
+   view->context = pipe;
+
+   return view;
+}
+
+
+void
+softpipe_sampler_view_destroy(struct pipe_context *pipe,
+                              struct pipe_sampler_view *view)
+{
+   struct softpipe_context *softpipe = softpipe_context(pipe);
+
+   pipe_texture_reference(&view->texture, NULL);
+   FREE(view);
+}
+
+
 void
 softpipe_set_sampler_views(struct pipe_context *pipe,
                            unsigned num,