summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}