diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-08-13 16:07:11 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-08-13 16:23:44 +0100 |
commit | 40a86b20478024ca7c55400019c536cb5ff631d1 (patch) | |
tree | 624d3f33b07dfba4328b0c7746af5f58fd496292 /src/mesa/pipe/i915simple/i915_debug_fp.c | |
parent | d46779103b38aeab61701759ed7a0b30cc71c0ef (diff) |
Start breaking the #include dependencies between pipe drivers and mesa.
Pipe drivers shouldn't really know much about mesa and certainly shouldn't
be #including files from src/mesa/main and the like.
I've also (in i915simple especially) moved over from GL types to
more conventional int/unsigned usage. This probably isn't really the
ultimate desired set of types to use - possibly C99 would be better. It
may even be that a subset of the GL types is preferable.
Diffstat (limited to 'src/mesa/pipe/i915simple/i915_debug_fp.c')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_debug_fp.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/mesa/pipe/i915simple/i915_debug_fp.c b/src/mesa/pipe/i915simple/i915_debug_fp.c index c54d36f294..a108f1ad4f 100644 --- a/src/mesa/pipe/i915simple/i915_debug_fp.c +++ b/src/mesa/pipe/i915simple/i915_debug_fp.c @@ -25,15 +25,12 @@ * **************************************************************************/ -#include <stdio.h> #include "i915_reg.h" #include "i915_debug.h" #include "pipe/p_winsys.h" -//#include "i915_fpc.h" -#include "shader/program.h" -#include "shader/prog_instruction.h" -#include "shader/prog_print.h" +#include "pipe/p_util.h" + @@ -126,7 +123,7 @@ static const char *regname[0x8] = { }; static void -print_reg_type_nr(struct debug_stream *stream, GLuint type, GLuint nr) +print_reg_type_nr(struct debug_stream *stream, unsigned type, unsigned nr) { switch (type) { case REG_TYPE_T: @@ -173,7 +170,7 @@ print_reg_type_nr(struct debug_stream *stream, GLuint type, GLuint nr) static void -print_reg_neg_swizzle(struct debug_stream *stream, GLuint reg) +print_reg_neg_swizzle(struct debug_stream *stream, unsigned reg) { int i; @@ -215,20 +212,20 @@ print_reg_neg_swizzle(struct debug_stream *stream, GLuint reg) static void -print_src_reg(struct debug_stream *stream, GLuint dword) +print_src_reg(struct debug_stream *stream, unsigned dword) { - GLuint nr = (dword >> A2_SRC2_NR_SHIFT) & REG_NR_MASK; - GLuint type = (dword >> A2_SRC2_TYPE_SHIFT) & REG_TYPE_MASK; + unsigned nr = (dword >> A2_SRC2_NR_SHIFT) & REG_NR_MASK; + unsigned type = (dword >> A2_SRC2_TYPE_SHIFT) & REG_TYPE_MASK; print_reg_type_nr(stream, type, nr); print_reg_neg_swizzle(stream, dword); } static void -print_dest_reg(struct debug_stream *stream, GLuint dword) +print_dest_reg(struct debug_stream *stream, unsigned dword) { - GLuint nr = (dword >> A0_DEST_NR_SHIFT) & REG_NR_MASK; - GLuint type = (dword >> A0_DEST_TYPE_SHIFT) & REG_TYPE_MASK; + unsigned nr = (dword >> A0_DEST_NR_SHIFT) & REG_NR_MASK; + unsigned type = (dword >> A0_DEST_TYPE_SHIFT) & REG_TYPE_MASK; print_reg_type_nr(stream, type, nr); if ((dword & A0_DEST_CHANNEL_ALL) == A0_DEST_CHANNEL_ALL) return; @@ -251,7 +248,7 @@ print_dest_reg(struct debug_stream *stream, GLuint dword) static void print_arith_op(struct debug_stream *stream, - GLuint opcode, const GLuint * program) + unsigned opcode, const unsigned * program) { if (opcode != A0_NOP) { print_dest_reg(stream, program[0]); @@ -285,7 +282,7 @@ print_arith_op(struct debug_stream *stream, static void print_tex_op(struct debug_stream *stream, - GLuint opcode, const GLuint * program) + unsigned opcode, const unsigned * program) { print_dest_reg(stream, program[0] | A0_DEST_CHANNEL_ALL); PRINTF(" = "); @@ -303,7 +300,7 @@ print_tex_op(struct debug_stream *stream, static void print_dcl_op(struct debug_stream *stream, - GLuint opcode, const GLuint * program) + unsigned opcode, const unsigned * program) { PRINTF("%s ", opcodes[opcode]); print_dest_reg(stream, @@ -314,10 +311,10 @@ print_dcl_op(struct debug_stream *stream, void i915_disassemble_program(struct debug_stream *stream, - const GLuint * program, GLuint sz) + const unsigned * program, unsigned sz) { - GLuint size = program[0] & 0x1ff; - GLint i; + unsigned size = program[0] & 0x1ff; + int i; PRINTF("\t\tBEGIN\n"); @@ -325,11 +322,11 @@ i915_disassemble_program(struct debug_stream *stream, program++; for (i = 1; i < sz; i += 3, program += 3) { - GLuint opcode = program[0] & (0x1f << 24); + unsigned opcode = program[0] & (0x1f << 24); PRINTF("\t\t"); - if ((GLint) opcode >= A0_NOP && opcode <= A0_SLT) + if ((int) opcode >= A0_NOP && opcode <= A0_SLT) print_arith_op(stream, opcode >> 24, program); else if (opcode >= T0_TEXLD && opcode <= T0_TEXKILL) print_tex_op(stream, opcode >> 24, program); |