summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/i965simple
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/i965simple
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/i965simple')
-rw-r--r--src/mesa/pipe/i965simple/brw_tex_layout.c15
-rw-r--r--src/mesa/pipe/i965simple/brw_tex_layout.h4
2 files changed, 9 insertions, 10 deletions
diff --git a/src/mesa/pipe/i965simple/brw_tex_layout.c b/src/mesa/pipe/i965simple/brw_tex_layout.c
index b8b6b579e22..405fd1f7949 100644
--- a/src/mesa/pipe/i965simple/brw_tex_layout.c
+++ b/src/mesa/pipe/i965simple/brw_tex_layout.c
@@ -299,15 +299,14 @@ static boolean brw_miptree_layout(struct pipe_context *pipe, struct brw_texture
return TRUE;
}
-void
-brw_texture_create(struct pipe_context *pipe, struct pipe_texture **pt)
+
+struct pipe_texture *
+brw_texture_create(struct pipe_context *pipe, const struct pipe_texture *templat)
{
- struct brw_texture *tex = REALLOC(*pt, sizeof(struct pipe_texture),
- sizeof(struct brw_texture));
+ struct brw_texture *tex = CALLOC_STRUCT(brw_texture);
if (tex) {
- memset(&tex->base + 1, 0,
- sizeof(struct brw_texture) - sizeof(struct pipe_texture));
+ tex->base = *templat;
if (brw_miptree_layout(pipe, tex))
tex->buffer = pipe->winsys->buffer_create(pipe->winsys, 64,
@@ -317,11 +316,11 @@ brw_texture_create(struct pipe_context *pipe, struct pipe_texture **pt)
if (!tex->buffer) {
FREE(tex);
- tex = NULL;
+ return NULL;
}
}
- *pt = &tex->base;
+ return &tex->base;
}
void
diff --git a/src/mesa/pipe/i965simple/brw_tex_layout.h b/src/mesa/pipe/i965simple/brw_tex_layout.h
index 15e275058af..cfd6b1ef3ae 100644
--- a/src/mesa/pipe/i965simple/brw_tex_layout.h
+++ b/src/mesa/pipe/i965simple/brw_tex_layout.h
@@ -6,8 +6,8 @@
struct pipe_context;
struct pipe_texture;
-extern void
-brw_texture_create(struct pipe_context *pipe, struct pipe_texture **pt);
+extern struct pipe_texture *
+brw_texture_create(struct pipe_context *pipe, const struct pipe_texture *templat);
extern void
brw_texture_release(struct pipe_context *pipe, struct pipe_texture **pt);