basic_csc->viewport.translate[3] = 0;
if (basic_csc->framebuffer_tex)
- pipe_texture_release(&basic_csc->framebuffer_tex);
+ {
+ pipe_surface_reference(&basic_csc->framebuffer.cbufs[0], NULL);
+ pipe_texture_reference(&basic_csc->framebuffer_tex, NULL);
+ }
memset(&template, 0, sizeof(struct pipe_texture));
template.target = PIPE_TEXTURE_2D;
basic_csc = (struct vlBasicCSC*)csc;
pipe = basic_csc->pipe;
- vs_consts = pipe->winsys->buffer_map
+ vs_consts = pipe_buffer_map
(
- pipe->winsys,
+ pipe->screen,
basic_csc->vs_const_buf.buffer,
PIPE_BUFFER_USAGE_CPU_WRITE | PIPE_BUFFER_USAGE_DISCARD
);
vs_consts->src_trans.z = 0;
vs_consts->src_trans.w = 0;
- pipe->winsys->buffer_unmap(pipe->winsys, basic_csc->vs_const_buf.buffer);
+ pipe_buffer_unmap(pipe->screen, basic_csc->vs_const_buf.buffer);
pipe->set_sampler_textures(pipe, 1, &surface->texture);
pipe->draw_arrays(pipe, PIPE_PRIM_TRIANGLE_STRIP, 0, 4);
pipe = basic_csc->pipe;
if (basic_csc->framebuffer_tex)
- pipe_texture_release(&basic_csc->framebuffer_tex);
+ {
+ pipe_surface_reference(&basic_csc->framebuffer.cbufs[0], NULL);
+ pipe_texture_reference(&basic_csc->framebuffer_tex, NULL);
+ }
pipe->delete_sampler_state(pipe, basic_csc->sampler);
pipe->delete_vs_state(pipe, basic_csc->vertex_shader);
pipe->delete_fs_state(pipe, basic_csc->fragment_shader);
for (i = 0; i < 2; ++i)
- pipe->winsys->buffer_destroy(pipe->winsys, basic_csc->vertex_bufs[i].buffer);
+ pipe_buffer_reference(pipe->screen, &basic_csc->vertex_bufs[i].buffer, NULL);
- pipe->winsys->buffer_destroy(pipe->winsys, basic_csc->vs_const_buf.buffer);
- pipe->winsys->buffer_destroy(pipe->winsys, basic_csc->fs_const_buf.buffer);
+ pipe_buffer_reference(pipe->screen, &basic_csc->vs_const_buf.buffer, NULL);
+ pipe_buffer_reference(pipe->screen, &basic_csc->fs_const_buf.buffer, NULL);
FREE(basic_csc);
csc->vertex_bufs[0].pitch = sizeof(struct vlVertex2f);
csc->vertex_bufs[0].max_index = 3;
csc->vertex_bufs[0].buffer_offset = 0;
- csc->vertex_bufs[0].buffer = pipe->winsys->buffer_create
+ csc->vertex_bufs[0].buffer = pipe_buffer_create
(
- pipe->winsys,
+ pipe->screen,
1,
PIPE_BUFFER_USAGE_VERTEX,
sizeof(struct vlVertex2f) * 4
memcpy
(
- pipe->winsys->buffer_map(pipe->winsys, csc->vertex_bufs[0].buffer, PIPE_BUFFER_USAGE_CPU_WRITE),
+ pipe_buffer_map(pipe->screen, csc->vertex_bufs[0].buffer, PIPE_BUFFER_USAGE_CPU_WRITE),
surface_verts,
sizeof(struct vlVertex2f) * 4
);
- pipe->winsys->buffer_unmap(pipe->winsys, csc->vertex_bufs[0].buffer);
+ pipe_buffer_unmap(pipe->screen, csc->vertex_bufs[0].buffer);
csc->vertex_elems[0].src_offset = 0;
csc->vertex_elems[0].vertex_buffer_index = 0;
csc->vertex_bufs[1].pitch = sizeof(struct vlVertex2f);
csc->vertex_bufs[1].max_index = 3;
csc->vertex_bufs[1].buffer_offset = 0;
- csc->vertex_bufs[1].buffer = pipe->winsys->buffer_create
+ csc->vertex_bufs[1].buffer = pipe_buffer_create
(
- pipe->winsys,
+ pipe->screen,
1,
PIPE_BUFFER_USAGE_VERTEX,
sizeof(struct vlVertex2f) * 4
memcpy
(
- pipe->winsys->buffer_map(pipe->winsys, csc->vertex_bufs[1].buffer, PIPE_BUFFER_USAGE_CPU_WRITE),
+ pipe_buffer_map(pipe->screen, csc->vertex_bufs[1].buffer, PIPE_BUFFER_USAGE_CPU_WRITE),
surface_texcoords,
sizeof(struct vlVertex2f) * 4
);
- pipe->winsys->buffer_unmap(pipe->winsys, csc->vertex_bufs[1].buffer);
+ pipe_buffer_unmap(pipe->screen, csc->vertex_bufs[1].buffer);
csc->vertex_elems[1].src_offset = 0;
csc->vertex_elems[1].vertex_buffer_index = 1;
* Const buffer contains scaling and translation vectors
*/
csc->vs_const_buf.size = sizeof(struct vlVertexShaderConsts);
- csc->vs_const_buf.buffer = pipe->winsys->buffer_create
+ csc->vs_const_buf.buffer = pipe_buffer_create
(
- pipe->winsys,
+ pipe->screen,
1,
PIPE_BUFFER_USAGE_CONSTANT | PIPE_BUFFER_USAGE_DISCARD,
csc->vs_const_buf.size
* Const buffer contains the color conversion matrix and bias vectors
*/
csc->fs_const_buf.size = sizeof(struct vlFragmentShaderConsts);
- csc->fs_const_buf.buffer = pipe->winsys->buffer_create
+ csc->fs_const_buf.buffer = pipe_buffer_create
(
- pipe->winsys,
+ pipe->screen,
1,
PIPE_BUFFER_USAGE_CONSTANT,
csc->fs_const_buf.size
*/
memcpy
(
- pipe->winsys->buffer_map(pipe->winsys, csc->fs_const_buf.buffer, PIPE_BUFFER_USAGE_CPU_WRITE),
+ pipe_buffer_map(pipe->screen, csc->fs_const_buf.buffer, PIPE_BUFFER_USAGE_CPU_WRITE),
&bt_601_full,
sizeof(struct vlFragmentShaderConsts)
);
- pipe->winsys->buffer_unmap(pipe->winsys, csc->fs_const_buf.buffer);
+ pipe_buffer_unmap(pipe->screen, csc->fs_const_buf.buffer);
return 0;
}
struct vlMacroBlockVertexStream0 *ycbcr_vb;
struct vlVertex2f *ref_vb[2];
- ycbcr_vb = (struct vlMacroBlockVertexStream0*)mc->pipe->winsys->buffer_map
+ ycbcr_vb = (struct vlMacroBlockVertexStream0*)pipe_buffer_map
(
- mc->pipe->winsys,
+ pipe->screen,
mc->vertex_bufs.ycbcr.buffer,
PIPE_BUFFER_USAGE_CPU_WRITE | PIPE_BUFFER_USAGE_DISCARD
);
for (i = 0; i < 2; ++i)
- ref_vb[i] = (struct vlVertex2f*)mc->pipe->winsys->buffer_map
+ ref_vb[i] = (struct vlVertex2f*)pipe_buffer_map
(
- mc->pipe->winsys,
+ pipe->screen,
mc->vertex_bufs.ref[i].buffer,
PIPE_BUFFER_USAGE_CPU_WRITE | PIPE_BUFFER_USAGE_DISCARD
);
offset[mb_type_ex]++;
}
- mc->pipe->winsys->buffer_unmap(mc->pipe->winsys, mc->vertex_bufs.ycbcr.buffer);
+ pipe_buffer_unmap(pipe->screen, mc->vertex_bufs.ycbcr.buffer);
for (i = 0; i < 2; ++i)
- mc->pipe->winsys->buffer_unmap(mc->pipe->winsys, mc->vertex_bufs.ref[i].buffer);
+ pipe_buffer_unmap(pipe->screen, mc->vertex_bufs.ref[i].buffer);
}
for (i = 0; i < 3; ++i)
{
pipe_surface_unmap(mc->tex_surface[i]);
- mc->pipe->screen->tex_surface_release(mc->pipe->screen, &mc->tex_surface[i]);
+ pipe_surface_reference(&mc->tex_surface[i], NULL);
}
mc->render_target.cbufs[0] = pipe->screen->get_tex_surface
vs_consts->denorm.x = mc->buffered_surface->texture->width[0];
vs_consts->denorm.y = mc->buffered_surface->texture->height[0];
- pipe->winsys->buffer_unmap(pipe->winsys, mc->vs_const_buf.buffer);
+ pipe_buffer_unmap(pipe->screen, mc->vs_const_buf.buffer);
pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 0, &mc->vs_const_buf);
pipe->set_constant_buffer(pipe, PIPE_SHADER_FRAGMENT, 0, &mc->fs_const_buf);
}
pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, &mc->buffered_surface->render_fence);
- pipe->screen->tex_surface_release(pipe->screen, &mc->render_target.cbufs[0]);
+ pipe_surface_reference(&mc->render_target.cbufs[0], NULL);
for (i = 0; i < 3; ++i)
mc->zero_block[i].x = -1.0f;
pipe->delete_sampler_state(pipe, mc->samplers.all[i]);
for (i = 0; i < 3; ++i)
- pipe->winsys->buffer_destroy(pipe->winsys, mc->vertex_bufs.all[i].buffer);
+ pipe_buffer_reference(pipe->screen, &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)
- pipe_texture_release(&mc->textures.all[i]);
+ pipe_texture_reference(&mc->textures.all[i], NULL);
pipe->delete_vs_state(pipe, mc->i_vs);
pipe->delete_fs_state(pipe, mc->i_fs);
pipe->delete_fs_state(pipe, mc->b_fs[i]);
}
- pipe->winsys->buffer_destroy(pipe->winsys, mc->vs_const_buf.buffer);
- pipe->winsys->buffer_destroy(pipe->winsys, mc->fs_const_buf.buffer);
+ pipe_buffer_reference(pipe->screen, &mc->vs_const_buf.buffer, NULL);
+ pipe_buffer_reference(pipe->screen, &mc->fs_const_buf.buffer, NULL);
FREE(mc->macroblocks);
FREE(mc);
mc->vertex_bufs.ycbcr.pitch = sizeof(struct vlVertex2f) * 4;
mc->vertex_bufs.ycbcr.max_index = 24 * mc->macroblocks_per_picture - 1;
mc->vertex_bufs.ycbcr.buffer_offset = 0;
- mc->vertex_bufs.ycbcr.buffer = pipe->winsys->buffer_create
+ mc->vertex_bufs.ycbcr.buffer = pipe_buffer_create
(
- pipe->winsys,
+ pipe->screen,
DEFAULT_BUF_ALIGNMENT,
PIPE_BUFFER_USAGE_VERTEX | PIPE_BUFFER_USAGE_DISCARD,
sizeof(struct vlVertex2f) * 4 * 24 * mc->macroblocks_per_picture
mc->vertex_bufs.all[i].pitch = sizeof(struct vlVertex2f) * 2;
mc->vertex_bufs.all[i].max_index = 24 * mc->macroblocks_per_picture - 1;
mc->vertex_bufs.all[i].buffer_offset = 0;
- mc->vertex_bufs.all[i].buffer = pipe->winsys->buffer_create
+ mc->vertex_bufs.all[i].buffer = pipe_buffer_create
(
- pipe->winsys,
+ pipe->screen,
DEFAULT_BUF_ALIGNMENT,
PIPE_BUFFER_USAGE_VERTEX | PIPE_BUFFER_USAGE_DISCARD,
sizeof(struct vlVertex2f) * 2 * 24 * mc->macroblocks_per_picture
/* Create our constant buffer */
mc->vs_const_buf.size = sizeof(struct vlVertexShaderConsts);
- mc->vs_const_buf.buffer = pipe->winsys->buffer_create
+ mc->vs_const_buf.buffer = pipe_buffer_create
(
- pipe->winsys,
+ pipe->screen,
DEFAULT_BUF_ALIGNMENT,
PIPE_BUFFER_USAGE_CONSTANT | PIPE_BUFFER_USAGE_DISCARD,
mc->vs_const_buf.size
);
mc->fs_const_buf.size = sizeof(struct vlFragmentShaderConsts);
- mc->fs_const_buf.buffer = pipe->winsys->buffer_create
+ mc->fs_const_buf.buffer = pipe_buffer_create
(
- pipe->winsys,
+ pipe->screen,
DEFAULT_BUF_ALIGNMENT,
PIPE_BUFFER_USAGE_CONSTANT,
mc->fs_const_buf.size
memcpy
(
- pipe->winsys->buffer_map(pipe->winsys, mc->fs_const_buf.buffer, PIPE_BUFFER_USAGE_CPU_WRITE),
+ pipe_buffer_map(pipe->screen, mc->fs_const_buf.buffer, PIPE_BUFFER_USAGE_CPU_WRITE),
&fs_consts,
sizeof(struct vlFragmentShaderConsts)
);
- pipe->winsys->buffer_unmap(pipe->winsys, mc->fs_const_buf.buffer);
+ pipe_buffer_unmap(pipe->screen, mc->fs_const_buf.buffer);
mc->macroblocks = MALLOC(sizeof(struct vlMpeg2MacroBlock) * mc->macroblocks_per_picture);