void debug_dump_texture(struct pipe_context *pipe, const char *prefix, struct pipe_resource *texture) { struct pipe_surface *surface, surf_tmpl; if (!texture) return; /* XXX for now, just dump image for layer=0, level=0 */ u_surface_default_template(&surf_tmpl, texture); surface = pipe->create_surface(pipe, texture, &surf_tmpl); if (surface) { debug_dump_surface(pipe, prefix, surface); pipe->surface_destroy(pipe, surface); } }
void debug_dump_texture(const char *prefix, struct pipe_texture *texture) { struct pipe_surface *surface; struct pipe_screen *screen; if (!texture) return; screen = texture->screen; /* XXX for now, just dump image for face=0, level=0 */ surface = screen->get_tex_surface(screen, texture, 0, 0, 0, PIPE_TEXTURE_USAGE_SAMPLER); if (surface) { debug_dump_surface(prefix, surface); screen->tex_surface_destroy(surface); } }