aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/cell/ppu
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-02-06 09:24:30 -0700
committerBrian <[email protected]>2008-02-06 09:35:39 -0700
commit31c98eafb043cbc82e5de206ceecc5888174b5e6 (patch)
treefbce72265efd094a696c2ee99e9c962870a057ca /src/mesa/pipe/cell/ppu
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/pipe/cell/ppu')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_texture.c31
-rw-r--r--src/mesa/pipe/cell/ppu/cell_texture.h5
2 files changed, 18 insertions, 18 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_texture.c b/src/mesa/pipe/cell/ppu/cell_texture.c
index 2cf60229394..df178d9ca24 100644
--- a/src/mesa/pipe/cell/ppu/cell_texture.c
+++ b/src/mesa/pipe/cell/ppu/cell_texture.c
@@ -79,31 +79,30 @@ cell_texture_layout(struct cell_texture * spt)
}
-void
-cell_texture_create(struct pipe_context *pipe, struct pipe_texture **pt)
+struct pipe_texture *
+cell_texture_create(struct pipe_context *pipe, const struct pipe_texture *templat)
{
- struct cell_texture *spt = REALLOC(*pt, sizeof(struct pipe_texture),
- sizeof(struct cell_texture));
+ struct cell_texture *spt = CALLOC_STRUCT(cell_texture);
+ if (!spt)
+ return NULL;
- if (spt) {
- memset(&spt->base + 1, 0,
- sizeof(struct cell_texture) - sizeof(struct pipe_texture));
+ spt->base = *templat;
- cell_texture_layout(spt);
+ cell_texture_layout(spt);
- spt->buffer = pipe->winsys->buffer_create(pipe->winsys, 32,
- PIPE_BUFFER_USAGE_PIXEL,
- spt->buffer_size);
+ spt->buffer = pipe->winsys->buffer_create(pipe->winsys, 32,
+ PIPE_BUFFER_USAGE_PIXEL,
+ spt->buffer_size);
- if (!spt->buffer) {
- FREE(spt);
- spt = NULL;
- }
+ if (!spt->buffer) {
+ FREE(spt);
+ return NULL;
}
- *pt = &spt->base;
+ return &spt->base;
}
+
void
cell_texture_release(struct pipe_context *pipe, struct pipe_texture **pt)
{
diff --git a/src/mesa/pipe/cell/ppu/cell_texture.h b/src/mesa/pipe/cell/ppu/cell_texture.h
index bd434c87762..0264fed88e6 100644
--- a/src/mesa/pipe/cell/ppu/cell_texture.h
+++ b/src/mesa/pipe/cell/ppu/cell_texture.h
@@ -60,8 +60,9 @@ cell_texture(struct pipe_texture *pt)
-extern void
-cell_texture_create(struct pipe_context *pipe, struct pipe_texture **pt);
+extern struct pipe_texture *
+cell_texture_create(struct pipe_context *pipe,
+ const struct pipe_texture *templat);
extern void
cell_texture_release(struct pipe_context *pipe, struct pipe_texture **pt);