diff options
author | Brian Paul <[email protected]> | 2010-07-16 11:10:25 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-07-16 11:10:25 -0600 |
commit | 80e07c41907cc0ac43d68aeb3abf9de8435e70fd (patch) | |
tree | 882e93f22cd4765f5f18db81cc069f48b8920703 /src/gallium/auxiliary/draw/draw_pt.c | |
parent | 959a458ea01d5fa4274bdd439da114b42d3b86d3 (diff) |
draw: updated debug/dump code
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index 79d2e58b124..92d4113b4c6 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -34,9 +34,11 @@ #include "draw/draw_gs.h" #include "draw/draw_private.h" #include "draw/draw_pt.h" +#include "draw/draw_vs.h" #include "tgsi/tgsi_dump.h" #include "util/u_math.h" #include "util/u_prim.h" +#include "util/u_format.h" DEBUG_GET_ONCE_BOOL_OPTION(draw_fse, "DRAW_FSE", FALSE) @@ -265,31 +267,38 @@ draw_print_arrays(struct draw_context *draw, uint prim, int start, uint count) case PIPE_FORMAT_R32_FLOAT: { float *v = (float *) ptr; - debug_printf("%f @ %p\n", v[0], (void *) v); + debug_printf("R %f @ %p\n", v[0], (void *) v); } break; case PIPE_FORMAT_R32G32_FLOAT: { float *v = (float *) ptr; - debug_printf("%f %f @ %p\n", v[0], v[1], (void *) v); + debug_printf("RG %f %f @ %p\n", v[0], v[1], (void *) v); } break; case PIPE_FORMAT_R32G32B32_FLOAT: { float *v = (float *) ptr; - debug_printf("%f %f %f @ %p\n", v[0], v[1], v[2], (void *) v); + debug_printf("RGB %f %f %f @ %p\n", v[0], v[1], v[2], (void *) v); } break; case PIPE_FORMAT_R32G32B32A32_FLOAT: { float *v = (float *) ptr; - debug_printf("%f %f %f %f @ %p\n", v[0], v[1], v[2], v[3], + debug_printf("RGBA %f %f %f %f @ %p\n", v[0], v[1], v[2], v[3], (void *) v); } break; + case PIPE_FORMAT_B8G8R8A8_UNORM: + { + ubyte *u = (ubyte *) ptr; + debug_printf("BGRA %d %d %d %d @ %p\n", u[0], u[1], u[2], u[3], + (void *) u); + } + break; default: - debug_printf("other format (fix me)\n"); - ; + debug_printf("other format %s (fix me)\n", + util_format_name(draw->pt.vertex_element[j].src_format)); } } } @@ -340,26 +349,30 @@ draw_arrays_instanced(struct draw_context *draw, if (0) draw_print_arrays(draw, mode, start, MIN2(count, 20)); -#if 0 - { - int i; + if (0) { + unsigned int i; debug_printf("draw_arrays(mode=%u start=%u count=%u):\n", mode, start, count); tgsi_dump(draw->vs.vertex_shader->state.tokens, 0); debug_printf("Elements:\n"); for (i = 0; i < draw->pt.nr_vertex_elements; i++) { - debug_printf(" format=%s\n", + debug_printf(" %u: src_offset=%u inst_div=%u vbuf=%u format=%s\n", + i, + draw->pt.vertex_element[i].src_offset, + draw->pt.vertex_element[i].instance_divisor, + draw->pt.vertex_element[i].vertex_buffer_index, util_format_name(draw->pt.vertex_element[i].src_format)); } debug_printf("Buffers:\n"); for (i = 0; i < draw->pt.nr_vertex_buffers; i++) { - debug_printf(" stride=%u offset=%u ptr=%p\n", + debug_printf(" %u: stride=%u maxindex=%u offset=%u ptr=%p\n", + i, draw->pt.vertex_buffer[i].stride, + draw->pt.vertex_buffer[i].max_index, draw->pt.vertex_buffer[i].buffer_offset, draw->pt.user.vbuffer[i]); } } -#endif for (instance = 0; instance < instanceCount; instance++) { draw->instance_id = instance + startInstance; |