Mesa (gallium-resources): mesa/es: Fixes for gallium-resources.

Chia-I Wu olv at kemper.freedesktop.org
Mon Apr 5 03:59:49 UTC 2010


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

Author: Chia-I Wu <olv at lunarg.com>
Date:   Mon Apr  5 11:58:53 2010 +0800

mesa/es: Fixes for gallium-resources.

---

 src/mesa/es/state_tracker/st_cb_drawtex.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/mesa/es/state_tracker/st_cb_drawtex.c b/src/mesa/es/state_tracker/st_cb_drawtex.c
index f75f486..6d387d5 100644
--- a/src/mesa/es/state_tracker/st_cb_drawtex.c
+++ b/src/mesa/es/state_tracker/st_cb_drawtex.c
@@ -115,7 +115,8 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
    struct st_context *st = ctx->st;
    struct pipe_context *pipe = st->pipe;
    struct cso_context *cso = ctx->st->cso_context;
-   struct pipe_buffer *vbuffer;
+   struct pipe_resource *vbuffer;
+   struct pipe_transfer *vbuffer_transfer;
    GLuint i, numTexCoords, numAttribs;
    GLboolean emitColor;
    uint semantic_names[2 + MAX_TEXTURE_UNITS];
@@ -145,7 +146,7 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
 
 
    /* create the vertex buffer */
-   vbuffer = pipe_buffer_create(pipe->screen, 32, PIPE_BUFFER_USAGE_VERTEX,
+   vbuffer = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER,
                                 numAttribs * 4 * 4 * sizeof(GLfloat));
 
    /* load vertex buffer */
@@ -161,8 +162,9 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
       } while (0)
 
       const GLfloat x0 = x, y0 = y, x1 = x + width, y1 = y + height;
-      GLfloat *vbuf = (GLfloat *) pipe_buffer_map(pipe->screen, vbuffer,
-                                                  PIPE_BUFFER_USAGE_CPU_WRITE);
+      GLfloat *vbuf = (GLfloat *) pipe_buffer_map(pipe, vbuffer,
+                                                  PIPE_TRANSFER_WRITE,
+                                                  &vbuffer_transfer);
       GLuint attr;
       
       z = CLAMP(z, 0.0f, 1.0f);
@@ -227,7 +229,7 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
          }
       }
 
-      pipe_buffer_unmap(pipe->screen, vbuffer);
+      pipe_buffer_unmap(pipe, vbuffer, vbuffer_transfer);
 
 #undef SET_ATTRIB
    }
@@ -277,7 +279,7 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
                            numAttribs); /* attribs/vert */
 
 
-   pipe_buffer_reference(&vbuffer, NULL);
+   pipe_resource_reference(&vbuffer, NULL);
 
    /* restore state */
    cso_restore_viewport(cso);




More information about the mesa-commit mailing list