aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-02-24 08:33:50 -0700
committerBrian Paul <[email protected]>2009-02-24 08:33:50 -0700
commitd6677fd9bc19050c18e0509815123990455b785b (patch)
tree248a9ef1c945cea5c450d7b544d65c7d97908c36 /src/gallium
parent66ddf1a00f7f730831c32b27e46515a0369487ff (diff)
softpipe: minor code movement in softpipe_get_tex_transfer()
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index 28a9784b164..41127101cd1 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -283,14 +283,13 @@ softpipe_get_tex_transfer(struct pipe_screen *screen,
{
struct softpipe_texture *sptex = softpipe_texture(texture);
struct softpipe_transfer *spt;
- struct pipe_transfer *pt;
assert(texture);
assert(level <= texture->last_level);
spt = CALLOC_STRUCT(softpipe_transfer);
- pt = &spt->base;
if (spt) {
+ struct pipe_transfer *pt = &spt->base;
pt->refcount = 1;
pipe_texture_reference(&pt->texture, texture);
pt->format = texture->format;
@@ -302,12 +301,13 @@ softpipe_get_tex_transfer(struct pipe_screen *screen,
pt->nblocksx = texture->nblocksx[level];
pt->nblocksy = texture->nblocksy[level];
pt->stride = sptex->stride[level];
- spt->offset = sptex->level_offset[level];
pt->usage = usage;
pt->face = face;
pt->level = level;
pt->zslice = zslice;
+ spt->offset = sptex->level_offset[level];
+
if (texture->target == PIPE_TEXTURE_CUBE ||
texture->target == PIPE_TEXTURE_3D) {
spt->offset += ((texture->target == PIPE_TEXTURE_CUBE) ? face :
@@ -317,8 +317,9 @@ softpipe_get_tex_transfer(struct pipe_screen *screen,
assert(face == 0);
assert(zslice == 0);
}
+ return pt;
}
- return pt;
+ return NULL;
}