diff options
author | Christian König <[email protected]> | 2010-12-07 00:29:02 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2010-12-07 00:29:02 +0100 |
commit | eb7452e267974f9ff971b752046c512963f59f81 (patch) | |
tree | 3dc9d420e235df30332b85883cc3a20241cb09bc /src/gallium/drivers/softpipe | |
parent | 6484898752d733a2442b433fbb78325f9021c698 (diff) |
[g3dvl] rework pot buffer handling and flushing
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_video_context.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gallium/drivers/softpipe/sp_video_context.c b/src/gallium/drivers/softpipe/sp_video_context.c index 3edab823677..35636d8475c 100644 --- a/src/gallium/drivers/softpipe/sp_video_context.c +++ b/src/gallium/drivers/softpipe/sp_video_context.c @@ -282,6 +282,8 @@ sp_mpeg12_render_picture(struct pipe_video_context *vpipe, assert(dst_surface); assert(dst_area); + vl_mpeg12_mc_renderer_flush(&ctx->mc_renderer); + vl_compositor_render(&ctx->compositor, src_surface, picture_type, src_area, dst_surface, dst_area, fence); } @@ -325,7 +327,10 @@ sp_mpeg12_set_decode_target(struct pipe_video_context *vpipe, assert(vpipe); assert(dt); - pipe_surface_reference(&ctx->decode_target, dt); + if (ctx->decode_target != dt) { + vl_mpeg12_mc_renderer_flush(&ctx->mc_renderer); + pipe_surface_reference(&ctx->decode_target, dt); + } } static void @@ -426,6 +431,7 @@ sp_mpeg12_create(struct pipe_context *pipe, enum pipe_video_profile profile, bool pot_buffers, enum pipe_format decode_format) { + unsigned buffer_width, buffer_height; struct sp_mpeg12_context *ctx; assert(u_reduce_video_profile(profile) == PIPE_VIDEO_CODEC_MPEG12); @@ -435,6 +441,12 @@ sp_mpeg12_create(struct pipe_context *pipe, enum pipe_video_profile profile, if (!ctx) return NULL; + /* TODO: Non-pot buffers untested, probably doesn't work without changes to texcoord generation, vert shader, etc */ + assert(pot_buffers); + + buffer_width = pot_buffers ? util_next_power_of_two(width) : width; + buffer_height = pot_buffers ? util_next_power_of_two(height) : height; + ctx->base.profile = profile; ctx->base.chroma_format = chroma_format; ctx->base.width = width; @@ -464,8 +476,8 @@ sp_mpeg12_create(struct pipe_context *pipe, enum pipe_video_profile profile, ctx->decode_format = decode_format; if (!vl_mpeg12_mc_renderer_init(&ctx->mc_renderer, ctx->pipe, - width, height, chroma_format, - bufmode, pot_buffers)) { + buffer_width, buffer_height, chroma_format, + bufmode)) { ctx->pipe->destroy(ctx->pipe); FREE(ctx); return NULL; |