diff options
-rw-r--r-- | src/gallium/auxiliary/vl/vl_compositor.c | 3 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c | 29 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_video_context.c | 40 | ||||
-rw-r--r-- | src/gallium/winsys/g3dvl/xlib/xsp_winsys.c | 2 |
4 files changed, 44 insertions, 30 deletions
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c index 0640b1a4565..01d09602558 100644 --- a/src/gallium/auxiliary/vl/vl_compositor.c +++ b/src/gallium/auxiliary/vl/vl_compositor.c @@ -26,6 +26,7 @@ **************************************************************************/ #include "vl_compositor.h" +#include "util/u_draw.h" #include <assert.h> #include <pipe/p_context.h> #include <util/u_inlines.h> @@ -555,7 +556,7 @@ static void draw_layers(struct vl_compositor *c, c->pipe->bind_fs_state(c->pipe, frag_shaders[i]); c->pipe->set_fragment_sampler_views(c->pipe, 1, &surface_view); - c->pipe->draw_arrays(c->pipe, PIPE_PRIM_TRIANGLES, i * 6, 6); + util_draw_arrays(c->pipe, PIPE_PRIM_TRIANGLES, i * 6, 6); if (delete_view) { pipe_sampler_view_reference(&surface_view, NULL); diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c index e9024e4a409..855841722c4 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c @@ -26,6 +26,7 @@ **************************************************************************/ #include "vl_mpeg12_mc_renderer.h" +#include "util/u_draw.h" #include <assert.h> #include <pipe/p_context.h> #include <util/u_inlines.h> @@ -1074,8 +1075,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->i_vs); r->pipe->bind_fs_state(r->pipe, r->i_fs); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_INTRA] * 24); + util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, + num_macroblocks[MACROBLOCK_TYPE_INTRA] * 24); vb_start += num_macroblocks[MACROBLOCK_TYPE_INTRA] * 24; } @@ -1089,8 +1090,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->p_vs[0]); r->pipe->bind_fs_state(r->pipe, r->p_fs[0]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] * 24); + util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, + num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] * 24); vb_start += num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] * 24; } @@ -1104,8 +1105,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->p_vs[1]); r->pipe->bind_fs_state(r->pipe, r->p_fs[1]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] * 24); + util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, + num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] * 24); vb_start += num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] * 24; } @@ -1119,8 +1120,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->p_vs[0]); r->pipe->bind_fs_state(r->pipe, r->p_fs[0]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_BKWD_FRAME_PRED] * 24); + util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, + num_macroblocks[MACROBLOCK_TYPE_BKWD_FRAME_PRED] * 24); vb_start += num_macroblocks[MACROBLOCK_TYPE_BKWD_FRAME_PRED] * 24; } @@ -1134,8 +1135,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->p_vs[1]); r->pipe->bind_fs_state(r->pipe, r->p_fs[1]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_BKWD_FIELD_PRED] * 24); + util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, + num_macroblocks[MACROBLOCK_TYPE_BKWD_FIELD_PRED] * 24); vb_start += num_macroblocks[MACROBLOCK_TYPE_BKWD_FIELD_PRED] * 24; } @@ -1151,8 +1152,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->b_vs[0]); r->pipe->bind_fs_state(r->pipe, r->b_fs[0]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_BI_FRAME_PRED] * 24); + util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, + num_macroblocks[MACROBLOCK_TYPE_BI_FRAME_PRED] * 24); vb_start += num_macroblocks[MACROBLOCK_TYPE_BI_FRAME_PRED] * 24; } @@ -1168,8 +1169,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->b_vs[1]); r->pipe->bind_fs_state(r->pipe, r->b_fs[1]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_BI_FIELD_PRED] * 24); + util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, + num_macroblocks[MACROBLOCK_TYPE_BI_FIELD_PRED] * 24); vb_start += num_macroblocks[MACROBLOCK_TYPE_BI_FIELD_PRED] * 24; } diff --git a/src/gallium/drivers/softpipe/sp_video_context.c b/src/gallium/drivers/softpipe/sp_video_context.c index 44df00e0b78..11082109cfc 100644 --- a/src/gallium/drivers/softpipe/sp_video_context.c +++ b/src/gallium/drivers/softpipe/sp_video_context.c @@ -33,6 +33,7 @@ #include <util/u_memory.h> #include <util/u_rect.h> #include <util/u_video.h> +#include <util/u_surface.h> #include "sp_public.h" #include "sp_texture.h" @@ -97,8 +98,8 @@ sp_mpeg12_is_format_supported(struct pipe_video_context *vpipe, if (geom & PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO) return FALSE; - return ctx->pipe->screen->is_format_supported(ctx->pipe->screen, PIPE_TEXTURE_2D, - format, usage, geom); + return ctx->pipe->screen->is_format_supported(ctx->pipe->screen, format, PIPE_TEXTURE_2D, + 0, usage, geom); } static void @@ -132,14 +133,15 @@ sp_mpeg12_surface_fill(struct pipe_video_context *vpipe, unsigned value) { struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe; + float rgba[4] = { 0, 0, 0, 0 }; assert(vpipe); assert(dst); - if (ctx->pipe->surface_fill) - ctx->pipe->surface_fill(ctx->pipe, dst, dstx, dsty, width, height, value); + if (ctx->pipe->clear_render_target) + ctx->pipe->clear_render_target(ctx->pipe, dst, rgba, dstx, dsty, width, height); else - util_surface_fill(ctx->pipe, dst, dstx, dsty, width, height, value); + util_clear_render_target(ctx->pipe, dst, rgba, dstx, dsty, width, height); } static void @@ -155,10 +157,20 @@ sp_mpeg12_surface_copy(struct pipe_video_context *vpipe, assert(vpipe); assert(dst); - if (ctx->pipe->surface_copy) - ctx->pipe->surface_copy(ctx->pipe, dst, dstx, dsty, src, srcx, srcy, width, height); + struct pipe_subresource subdst, subsrc; + subdst.face = dst->face; + subdst.level = dst->level; + subsrc.face = src->face; + subsrc.level = src->level; + + if (ctx->pipe->resource_copy_region) + ctx->pipe->resource_copy_region(ctx->pipe, dst->texture, subdst, dstx, dsty, dst->zslice, + src->texture, subsrc, srcx, srcy, src->zslice, + width, height); else - util_surface_copy(ctx->pipe, FALSE, dst, dstx, dsty, src, srcx, srcy, width, height); + util_resource_copy_region(ctx->pipe, dst->texture, subdst, dstx, dsty, dst->zslice, + src->texture, subsrc, srcx, srcy, src->zslice, + width, height); } static struct pipe_transfer* @@ -339,12 +351,12 @@ init_pipe_state(struct sp_mpeg12_context *ctx) rast.flatshade = 1; rast.flatshade_first = 0; rast.light_twoside = 0; - rast.front_winding = PIPE_WINDING_CCW; - rast.cull_mode = PIPE_WINDING_CW; - rast.fill_cw = PIPE_POLYGON_MODE_FILL; - rast.fill_ccw = PIPE_POLYGON_MODE_FILL; - rast.offset_cw = 0; - rast.offset_ccw = 0; + rast.front_ccw = 1; + rast.cull_face = PIPE_FACE_NONE; + rast.fill_back = PIPE_POLYGON_MODE_FILL; + rast.fill_front = PIPE_POLYGON_MODE_FILL; + rast.offset_point = 0; + rast.offset_line = 0; rast.scissor = 0; rast.poly_smooth = 0; rast.poly_stipple_enable = 0; diff --git a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c index 0a7f324a77c..cc80583f088 100644 --- a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c +++ b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c @@ -82,7 +82,7 @@ vl_drawable_surface_get(struct vl_screen *vscreen, Drawable drawable) templat.height0 = height; templat.depth0 = 1; templat.usage = PIPE_USAGE_DEFAULT; - templat.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_BLIT_SOURCE; + templat.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET; templat.flags = 0; drawable_tex = vscreen->pscreen->resource_create(vscreen->pscreen, &templat); |