diff options
author | Michel Dänzer <[email protected]> | 2008-01-25 17:01:01 +0100 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2008-01-25 17:01:01 +0100 |
commit | 756d52ec12c41ee90ee9598dc9028cc134806bd2 (patch) | |
tree | a112f0b2a933faccb8e759c3b039f8b492daa8ed /src/mesa/pipe/i915simple | |
parent | 7a207682aafc05c62cbc5851cc6c98c43aa3d9bd (diff) |
gallium: Simplify winsys buffer interface.
The properties of a buffer represented by struct pipe_buffer_handle are now
basically constant over its lifetime. The state tracker gets to deal with any
more complex buffer semantics it may need to provide.
Diffstat (limited to 'src/mesa/pipe/i915simple')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_context.c | 4 | ||||
-rw-r--r-- | src/mesa/pipe/i915simple/i915_prim_vbuf.c | 8 | ||||
-rw-r--r-- | src/mesa/pipe/i915simple/i915_state.c | 3 | ||||
-rw-r--r-- | src/mesa/pipe/i915simple/i915_texture.c | 14 |
4 files changed, 12 insertions, 17 deletions
diff --git a/src/mesa/pipe/i915simple/i915_context.c b/src/mesa/pipe/i915simple/i915_context.c index 1c6b8cbb051..c2b96d2554e 100644 --- a/src/mesa/pipe/i915simple/i915_context.c +++ b/src/mesa/pipe/i915simple/i915_context.c @@ -185,7 +185,7 @@ i915_draw_elements( struct pipe_context *pipe, void *buf = pipe->winsys->buffer_map(pipe->winsys, i915->vertex_buffer[i].buffer, - PIPE_BUFFER_FLAG_READ); + PIPE_BUFFER_USAGE_CPU_READ); draw_set_mapped_vertex_buffer(draw, i, buf); } } @@ -193,7 +193,7 @@ i915_draw_elements( struct pipe_context *pipe, if (indexBuffer) { void *mapped_indexes = pipe->winsys->buffer_map(pipe->winsys, indexBuffer, - PIPE_BUFFER_FLAG_READ); + PIPE_BUFFER_USAGE_CPU_READ); draw_set_mapped_element_buffer(draw, indexSize, mapped_indexes); } else { diff --git a/src/mesa/pipe/i915simple/i915_prim_vbuf.c b/src/mesa/pipe/i915simple/i915_prim_vbuf.c index edc62e25e52..0887f9a1c66 100644 --- a/src/mesa/pipe/i915simple/i915_prim_vbuf.c +++ b/src/mesa/pipe/i915simple/i915_prim_vbuf.c @@ -99,16 +99,14 @@ i915_vbuf_render_allocate_vertices( struct vbuf_render *render, /* FIXME: handle failure */ assert(!i915->vbo); - i915->vbo = winsys->buffer_create(winsys, 64, 0, 0); - winsys->buffer_data( winsys, i915->vbo, - size, NULL, - I915_BUFFER_USAGE_LIT_VERTEX ); + i915->vbo = winsys->buffer_create(winsys, 64, I915_BUFFER_USAGE_LIT_VERTEX, + size); i915->dirty |= I915_NEW_VBO; return winsys->buffer_map(winsys, i915->vbo, - PIPE_BUFFER_FLAG_WRITE ); + PIPE_BUFFER_USAGE_CPU_WRITE); } diff --git a/src/mesa/pipe/i915simple/i915_state.c b/src/mesa/pipe/i915simple/i915_state.c index 1190e05699c..950ea52d601 100644 --- a/src/mesa/pipe/i915simple/i915_state.c +++ b/src/mesa/pipe/i915simple/i915_state.c @@ -476,7 +476,8 @@ static void i915_set_constant_buffer(struct pipe_context *pipe, { void *mapped; if (buf->size && - (mapped = ws->buffer_map(ws, buf->buffer, PIPE_BUFFER_FLAG_READ))) { + (mapped = ws->buffer_map(ws, buf->buffer, + PIPE_BUFFER_USAGE_CPU_READ))) { memcpy(i915->current.constants[shader], mapped, buf->size); ws->buffer_unmap(ws, buf->buffer); i915->current.num_user_constants[shader] diff --git a/src/mesa/pipe/i915simple/i915_texture.c b/src/mesa/pipe/i915simple/i915_texture.c index 6b0a4a96f3c..bf80e18233f 100644 --- a/src/mesa/pipe/i915simple/i915_texture.c +++ b/src/mesa/pipe/i915simple/i915_texture.c @@ -490,15 +490,11 @@ i915_texture_create(struct pipe_context *pipe, struct pipe_texture **pt) sizeof(struct i915_texture) - sizeof(struct pipe_texture)); if (i915->flags.is_i945 ? i945_miptree_layout(pipe, tex) : - i915_miptree_layout(pipe, tex)) { - tex->buffer = pipe->winsys->buffer_create(pipe->winsys, 64, 0, 0); - - if (tex->buffer) - pipe->winsys->buffer_data(pipe->winsys, tex->buffer, - tex->pitch * tex->base.cpp * - tex->total_height, NULL, - PIPE_BUFFER_USAGE_PIXEL); - } + i915_miptree_layout(pipe, tex)) + tex->buffer = pipe->winsys->buffer_create(pipe->winsys, 64, + PIPE_BUFFER_USAGE_PIXEL, + tex->pitch * tex->base.cpp * + tex->total_height); if (!tex->buffer) { FREE(tex); |