diff options
Diffstat (limited to 'src/gallium/auxiliary/util/u_debug.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_debug.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index e997cfa8a38..dd044973f96 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -425,7 +425,7 @@ void debug_dump_surface(struct pipe_context *pipe, const char *prefix, struct pipe_surface *surface) { - struct pipe_texture *texture; + struct pipe_resource *texture; struct pipe_transfer *transfer; void *data; @@ -440,7 +440,7 @@ void debug_dump_surface(struct pipe_context *pipe, */ texture = surface->texture; - transfer = pipe->get_tex_transfer(pipe, texture, surface->face, + transfer = pipe_get_transfer(pipe, texture, surface->face, surface->level, surface->zslice, PIPE_TRANSFER_READ, 0, 0, surface->width, surface->height); @@ -452,20 +452,20 @@ void debug_dump_surface(struct pipe_context *pipe, debug_dump_image(prefix, texture->format, util_format_get_blocksize(texture->format), - util_format_get_nblocksx(texture->format, transfer->width), - util_format_get_nblocksy(texture->format, transfer->height), + util_format_get_nblocksx(texture->format, surface->width), + util_format_get_nblocksy(texture->format, surface->height), transfer->stride, data); pipe->transfer_unmap(pipe, transfer); error: - pipe->tex_transfer_destroy(pipe, transfer); + pipe->transfer_destroy(pipe, transfer); } void debug_dump_texture(struct pipe_context *pipe, const char *prefix, - struct pipe_texture *texture) + struct pipe_resource *texture) { struct pipe_surface *surface; struct pipe_screen *screen; @@ -477,7 +477,7 @@ void debug_dump_texture(struct pipe_context *pipe, /* 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); + PIPE_BIND_SAMPLER_VIEW); if (surface) { debug_dump_surface(pipe, prefix, surface); screen->tex_surface_destroy(surface); @@ -523,16 +523,16 @@ debug_dump_surface_bmp(struct pipe_context *pipe, { #ifndef PIPE_SUBSYSTEM_WINDOWS_MINIPORT struct pipe_transfer *transfer; - struct pipe_texture *texture = surface->texture; + struct pipe_resource *texture = surface->texture; - transfer = pipe->get_tex_transfer(pipe, texture, surface->face, - surface->level, surface->zslice, - PIPE_TRANSFER_READ, 0, 0, surface->width, - surface->height); + transfer = pipe_get_transfer(pipe, texture, surface->face, + surface->level, surface->zslice, + PIPE_TRANSFER_READ, 0, 0, surface->width, + surface->height); debug_dump_transfer_bmp(pipe, filename, transfer); - pipe->tex_transfer_destroy(pipe, transfer); + pipe->transfer_destroy(pipe, transfer); #endif } @@ -547,17 +547,20 @@ debug_dump_transfer_bmp(struct pipe_context *pipe, if (!transfer) goto error1; - rgba = MALLOC(transfer->width*transfer->height*4*sizeof(float)); + rgba = MALLOC(transfer->box.width * + transfer->box.height * + transfer->box.depth * + 4*sizeof(float)); if(!rgba) goto error1; pipe_get_tile_rgba(pipe, transfer, 0, 0, - transfer->width, transfer->height, + transfer->box.width, transfer->box.height, rgba); debug_dump_float_rgba_bmp(filename, - transfer->width, transfer->height, - rgba, transfer->width); + transfer->box.width, transfer->box.height, + rgba, transfer->box.width); FREE(rgba); error1: |