summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-02-06 09:24:30 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-02-06 09:35:39 -0700
commit31c98eafb043cbc82e5de206ceecc5888174b5e6 (patch)
treefbce72265efd094a696c2ee99e9c962870a057ca /src/mesa/state_tracker/st_texture.c
parentf52f5136e6eed23e55098681e5b082cc452136d6 (diff)
gallium: change pipe->texture_create() to operate like the CSO functions
Now, pass in a template object and return a new object.
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 741f36c2a7..844a9f80d8 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);
}