image->sampler.normalized_coords = 1;
assert(screen->is_format_supported(screen, pformat, PIPE_TEXTURE_2D,
- PIPE_BIND_SAMPLER_VIEW, 0));
+ 0, PIPE_BIND_SAMPLER_VIEW, 0));
memset(&pt, 0, sizeof(pt));
pt.target = PIPE_TEXTURE_2D;
pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
surf = screen->get_tex_surface(screen, image_texture(src), 0, 0, 0,
- PIPE_BIND_BLIT_SOURCE);
+ 0 /* no bind flags as surf isn't actually used??? */);
vg_copy_surface(ctx, strb->surface, dx, dy,
surf, sx+src->x, sy+src->y, width, height);
pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
surf = screen->get_tex_surface(screen, image_texture(dst), 0, 0, 0,
- PIPE_BIND_BLIT_SOURCE);
+ 0 /* no bind flags as surf isn't actually used??? */);
vg_copy_surface(ctx, surf, dst->x + dx, dst->y + dy,
strb->surface, sx, sy, width, height);
#endif
assert(screen->is_format_supported(screen, dst_surf->format, PIPE_TEXTURE_2D,
- PIPE_BIND_RENDER_TARGET, 0));
+ 0, PIPE_BIND_RENDER_TARGET, 0));
/* save state (restored below) */
cso_save_blend(ctx->cso);
struct pipe_sampler_view view_templ;
struct pipe_sampler_view *view;
struct pipe_resource texTemp, *tex;
- struct pipe_surface *texSurf;
+ struct pipe_subresource subsrc, subdst;
struct pipe_framebuffer_state fb;
struct st_framebuffer *stfb = ctx->owner->draw_buffer;
const int srcW = abs(srcX1 - srcX0);
}
assert(screen->is_format_supported(screen, src->format, PIPE_TEXTURE_2D,
- PIPE_BIND_SAMPLER_VIEW, 0));
+ 0, PIPE_BIND_SAMPLER_VIEW, 0));
assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
- PIPE_BIND_SAMPLER_VIEW, 0));
+ 0, PIPE_BIND_SAMPLER_VIEW, 0));
assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
- PIPE_BIND_RENDER_TARGET, 0));
+ 0, PIPE_BIND_RENDER_TARGET, 0));
/*
* XXX for now we're always creating a temporary texture.
texTemp.width0 = srcW;
texTemp.height0 = srcH;
texTemp.depth0 = 1;
+ texTemp.bind = PIPE_BIND_SAMPLER_VIEW;
tex = screen->resource_create(screen, &texTemp);
if (!tex)
if (!view)
return;
- texSurf = screen->get_tex_surface(screen, tex, 0, 0, 0,
- PIPE_BIND_RENDER_TARGET);
-
- /* load temp texture */
- if (pipe->surface_copy) {
- pipe->surface_copy(pipe,
- texSurf, 0, 0, /* dest */
- src, srcLeft, srcTop, /* src */
- srcW, srcH); /* size */
- } else {
- util_surface_copy(pipe, FALSE,
- texSurf, 0, 0, /* dest */
- src, srcLeft, srcTop, /* src */
- srcW, srcH); /* size */
- }
+ subdst.face = 0;
+ subdst.level = 0;
+ subsrc.face = src->face;
+ subsrc.level = src->level;
- /* free the surface, update the texture if necessary.*/
- screen->tex_surface_destroy(texSurf);
+ pipe->resource_copy_region(pipe,
+ tex, subdst, 0, 0, 0, /* dest */
+ src->texture, subsrc, srcLeft, srcTop, src->zslice, /* src */
+ srcW, srcH); /* size */
/* save state (restored below) */
cso_save_blend(ctx->cso);
dest_surface = pipe->screen->get_tex_surface(pipe->screen,
stfb->blend_texture_view->texture,
0, 0, 0,
- PIPE_BIND_BLIT_DESTINATION |
- PIPE_BIND_RENDER_TARGET);
+ PIPE_BIND_RENDER_TARGET);
/* flip it, because we want to use it as a sampler */
util_blit_pixels_tex(ctx->blit,
view,
dest_surface = pipe->screen->get_tex_surface(pipe->screen,
stfb->blend_texture_view->texture,
0, 0, 0,
- PIPE_BIND_BLIT_DESTINATION |
- PIPE_BIND_RENDER_TARGET);
+ PIPE_BIND_RENDER_TARGET);
/* flip it, because we want to use it as a sampler */
util_blit_pixels_tex(ctx->blit,
/* if we had an old surface copy it over */
if (old_sampler_view) {
- struct pipe_surface *surface = pipe->screen->get_tex_surface(
- pipe->screen,
- stfb->alpha_mask_view->texture,
- 0, 0, 0,
- PIPE_BIND_RENDER_TARGET |
- PIPE_BIND_BLIT_DESTINATION);
- struct pipe_surface *old_surface = pipe->screen->get_tex_surface(
- pipe->screen,
- old_sampler_view->texture,
- 0, 0, 0,
- PIPE_BIND_BLIT_SOURCE);
- pipe->surface_copy(pipe,
- surface,
- 0, 0,
- old_surface,
- 0, 0,
- MIN2(old_surface->width, surface->width),
- MIN2(old_surface->height, surface->height));
- if (surface)
- pipe_surface_reference(&surface, NULL);
- if (old_surface)
- pipe_surface_reference(&old_surface, NULL);
+ struct pipe_subresource subsurf, subold_surf;
+ subsurf.face = 0;
+ subsurf.level = 0;
+ subold_surf.face = 0;
+ subold_surf.level = 0;
+ pipe->resource_copy_region(pipe,
+ stfb->alpha_mask_view->texture,
+ subsurf,
+ 0, 0, 0,
+ old_sampler_view->texture,
+ subold_surf,
+ 0, 0, 0,
+ MIN2(old_sampler_view->texture->width0,
+ stfb->alpha_mask_view->texture->width0),
+ MIN2(old_sampler_view->texture->height0,
+ stfb->alpha_mask_view->texture->height0));
}
/* Free the old texture
/* Probably need dedicated flags for surface usage too:
*/
- surface_usage = (PIPE_BIND_RENDER_TARGET |
- PIPE_BIND_BLIT_SOURCE |
- PIPE_BIND_BLIT_DESTINATION);
+ surface_usage = PIPE_BIND_DEPTH_STENCIL; /* XXX: was: RENDER_TARGET */
dsrb->texture = create_texture(pipe, dsrb->format, width, height);
if (!dsrb->texture)
strb->texture = pt;
strb->surface = screen->get_tex_surface(screen, strb->texture, 0, 0, 0,
- PIPE_BIND_RENDER_TARGET |
- PIPE_BIND_BLIT_SOURCE |
- PIPE_BIND_BLIT_DESTINATION);
+ PIPE_BIND_RENDER_TARGET);
if (!strb->surface) {
pipe_resource_reference(&strb->texture, NULL);
return TRUE;