static void vg_prepare_blend_texture(struct vg_context *ctx,
                                     struct pipe_sampler_view *src)
{
   struct st_framebuffer *stfb = ctx->draw_buffer;
   struct pipe_context *pipe = ctx->pipe;
   struct pipe_blit_info info;

   vg_context_update_blend_texture_view(ctx, stfb->width, stfb->height);

   memset(&info, 0, sizeof info);
   info.dst.resource = stfb->blend_texture_view->texture;
   info.dst.level = 0;
   info.dst.box.x = 0;
   info.dst.box.y = 0;
   info.dst.box.z = 0;
   info.dst.box.width = stfb->width;
   info.dst.box.height = stfb->height;
   info.dst.box.depth = 1;
   info.dst.format = stfb->blend_texture_view->format;
   info.src.resource = src->texture;
   info.src.level = src->u.tex.first_level;
   info.src.box.x = 0;
   info.src.box.y = 0;
   info.src.box.z = src->u.tex.first_layer;
   info.src.box.width = stfb->width;
   info.src.box.height = stfb->height;
   info.src.box.depth = 1;
   info.src.format = src->format;
   info.mask = PIPE_MASK_RGBA;
   info.filter = PIPE_TEX_MIPFILTER_NEAREST;
   info.scissor_enable = 0;

   pipe->blit(pipe, &info);
}
Esempio n. 2
0
static void vg_prepare_blend_texture(struct vg_context *ctx,
                                     struct pipe_sampler_view *src)
{
   struct st_framebuffer *stfb = ctx->draw_buffer;
   struct pipe_surface *surf;
   struct pipe_surface surf_tmpl;

   vg_context_update_blend_texture_view(ctx, stfb->width, stfb->height);

   memset(&surf_tmpl, 0, sizeof(surf_tmpl));
   u_surface_default_template(&surf_tmpl, stfb->blend_texture_view->texture,
                              PIPE_BIND_RENDER_TARGET);
   surf = ctx->pipe->create_surface(ctx->pipe,
                                    stfb->blend_texture_view->texture,
                                    &surf_tmpl);
   if (surf) {
      util_blit_pixels_tex(ctx->blit,
                           src, 0, 0, stfb->width, stfb->height,
                           surf, 0, 0, stfb->width, stfb->height,
                           0.0, PIPE_TEX_MIPFILTER_NEAREST);

      pipe_surface_reference(&surf, NULL);
   }
}