diff options
| author | Brian <brian.paul@tungstengraphics.com> | 2008-02-06 09:24:30 -0700 |
|---|---|---|
| committer | Ben Skeggs <skeggsb@gmail.com> | 2008-02-15 13:50:32 +1100 |
| commit | 64ca0678eeeb39831fcfb309ac48561b1981d360 (patch) | |
| tree | 532bdbb66b0af7c04de62b08cfe5c121cdf75832 /src/mesa/state_tracker | |
| parent | 20f16a6ae44f55c2efa03a2c9deb07b66fe1b0e0 (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')
| -rw-r--r-- | src/mesa/state_tracker/st_texture.c | 29 |
1 files changed, 12 insertions, 17 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); + 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 pt; + return st->pipe->texture_create(st->pipe, &pt); } |
