diff options
author | Brian Paul <[email protected]> | 2012-01-04 13:30:35 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-01-04 13:30:35 -0700 |
commit | 5d67d4fbebb7c7d6582c4c92fc5cea4a8e6a60ab (patch) | |
tree | 164e1c37301429a68ceb58be316bf70326dac179 /src/mesa/state_tracker/st_texture.c | |
parent | 19840c46f38b7bfe04bfaa925a6f56b3777be6ff (diff) |
st/mesa: remove st_TexImage(), use core Mesa code instead
The core Mesa code does the equivalent memory allocation, image mapping,
storing and unmapping. We just need to call prep_teximage() first to
handle the 'surface_based' stuff.
The other change is to always use the level=0 mipmap image when accessing
individual mipmap level images that are stored in resources/buffers.
Apparently, we were always using malloc'd memory for individual mipmap
images, not resource buffers, before.
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r-- | src/mesa/state_tracker/st_texture.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 3323bbbbe4c..132d7a81c63 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -215,12 +215,19 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage, GLuint zoffset, enum pipe_transfer_usage usage, GLuint x, GLuint y, GLuint w, GLuint h) { + struct st_texture_object *stObj = + st_texture_object(stImage->base.TexObject); struct pipe_context *pipe = st->pipe; - struct pipe_resource *pt = stImage->pt; + GLuint level; DBG("%s \n", __FUNCTION__); - stImage->transfer = pipe_get_transfer(st->pipe, pt, stImage->base.Level, + if (stObj->pt != stImage->pt) + level = 0; + else + level = stImage->base.Level; + + stImage->transfer = pipe_get_transfer(st->pipe, stImage->pt, level, stImage->base.Face + zoffset, usage, x, y, w, h); |