diff options
author | Jakob Bornecrantz <wallbraker@gmail.com> | 2011-02-25 21:36:49 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-02-26 14:58:44 +0100 |
commit | 5642eeb6a61792f3f999213dd6f42548ad244cb0 (patch) | |
tree | 4bfda65c2f8e6fedf3a5f6bec1367b3f2a6b3898 | |
parent | 5d864032c3e4e3277bb393fb4b96d2ea74e02ae2 (diff) |
st/mesa: Route texture usage from bitmap down into the driver
Use the new USAGE_ONCE flag to tell the driver its a once shot resource.
-rw-r--r-- | src/mesa/state_tracker/st_atom_pixeltransfer.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_bitmap.c | 14 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 6 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_gen_mipmap.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_texture.c | 5 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_texture.h | 3 |
7 files changed, 24 insertions, 13 deletions
diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index 739a2eaab7..f925b77b52 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -99,7 +99,8 @@ create_color_map_texture(struct gl_context *ctx) /* create texture for color map/table */ pt = st_texture_create(st, PIPE_TEXTURE_2D, format, 0, - texSize, texSize, 1, 1, PIPE_BIND_SAMPLER_VIEW); + texSize, texSize, 1, 1, + PIPE_BIND_SAMPLER_VIEW, PIPE_USAGE_DEFAULT); return pt; } diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 0ea5671557..6d25c9230a 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -275,9 +275,11 @@ make_bitmap_texture(struct gl_context *ctx, GLsizei width, GLsizei height, /** * Create texture to hold bitmap pattern. */ - pt = st_texture_create(st, st->internal_target, st->bitmap.tex_format, - 0, width, height, 1, 1, - PIPE_BIND_SAMPLER_VIEW); + pt = st_texture_create(st, st->internal_target, + st->bitmap.tex_format, 0, + width, height, 1, 1, + PIPE_BIND_SAMPLER_VIEW, + PIPE_USAGE_ONCE); if (!pt) { _mesa_unmap_pbo_source(ctx, unpack); return NULL; @@ -561,9 +563,11 @@ reset_cache(struct st_context *st) /* allocate a new texture */ cache->texture = st_texture_create(st, PIPE_TEXTURE_2D, st->bitmap.tex_format, 0, - BITMAP_CACHE_WIDTH, BITMAP_CACHE_HEIGHT, + BITMAP_CACHE_WIDTH, + BITMAP_CACHE_HEIGHT, 1, 1, - PIPE_BIND_SAMPLER_VIEW); + PIPE_BIND_SAMPLER_VIEW, + PIPE_USAGE_ONCE); } diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index c0da169624..9697507120 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -343,7 +343,8 @@ alloc_texture(struct st_context *st, GLsizei width, GLsizei height, struct pipe_resource *pt; pt = st_texture_create(st, st->internal_target, texFormat, 0, - width, height, 1, 1, PIPE_BIND_SAMPLER_VIEW); + width, height, 1, 1, + PIPE_BIND_SAMPLER_VIEW, PIPE_USAGE_ONCE); return pt; } diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 08c498b149..b8977b810f 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -390,7 +390,8 @@ guess_and_alloc_texture(struct st_context *st, ptHeight, ptDepth, ptLayers, - bindings); + bindings, + PIPE_USAGE_DEFAULT); DBG("%s returning %d\n", __FUNCTION__, (stObj->pt != NULL)); @@ -1811,7 +1812,8 @@ st_finalize_texture(struct gl_context *ctx, ptHeight, ptDepth, ptLayers, - bindings); + bindings, + PIPE_USAGE_DEFAULT); if (!stObj->pt) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index 4bf6828083..dd4c5080f7 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -356,7 +356,8 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target, oldTex->height0, oldTex->depth0, oldTex->array_size, - oldTex->bind); + oldTex->bind, + PIPE_USAGE_DEFAULT); /* This will copy the old texture's base image into the new texture * which we just allocated. diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 1e0a8323ab..46a299e106 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -60,7 +60,8 @@ st_texture_create(struct st_context *st, GLuint height0, GLuint depth0, GLuint layers, - GLuint bind ) + GLuint bind, + GLuint usage) { struct pipe_resource pt, *newtex; struct pipe_screen *screen = st->pipe->screen; @@ -88,7 +89,7 @@ st_texture_create(struct st_context *st, pt.height0 = height0; pt.depth0 = depth0; pt.array_size = (target == PIPE_TEXTURE_CUBE ? 6 : layers); - pt.usage = PIPE_USAGE_DEFAULT; + pt.usage = usage; pt.bind = bind; pt.flags = 0; diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h index d50c3c9af7..63e02cfd6c 100644 --- a/src/mesa/state_tracker/st_texture.h +++ b/src/mesa/state_tracker/st_texture.h @@ -172,7 +172,8 @@ st_texture_create(struct st_context *st, GLuint height0, GLuint depth0, GLuint layers, - GLuint tex_usage ); + GLuint bind, + GLuint usage); extern void |