summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_texture.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-05-02 16:46:31 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-05-02 16:46:31 +0100
commita73ae3d5eb8419feab5aea26573aa41b72f941eb (patch)
tree74fa3e6004be0ef5d266680bd57c2fccec521a4e /src/mesa/state_tracker/st_cb_texture.c
parent4a159132082429d5492f5298c2ccb0df551c9f65 (diff)
gallium: Add texture usage flags, special-case allocation of display targets
For many envirionments it's necessary to allocate display targets in a window-system friendly manner. Add facilities so that a driver can tell if a texture is likely to be used to generate a display surface and if use special allocation paths if necessary. Hook up softpipe to call into the winsys->surface_alloc_storage() routine in this case, though we probably want to change that interface slightly also.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 4cca3364c1..06caa06e77 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -333,7 +333,9 @@ guess_and_alloc_texture(struct st_context *st,
width,
height,
depth,
- comp_byte);
+ comp_byte,
+ ( PIPE_TEXTURE_USAGE_RENDER_TARGET |
+ PIPE_TEXTURE_USAGE_SAMPLER ));
DBG("%s - success\n", __FUNCTION__);
}
@@ -1501,7 +1503,11 @@ st_finalize_texture(GLcontext *ctx,
firstImage->base.Width2,
firstImage->base.Height2,
firstImage->base.Depth2,
- comp_byte);
+ comp_byte,
+
+ ( PIPE_TEXTURE_USAGE_RENDER_TARGET |
+ PIPE_TEXTURE_USAGE_SAMPLER ));
+
if (!stObj->pt) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
return GL_FALSE;