From 6d88515190ed7500e201706cc14d30072ba42d6f Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 23 Aug 2007 13:41:23 -0600 Subject: remove dead/debug code, misc clean-up --- src/mesa/pipe/i915simple/i915_fpc_translate.c | 47 ++----------------------- src/mesa/pipe/i915simple/i915_prim_emit.c | 30 ++-------------- src/mesa/pipe/i915simple/i915_state_derived.c | 13 ++----- src/mesa/pipe/i915simple/i915_state_immediate.c | 26 +++++--------- 4 files changed, 16 insertions(+), 100 deletions(-) diff --git a/src/mesa/pipe/i915simple/i915_fpc_translate.c b/src/mesa/pipe/i915simple/i915_fpc_translate.c index 44a869abaf..be3de0f3f4 100644 --- a/src/mesa/pipe/i915simple/i915_fpc_translate.c +++ b/src/mesa/pipe/i915simple/i915_fpc_translate.c @@ -148,14 +148,9 @@ src_vector(struct i915_fp_compile *p, * * We also use a texture coordinate to pass wpos when possible. */ -#if 1 - /* use vertex format info to remap input regs */ - assert(index < p->vertex_info->num_attribs); - printf("%s map index %d to %d\n", - __FUNCTION__, - index, - p->vertex_info->slot_to_attrib[index]); + /* use vertex format info to map a slot number to a VF attrib */ + assert(index < p->vertex_info->num_attribs); index = p->vertex_info->slot_to_attrib[index]; switch (index) { @@ -186,48 +181,10 @@ src_vector(struct i915_fp_compile *p, T_TEX0 + (index - VF_ATTRIB_TEX0), D0_CHANNEL_ALL); break; - default: i915_program_error(p, "Bad source->Index"); return 0; } - -#else - switch (index) { - case FRAG_ATTRIB_WPOS: - assert(p->wpos_tex != -1); - src = i915_emit_decl(p, REG_TYPE_T, p->wpos_tex, D0_CHANNEL_ALL); - break; - case FRAG_ATTRIB_COL0: - src = i915_emit_decl(p, REG_TYPE_T, T_DIFFUSE, D0_CHANNEL_ALL); - break; - case FRAG_ATTRIB_COL1: - src = i915_emit_decl(p, REG_TYPE_T, T_SPECULAR, D0_CHANNEL_XYZ); - src = swizzle(src, X, Y, Z, ONE); - break; - case FRAG_ATTRIB_FOGC: - src = i915_emit_decl(p, REG_TYPE_T, T_FOG_W, D0_CHANNEL_W); - src = swizzle(src, W, W, W, W); - break; - case FRAG_ATTRIB_TEX0: - case FRAG_ATTRIB_TEX1: - case FRAG_ATTRIB_TEX2: - case FRAG_ATTRIB_TEX3: - case FRAG_ATTRIB_TEX4: - case FRAG_ATTRIB_TEX5: - case FRAG_ATTRIB_TEX6: - case FRAG_ATTRIB_TEX7: - src = i915_emit_decl(p, REG_TYPE_T, - T_TEX0 + (index - FRAG_ATTRIB_TEX0), - D0_CHANNEL_ALL); - break; - - default: - i915_program_error(p, "Bad source->Index"); - return 0; - } -#endif - break; case TGSI_FILE_CONSTANT: diff --git a/src/mesa/pipe/i915simple/i915_prim_emit.c b/src/mesa/pipe/i915simple/i915_prim_emit.c index caac6b1f2a..fc26d26627 100644 --- a/src/mesa/pipe/i915simple/i915_prim_emit.c +++ b/src/mesa/pipe/i915simple/i915_prim_emit.c @@ -58,26 +58,6 @@ static INLINE struct setup_stage *setup_stage( struct draw_stage *stage ) } -#if 0 -/* Hardcoded vertex format: xyz/rgba - */ -static INLINE void -emit_hw_vertex( struct i915_context *i915, - struct vertex_header *vertex ) -{ - OUT_BATCH( fui(vertex->data[0][0]) ); - OUT_BATCH( fui(vertex->data[0][1]) ); - OUT_BATCH( fui(vertex->data[0][2]) ); - - /* colors are ARGB (MSB to LSB) */ - OUT_BATCH( pack_ub4(float_to_ubyte( vertex->data[1][2] ), - float_to_ubyte( vertex->data[1][1] ), - float_to_ubyte( vertex->data[1][0] ), - float_to_ubyte( vertex->data[1][3] )) ); -} -#endif - - /** * Extract the needed fields from vertex_header and emit i915 dwords. * Recall that the vertices are constructed by the 'draw' module and @@ -85,8 +65,8 @@ emit_hw_vertex( struct i915_context *i915, * clip pos) that we ignore here. */ static INLINE void -emit_hw_vertex2( struct i915_context *i915, - const struct vertex_header *vertex) +emit_hw_vertex( struct i915_context *i915, + const struct vertex_header *vertex) { const struct vertex_info *vinfo = &i915->current.vertex_info; uint i; @@ -142,11 +122,7 @@ emit_prim( struct draw_stage *stage, unsigned nr ) { struct i915_context *i915 = setup_stage(stage)->i915; -#if 0 - unsigned vertex_size = 4 * sizeof(int); -#else unsigned vertex_size = i915->current.vertex_info.size * 4; /* in bytes */ -#endif unsigned *ptr; unsigned i; @@ -182,7 +158,7 @@ emit_prim( struct draw_stage *stage, ((4 + vertex_size * nr)/4 - 2)); for (i = 0; i < nr; i++) { - emit_hw_vertex2(i915, prim->v[i]); + emit_hw_vertex(i915, prim->v[i]); ptr += vertex_size / sizeof(int); } } diff --git a/src/mesa/pipe/i915simple/i915_state_derived.c b/src/mesa/pipe/i915simple/i915_state_derived.c index f8c56775ea..e8c7dfba6f 100644 --- a/src/mesa/pipe/i915simple/i915_state_derived.c +++ b/src/mesa/pipe/i915simple/i915_state_derived.c @@ -32,9 +32,7 @@ #include "i915_context.h" #include "i915_state.h" #include "i915_reg.h" - -/* XXX should include i915_fpc.h but that causes some trouble atm */ -extern void i915_translate_fragment_program( struct i915_context *i915 ); +#include "i915_fpc.h" @@ -119,9 +117,8 @@ compute_vertex_size(struct vertex_info *vinfo) static void calculate_vertex_layout( struct i915_context *i915 ) { const unsigned inputsRead = i915->fs.inputs_read; -// const unsigned inputsRead = (FRAG_BIT_WPOS | FRAG_BIT_COL0); - unsigned i; struct vertex_info *vinfo = &i915->current.vertex_info; + uint i; memset(vinfo, 0, sizeof(*vinfo)); @@ -167,12 +164,10 @@ static void calculate_vertex_layout( struct i915_context *i915 ) */ if (i915->setup.light_twoside) { if (inputsRead & FRAG_BIT_COL0) { - /* XXX: mark as discarded after setup */ emit_vertex_attr(vinfo, VF_ATTRIB_BFC0, FORMAT_OMIT); } if (inputsRead & FRAG_BIT_COL1) { - /* XXX: discard after setup */ emit_vertex_attr(vinfo, VF_ATTRIB_BFC1, FORMAT_OMIT); } } @@ -185,10 +180,6 @@ static void calculate_vertex_layout( struct i915_context *i915 ) draw_set_vertex_attributes( i915->draw, vinfo->slot_to_attrib, vinfo->num_attribs); -#if 0 - printf("VERTEX_FORMAT LIS2: 0x%x LIS4: 0x%x\n", - vinfo->hwfmt[1], vinfo->hwfmt[0]); -#endif } diff --git a/src/mesa/pipe/i915simple/i915_state_immediate.c b/src/mesa/pipe/i915simple/i915_state_immediate.c index 81f2051be1..38a24733e1 100644 --- a/src/mesa/pipe/i915simple/i915_state_immediate.c +++ b/src/mesa/pipe/i915simple/i915_state_immediate.c @@ -51,24 +51,16 @@ static void upload_S2S4(struct i915_context *i915) { unsigned LIS2, LIS4; - + /* I915_NEW_VERTEX_FORMAT */ -#if 0 - LIS2 = 0xffffffff; - LIS4 = (S4_VFMT_XYZ | S4_VFMT_COLOR); -#else - /* - assert(LIS2 == i915->current.vertex_info.hwfmt[1]); - assert(LIS4 == i915->current.vertex_info.hwfmt[0]); - */ - LIS2 = i915->current.vertex_info.hwfmt[1]; - LIS4 = i915->current.vertex_info.hwfmt[0]; -#endif - printf("DEFAULT FORMT LIS2: 0x%x LIS4: 0x%x\n", ~0, (S4_VFMT_XYZ | S4_VFMT_COLOR)); - printf("UPLOAD FORMAT LIS2: 0x%x LIS4: 0x%x\n", LIS2, LIS4); - printf("VF FORMAT LIS2: 0x%x LIS4: 0x%x\n", - i915->current.vertex_info.hwfmt[1], - i915->current.vertex_info.hwfmt[0]); + { + LIS2 = i915->current.vertex_info.hwfmt[1]; + LIS4 = i915->current.vertex_info.hwfmt[0]; + /* + printf("LIS2: 0x%x LIS4: 0x%x\n", LIS2, LIS4); + */ + assert(LIS4); /* should never be zero? */ + } /* I915_NEW_SETUP */ switch (i915->setup.cull_mode) { -- cgit v1.2.3