diff options
author | Luca Barbieri <[email protected]> | 2010-08-21 12:47:18 +0200 |
---|---|---|
committer | Luca Barbieri <[email protected]> | 2010-08-21 12:47:18 +0200 |
commit | bed9dff9d94e33d34340183d7cb633869dcb4f90 (patch) | |
tree | b0ccbf07f577daf01bb0f91162d47fad3cc8b30a /src/gallium/auxiliary/util/u_debug_describe.c | |
parent | 061c2a7cb3924f1983554aa1d53b78238196c412 (diff) |
u_debug_describe: use switch instead of if chain
Diffstat (limited to 'src/gallium/auxiliary/util/u_debug_describe.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_debug_describe.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/util/u_debug_describe.c b/src/gallium/auxiliary/util/u_debug_describe.c index f21ebd02f55..1c90ff31069 100644 --- a/src/gallium/auxiliary/util/u_debug_describe.c +++ b/src/gallium/auxiliary/util/u_debug_describe.c @@ -38,20 +38,30 @@ debug_describe_reference(char* buf, const struct pipe_reference*ptr) void debug_describe_resource(char* buf, const struct pipe_resource *ptr) { - if(ptr->target == PIPE_BUFFER) + switch(ptr->target) + { + case PIPE_BUFFER: util_sprintf(buf, "pipe_buffer<%u>", (unsigned)util_format_get_stride(ptr->format, ptr->width0)); - else if(ptr->target == PIPE_TEXTURE_1D) + break; + case PIPE_TEXTURE_1D: util_sprintf(buf, "pipe_texture1d<%u,%s,%u>", ptr->width0, util_format_short_name(ptr->format), ptr->last_level); - else if(ptr->target == PIPE_TEXTURE_2D) + break; + case PIPE_TEXTURE_2D: util_sprintf(buf, "pipe_texture2d<%u,%u,%s,%u>", ptr->width0, ptr->height0, util_format_short_name(ptr->format), ptr->last_level); - else if(ptr->target == PIPE_TEXTURE_RECT) + break; + case PIPE_TEXTURE_RECT: util_sprintf(buf, "pipe_texture_rect<%u,%u,%s>", ptr->width0, ptr->height0, util_format_short_name(ptr->format)); - else if(ptr->target == PIPE_TEXTURE_CUBE) + break; + case PIPE_TEXTURE_CUBE: util_sprintf(buf, "pipe_texture_cube<%u,%u,%s,%u>", ptr->width0, ptr->height0, util_format_short_name(ptr->format), ptr->last_level); - else if(ptr->target == PIPE_TEXTURE_3D) + break; + case PIPE_TEXTURE_3D: util_sprintf(buf, "pipe_texture3d<%u,%u,%u,%s,%u>", ptr->width0, ptr->height0, ptr->depth0, util_format_short_name(ptr->format), ptr->last_level); - else + break; + default: util_sprintf(buf, "pipe_martian_resource<%u>", ptr->target); + break; + } } void |