summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_gen_mipmap.c
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-03-04 11:58:48 +0100
committerMichel Dänzer <daenzer@vmware.com>2009-03-04 11:58:48 +0100
commit5e27cd46c04a9e7b5904cc014bffd0f4daae31fe (patch)
treea57289f14d69f1977dfaee592af908052d726b8c /src/gallium/auxiliary/util/u_gen_mipmap.c
parent60041203d5847de8ab71842a6ce5d33d96cc4930 (diff)
gallium: Unify reference counting.
The core reference counting code is centralized in p_refcnt.h. This has some consequences related to struct pipe_buffer: * The screen member of struct pipe_buffer must be initialized, or pipe_buffer_reference() will crash trying to destroy a buffer with reference count 0. u_simple_screen takes care of this, but I may have missed some of the drivers not using it. * Except for rare exceptions deep in winsys code, buffers must always be allocated via pipe_buffer_create() or via screen->*buffer_create() rather than via winsys->*buffer_create().
Diffstat (limited to 'src/gallium/auxiliary/util/u_gen_mipmap.c')
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
index 1857a71dd8..2b675e71b2 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
@@ -39,6 +39,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_shader_tokens.h"
+#include "pipe/p_state.h"
#include "util/u_memory.h"
#include "util/u_draw_quad.h"
@@ -1138,8 +1139,8 @@ make_1d_mipmap(struct gen_mipmap_state *ctx,
screen->transfer_unmap(screen, srcTrans);
screen->transfer_unmap(screen, dstTrans);
- screen->tex_transfer_release(screen, &srcTrans);
- screen->tex_transfer_release(screen, &dstTrans);
+ screen->tex_transfer_destroy(srcTrans);
+ screen->tex_transfer_destroy(dstTrans);
}
}
@@ -1183,8 +1184,8 @@ make_2d_mipmap(struct gen_mipmap_state *ctx,
screen->transfer_unmap(screen, srcTrans);
screen->transfer_unmap(screen, dstTrans);
- screen->tex_transfer_release(screen, &srcTrans);
- screen->tex_transfer_release(screen, &dstTrans);
+ screen->tex_transfer_destroy(srcTrans);
+ screen->tex_transfer_destroy(dstTrans);
}
}
@@ -1228,8 +1229,8 @@ make_3d_mipmap(struct gen_mipmap_state *ctx,
screen->transfer_unmap(screen, srcTrans);
screen->transfer_unmap(screen, dstTrans);
- screen->tex_transfer_release(screen, &srcTrans);
- screen->tex_transfer_release(screen, &dstTrans);
+ screen->tex_transfer_destroy(srcTrans);
+ screen->tex_transfer_destroy(dstTrans);
}
#else
(void) reduce_3d;
@@ -1414,7 +1415,7 @@ util_destroy_gen_mipmap(struct gen_mipmap_state *ctx)
FREE((void*) ctx->vert_shader.tokens);
FREE((void*) ctx->frag_shader.tokens);
- pipe_buffer_reference(pipe->screen, &ctx->vbuf, NULL);
+ pipe_buffer_reference(&ctx->vbuf, NULL);
FREE(ctx);
}
@@ -1426,7 +1427,7 @@ util_destroy_gen_mipmap(struct gen_mipmap_state *ctx)
*/
void util_gen_mipmap_flush( struct gen_mipmap_state *ctx )
{
- pipe_buffer_reference(ctx->pipe->screen, &ctx->vbuf, NULL);
+ pipe_buffer_reference(&ctx->vbuf, NULL);
ctx->vbuf_slot = 0;
}