diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-03-04 11:58:48 +0100 |
---|---|---|
committer | Michel Dänzer <daenzer@vmware.com> | 2009-03-04 11:58:48 +0100 |
commit | 5e27cd46c04a9e7b5904cc014bffd0f4daae31fe (patch) | |
tree | a57289f14d69f1977dfaee592af908052d726b8c /src/gallium/state_trackers/g3dvl | |
parent | 60041203d5847de8ab71842a6ce5d33d96cc4930 (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/state_trackers/g3dvl')
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_basic_csc.c | 6 | ||||
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c index 187a13a560..38cfd5d7f1 100644 --- a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c +++ b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c @@ -237,10 +237,10 @@ static int vlDestroy pipe->delete_fs_state(pipe, basic_csc->fragment_shader); for (i = 0; i < 2; ++i) - pipe_buffer_reference(pipe->screen, &basic_csc->vertex_bufs[i].buffer, NULL); + pipe_buffer_reference(&basic_csc->vertex_bufs[i].buffer, NULL); - pipe_buffer_reference(pipe->screen, &basic_csc->vs_const_buf.buffer, NULL); - pipe_buffer_reference(pipe->screen, &basic_csc->fs_const_buf.buffer, NULL); + pipe_buffer_reference(&basic_csc->vs_const_buf.buffer, NULL); + pipe_buffer_reference(&basic_csc->fs_const_buf.buffer, NULL); FREE(basic_csc); diff --git a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c index 7cd753f736..eb8270ecad 100644 --- a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c +++ b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c @@ -636,7 +636,7 @@ static int vlFlush for (i = 0; i < 3; ++i) { pipe->screen->transfer_unmap(pipe->screen, mc->tex_transfer[i]); - pipe->screen->tex_transfer_release(pipe->screen, &mc->tex_transfer[i]); + pipe->screen->tex_transfer_destroy(mc->tex_transfer[i]); } mc->render_target.cbufs[0] = pipe->screen->get_tex_surface @@ -856,7 +856,7 @@ static int vlDestroy pipe->delete_sampler_state(pipe, mc->samplers.all[i]); for (i = 0; i < 3; ++i) - pipe_buffer_reference(pipe->screen, &mc->vertex_bufs.all[i].buffer, NULL); + pipe_buffer_reference(&mc->vertex_bufs.all[i].buffer, NULL); /* Textures 3 & 4 are not created directly, no need to release them here */ for (i = 0; i < 3; ++i) @@ -873,8 +873,8 @@ static int vlDestroy pipe->delete_fs_state(pipe, mc->b_fs[i]); } - pipe_buffer_reference(pipe->screen, &mc->vs_const_buf.buffer, NULL); - pipe_buffer_reference(pipe->screen, &mc->fs_const_buf.buffer, NULL); + pipe_buffer_reference(&mc->vs_const_buf.buffer, NULL); + pipe_buffer_reference(&mc->fs_const_buf.buffer, NULL); FREE(mc->macroblocks); FREE(mc); |