Mesa (gallium-resources): failover: update for pipe_resources

Roland Scheidegger sroland at kemper.freedesktop.org
Tue Mar 23 07:52:21 PDT 2010


Module: Mesa
Branch: gallium-resources
Commit: 366f1176fb89d2b1978da6cfe60000b76bbc7338
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=366f1176fb89d2b1978da6cfe60000b76bbc7338

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Tue Mar 23 15:51:52 2010 +0100

failover: update for pipe_resources

---

 src/gallium/drivers/failover/fo_context.c |   28 ++++++++--------------------
 src/gallium/drivers/failover/fo_context.h |    2 +-
 src/gallium/drivers/failover/fo_state.c   |   10 +++++-----
 3 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/src/gallium/drivers/failover/fo_context.c b/src/gallium/drivers/failover/fo_context.c
index 12d8e14..325a100 100644
--- a/src/gallium/drivers/failover/fo_context.c
+++ b/src/gallium/drivers/failover/fo_context.c
@@ -51,7 +51,7 @@ void failover_fail_over( struct failover_context *failover )
 
 
 static void failover_draw_elements( struct pipe_context *pipe,
-                                    struct pipe_buffer *indexBuffer,
+                                    struct pipe_resource *indexResource,
                                     unsigned indexSize,
                                     unsigned prim, 
                                     unsigned start, 
@@ -70,7 +70,7 @@ static void failover_draw_elements( struct pipe_context *pipe,
     */
    if (failover->mode == FO_HW) {
       failover->hw->draw_elements( failover->hw, 
-                                   indexBuffer, 
+                                   indexResource, 
                                    indexSize, 
                                    prim, 
                                    start, 
@@ -87,7 +87,7 @@ static void failover_draw_elements( struct pipe_context *pipe,
       }
 
       failover->sw->draw_elements( failover->sw, 
-				   indexBuffer, 
+				   indexResource, 
 				   indexSize, 
 				   prim, 
 				   start, 
@@ -109,26 +109,15 @@ static void failover_draw_arrays( struct pipe_context *pipe,
 }
 
 static unsigned int
-failover_is_texture_referenced( struct pipe_context *_pipe,
-				struct pipe_resource *texture,
-				unsigned face, unsigned level)
+failover_is_resource_referenced( struct pipe_context *_pipe,
+				 struct pipe_resource *resource,
+				 unsigned face, unsigned level)
 {
    struct failover_context *failover = failover_context( _pipe );
    struct pipe_context *pipe = (failover->mode == FO_HW) ?
       failover->hw : failover->sw;
 
-   return pipe->is_texture_referenced(pipe, texture, face, level);
-}
-
-static unsigned int
-failover_is_buffer_referenced( struct pipe_context *_pipe,
-			       struct pipe_buffer *buf)
-{
-   struct failover_context *failover = failover_context( _pipe );
-   struct pipe_context *pipe = (failover->mode == FO_HW) ?
-      failover->hw : failover->sw;
-
-   return pipe->is_buffer_referenced(pipe, buf);
+   return pipe->is_resource_referenced(pipe, resource, face, level);
 }
 
 struct pipe_context *failover_create( struct pipe_context *hw,
@@ -175,8 +164,7 @@ struct pipe_context *failover_create( struct pipe_context *hw,
 #endif
 
    failover->pipe.flush = hw->flush;
-   failover->pipe.is_texture_referenced = failover_is_texture_referenced;
-   failover->pipe.is_buffer_referenced = failover_is_buffer_referenced;
+   failover->pipe.is_resource_referenced = failover_is_resource_referenced;
 
    failover->dirty = 0;
 
diff --git a/src/gallium/drivers/failover/fo_context.h b/src/gallium/drivers/failover/fo_context.h
index 7303132..88ae5ad 100644
--- a/src/gallium/drivers/failover/fo_context.h
+++ b/src/gallium/drivers/failover/fo_context.h
@@ -134,7 +134,7 @@ failover_context( struct pipe_context *pipe )
 void
 failover_set_constant_buffer(struct pipe_context *pipe,
                              uint shader, uint index,
-                             struct pipe_buffer *buf);
+                             struct pipe_resource *resource);
 
 
 #endif /* FO_CONTEXT_H */
diff --git a/src/gallium/drivers/failover/fo_state.c b/src/gallium/drivers/failover/fo_state.c
index 726906e..b682ce6 100644
--- a/src/gallium/drivers/failover/fo_state.c
+++ b/src/gallium/drivers/failover/fo_state.c
@@ -461,7 +461,7 @@ failover_create_sampler_view(struct pipe_context *pipe,
    view->base = *templ;
    view->base.reference.count = 1;
    view->base.texture = NULL;
-   pipe_texture_reference(&view->base.texture, texture);
+   pipe_resource_reference(&view->base.texture, texture);
    view->base.context = pipe;
 
    return &view->base;
@@ -477,7 +477,7 @@ failover_sampler_view_destroy(struct pipe_context *pipe,
    failover->sw->sampler_view_destroy(failover->sw, fo_view->sw);
    failover->hw->sampler_view_destroy(failover->hw, fo_view->hw);
 
-   pipe_texture_reference(&fo_view->base.texture, NULL);
+   pipe_resource_reference(&fo_view->base.texture, NULL);
    free(fo_view);
 }
 
@@ -572,15 +572,15 @@ failover_set_vertex_buffers(struct pipe_context *pipe,
 void
 failover_set_constant_buffer(struct pipe_context *pipe,
                              uint shader, uint index,
-                             struct pipe_buffer *buf)
+                             struct pipe_resource *res)
 {
    struct failover_context *failover = failover_context(pipe);
 
    assert(shader < PIPE_SHADER_TYPES);
    assert(index == 0);
 
-   failover->sw->set_constant_buffer(failover->sw, shader, index, buf);
-   failover->hw->set_constant_buffer(failover->hw, shader, index, buf);
+   failover->sw->set_constant_buffer(failover->sw, shader, index, res);
+   failover->hw->set_constant_buffer(failover->hw, shader, index, res);
 }
 
 



More information about the mesa-commit mailing list