python: Use pipe_buffer_* inlines as much as possible.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Thu, 4 Sep 2008 00:33:10 +0000 (09:33 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Thu, 4 Sep 2008 00:38:23 +0000 (09:38 +0900)
src/gallium/state_trackers/python/gallium.i
src/gallium/state_trackers/python/p_context.i
src/gallium/state_trackers/python/p_texture.i
src/gallium/state_trackers/python/st_device.c

index a67372c6239add5b3ff1478f8d7bbe8b5988f259..68d2db3325a8d9c7e26b5e6c7008162593400515 100644 (file)
@@ -46,7 +46,7 @@
 #include "pipe/p_shader_tokens.h" 
 #include "cso_cache/cso_context.h"
 #include "util/u_draw_quad.h" 
-#include "util/p_tile.h" 
+#include "util/u_tile.h" 
 #include "tgsi/tgsi_text.h" 
 #include "tgsi/tgsi_dump.h" 
 
index 231e07cd637cd04004fc38ec189414ea7345e80b..1fdcec639f720e2130991e0c4cadef42b3ca4457 100644 (file)
@@ -225,30 +225,30 @@ struct st_context {
                       const float *vertices) 
    {
       struct pipe_context *pipe = $self->pipe;
-      struct pipe_winsys *winsys = pipe->winsys;
+      struct pipe_screen *screen = pipe->screen;
       struct pipe_buffer *vbuf;
       float *map;
       unsigned size;
 
       size = num_verts * num_attribs * 4 * sizeof(float);
 
-      vbuf = winsys->buffer_create(winsys,
-                                   32,
-                                   PIPE_BUFFER_USAGE_VERTEX, 
-                                   size);
+      vbuf = pipe_buffer_create(screen,
+                                32,
+                                PIPE_BUFFER_USAGE_VERTEX, 
+                                size);
       if(!vbuf)
          goto error1;
       
-      map = winsys->buffer_map(winsys, vbuf, PIPE_BUFFER_USAGE_CPU_WRITE);
+      map = pipe_buffer_map(screen, vbuf, PIPE_BUFFER_USAGE_CPU_WRITE);
       if (!map)
          goto error2;
       memcpy(map, vertices, size);
-      pipe->winsys->buffer_unmap(pipe->winsys, vbuf);
+      pipe_buffer_unmap(screen, vbuf);
       
       util_draw_vertex_buffer(pipe, vbuf, prim, num_verts, num_attribs);
       
 error2:
-      pipe_buffer_reference(pipe->screen, &vbuf, NULL);
+      pipe_buffer_reference(screen, &vbuf, NULL);
 error1:
       ;
    }
index f23afea167793eccdfcf7fd024ac64d4f166be4e..33fb3743cce9366f6e0a7485a53a826c90974343 100644 (file)
@@ -180,7 +180,7 @@ struct st_buffer {
    }
    
    void write( const char *STRING, unsigned LENGTH, unsigned offset = 0) {
-      struct pipe_winsys *winsys = $self->st_dev->screen->winsys;
+      struct pipe_screen *screen = $self->st_dev->screen;
       char *map;
       
       assert($self->buffer->refcount);
@@ -195,10 +195,10 @@ struct st_buffer {
          return;
       }
 
-      map = winsys->buffer_map(winsys, $self->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
+      map = pipe_buffer_map(screen, $self->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
       if(map) {
          memcpy(map + offset, STRING, LENGTH);
-         winsys->buffer_unmap(winsys, $self->buffer);
+         pipe_buffer_unmap(screen, $self->buffer);
       }
    }
 };
index bd71755f0b18a159f1d2a08532c06e1fde40f692..95c1378a032ceb676c02b306267ba97d68d49e18 100644 (file)
@@ -292,8 +292,8 @@ void
 st_buffer_destroy(struct st_buffer *st_buf)
 {
    if(st_buf) {
-      struct pipe_winsys *winsys = st_buf->st_dev->screen->winsys;
-      pipe_buffer_reference(pipe->screen, &st_buf->buffer, NULL);
+      struct pipe_screen *screen = st_buf->st_dev->screen;
+      pipe_buffer_reference(screen, &st_buf->buffer, NULL);
       FREE(st_buf);
    }
 }
@@ -303,7 +303,7 @@ struct st_buffer *
 st_buffer_create(struct st_device *st_dev,
                  unsigned alignment, unsigned usage, unsigned size)
 {
-   struct pipe_winsys *winsys = st_dev->screen->winsys;
+   struct pipe_screen *screen = st_dev->screen;
    struct st_buffer *st_buf;
    
    st_buf = CALLOC_STRUCT(st_buffer);
@@ -312,7 +312,7 @@ st_buffer_create(struct st_device *st_dev,
 
    st_buf->st_dev = st_dev;
    
-   st_buf->buffer = winsys->buffer_create(winsys, alignment, usage, size);
+   st_buf->buffer = pipe_buffer_create(screen, alignment, usage, size);
    if(!st_buf->buffer) {
       st_buffer_destroy(st_buf);
       return NULL;