summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r--src/mesa/state_tracker/st_texture.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 741f36c2a7d..844a9f80d85 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -74,7 +74,7 @@ st_texture_create(struct st_context *st,
GLuint depth0,
GLuint compress_byte)
{
- struct pipe_texture *pt = CALLOC_STRUCT(pipe_texture);
+ struct pipe_texture pt;
assert(target <= PIPE_TEXTURE_CUBE);
@@ -82,25 +82,20 @@ st_texture_create(struct st_context *st,
_mesa_lookup_enum_by_nr(target),
_mesa_lookup_enum_by_nr(format), first_level, last_level);
- if (!pt)
- return NULL;
-
assert(format);
- pt->target = target;
- pt->format = format;
- pt->first_level = first_level;
- pt->last_level = last_level;
- pt->width[0] = width0;
- pt->height[0] = height0;
- pt->depth[0] = depth0;
- pt->compressed = compress_byte ? 1 : 0;
- pt->cpp = pt->compressed ? compress_byte : st_sizeof_format(format);
- pt->refcount = 1;
-
- st->pipe->texture_create(st->pipe, &pt);
-
- return pt;
+ pt.target = target;
+ pt.format = format;
+ pt.first_level = first_level;
+ pt.last_level = last_level;
+ pt.width[0] = width0;
+ pt.height[0] = height0;
+ pt.depth[0] = depth0;
+ pt.compressed = compress_byte ? 1 : 0;
+ pt.cpp = pt.compressed ? compress_byte : st_sizeof_format(format);
+ pt.refcount = 1;
+
+ return st->pipe->texture_create(st->pipe, &pt);
}