struct stw_framebuffer *fb;
struct st_visual stvis;
- struct pipe_texture *textures[ST_ATTACHMENT_COUNT];
+ struct pipe_resource *textures[ST_ATTACHMENT_COUNT];
unsigned texture_width, texture_height;
unsigned texture_mask;
unsigned mask)
{
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
- struct pipe_texture templ;
+ struct pipe_resource templ;
unsigned i;
/* remove outdated surface */
/* remove outdated textures */
if (stwfb->texture_width != width || stwfb->texture_height != height) {
for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
- pipe_texture_reference(&stwfb->textures[i], NULL);
+ pipe_resource_reference(&stwfb->textures[i], NULL);
}
memset(&templ, 0, sizeof(templ));
for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
enum pipe_format format;
- unsigned tex_usage;
+ unsigned bind;
/* the texture already exists or not requested */
if (stwfb->textures[i] || !(mask & (1 << i))) {
case ST_ATTACHMENT_FRONT_LEFT:
case ST_ATTACHMENT_BACK_LEFT:
format = stwfb->stvis.color_format;
- tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
- PIPE_TEXTURE_USAGE_RENDER_TARGET;
+ bind = PIPE_BIND_DISPLAY_TARGET |
+ PIPE_BIND_RENDER_TARGET;
break;
case ST_ATTACHMENT_DEPTH_STENCIL:
format = stwfb->stvis.depth_stencil_format;
- tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL;
+ bind = PIPE_BIND_DEPTH_STENCIL;
break;
default:
format = PIPE_FORMAT_NONE;
if (format != PIPE_FORMAT_NONE) {
templ.format = format;
- templ.tex_usage = tex_usage;
+ templ.bind = bind;
stwfb->textures[i] =
- stw_dev->screen->texture_create(stw_dev->screen, &templ);
+ stw_dev->screen->resource_create(stw_dev->screen, &templ);
}
}
stw_st_framebuffer_validate(struct st_framebuffer_iface *stfb,
const enum st_attachment_type *statts,
unsigned count,
- struct pipe_texture **out)
+ struct pipe_resource **out)
{
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
unsigned statt_mask, i;
for (i = 0; i < count; i++) {
out[i] = NULL;
- pipe_texture_reference(&out[i], stwfb->textures[statts[i]]);
+ pipe_resource_reference(&out[i], stwfb->textures[statts[i]]);
}
stw_framebuffer_release(stwfb->fb);
enum st_attachment_type statt)
{
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
- struct pipe_texture *ptex;
+ struct pipe_resource *ptex;
struct pipe_surface *psurf, **cache;
ptex = stwfb->textures[statt];
if (!*cache) {
*cache = stw_dev->screen->get_tex_surface(stw_dev->screen,
- ptex, 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ);
+ ptex, 0, 0, 0,
+ PIPE_BIND_DISPLAY_TARGET |
+ PIPE_BIND_RENDER_TARGET);
}
if (psurf != *cache)
pipe_surface_reference(&stwfb->back_surface, NULL);
for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
- pipe_texture_reference(&stwfb->textures[i], NULL);
+ pipe_resource_reference(&stwfb->textures[i], NULL);
FREE(stwfb);
}
{
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
unsigned front = ST_ATTACHMENT_FRONT_LEFT, back = ST_ATTACHMENT_BACK_LEFT;
- struct pipe_texture *ptex;
+ struct pipe_resource *ptex;
struct pipe_surface *psurf;
unsigned mask;