checkpoint: TGSI_ATTRIB_x tokens no longer used

This commit is contained in:
Brian
2007-09-20 13:50:53 -06:00
parent 086734502a
commit 674d013069
6 changed files with 29 additions and 35 deletions

View File

@@ -87,7 +87,7 @@ struct vertex_info
* \return slot in which the attribute was added * \return slot in which the attribute was added
*/ */
static INLINE uint static INLINE uint
draw_emit_vertex_attr(struct vertex_info *vinfo, uint vfAttr, draw_emit_vertex_attr(struct vertex_info *vinfo,
attrib_format format, interp_mode interp) attrib_format format, interp_mode interp)
{ {
const uint n = vinfo->num_attribs; const uint n = vinfo->num_attribs;

View File

@@ -55,7 +55,7 @@ static void calculate_vertex_layout( struct i915_context *i915 )
memset(vinfo, 0, sizeof(*vinfo)); memset(vinfo, 0, sizeof(*vinfo));
/* pos */ /* pos */
draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_POS, FORMAT_3F, INTERP_LINEAR); draw_emit_vertex_attr(vinfo, FORMAT_3F, INTERP_LINEAR);
/* Note: we'll set the S4_VFMT_XYZ[W] bits below */ /* Note: we'll set the S4_VFMT_XYZ[W] bits below */
for (i = 0; i < fs->num_inputs; i++) { for (i = 0; i < fs->num_inputs; i++) {
@@ -63,14 +63,12 @@ static void calculate_vertex_layout( struct i915_context *i915 )
case TGSI_SEMANTIC_POSITION: case TGSI_SEMANTIC_POSITION:
break; break;
case TGSI_SEMANTIC_COLOR0: case TGSI_SEMANTIC_COLOR0:
front0 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_COLOR0, front0 = draw_emit_vertex_attr(vinfo, FORMAT_4UB, colorInterp);
FORMAT_4UB, colorInterp);
vinfo->hwfmt[0] |= S4_VFMT_COLOR; vinfo->hwfmt[0] |= S4_VFMT_COLOR;
break; break;
case TGSI_SEMANTIC_COLOR1: case TGSI_SEMANTIC_COLOR1:
assert(0); /* untested */ assert(0); /* untested */
front1 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_COLOR1, front1 = draw_emit_vertex_attr(vinfo, FORMAT_4UB, colorInterp);
FORMAT_4UB, colorInterp);
vinfo->hwfmt[0] |= S4_VFMT_SPEC_FOG; vinfo->hwfmt[0] |= S4_VFMT_SPEC_FOG;
break; break;
case TGSI_SEMANTIC_TEX0: case TGSI_SEMANTIC_TEX0:
@@ -85,8 +83,7 @@ static void calculate_vertex_layout( struct i915_context *i915 )
const uint unit = fs->input_semantics[i] - TGSI_SEMANTIC_TEX0; const uint unit = fs->input_semantics[i] - TGSI_SEMANTIC_TEX0;
uint hwtc; uint hwtc;
texCoords[unit] = TRUE; texCoords[unit] = TRUE;
draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_TEX0 + i, draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_PERSPECTIVE);
FORMAT_4F, INTERP_PERSPECTIVE);
hwtc = TEXCOORDFMT_4D; hwtc = TEXCOORDFMT_4D;
needW = TRUE; needW = TRUE;
vinfo->hwfmt[1] |= hwtc << (unit * 4); vinfo->hwfmt[1] |= hwtc << (unit * 4);
@@ -109,16 +106,14 @@ static void calculate_vertex_layout( struct i915_context *i915 )
#if 0 #if 0
/* color0 */ /* color0 */
if (inputsRead & (1 << TGSI_ATTRIB_COLOR0)) { if (inputsRead & (1 << TGSI_ATTRIB_COLOR0)) {
front0 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_COLOR0, front0 = draw_emit_vertex_attr(vinfo, FORMAT_4UB, colorInterp);
FORMAT_4UB, colorInterp);
vinfo->hwfmt[0] |= S4_VFMT_COLOR; vinfo->hwfmt[0] |= S4_VFMT_COLOR;
} }
/* color 1 */ /* color 1 */
if (inputsRead & (1 << TGSI_ATTRIB_COLOR1)) { if (inputsRead & (1 << TGSI_ATTRIB_COLOR1)) {
assert(0); /* untested */ assert(0); /* untested */
front1 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_COLOR1, front1 = draw_emit_vertex_attr(vinfo, FORMAT_4UB, colorInterp);
FORMAT_4UB, colorInterp);
vinfo->hwfmt[0] |= S4_VFMT_SPEC_FOG; vinfo->hwfmt[0] |= S4_VFMT_SPEC_FOG;
} }
@@ -130,7 +125,7 @@ static void calculate_vertex_layout( struct i915_context *i915 )
for (i = TGSI_ATTRIB_TEX0; i <= TGSI_ATTRIB_TEX7; i++) { for (i = TGSI_ATTRIB_TEX0; i <= TGSI_ATTRIB_TEX7; i++) {
uint hwtc; uint hwtc;
if (inputsRead & (1 << i)) { if (inputsRead & (1 << i)) {
draw_emit_vertex_attr(vinfo, i, FORMAT_4F, INTERP_PERSPECTIVE); draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_PERSPECTIVE);
hwtc = TEXCOORDFMT_4D; hwtc = TEXCOORDFMT_4D;
needW = TRUE; needW = TRUE;
} }
@@ -158,12 +153,10 @@ static void calculate_vertex_layout( struct i915_context *i915 )
*/ */
if (i915->rasterizer->light_twoside) { if (i915->rasterizer->light_twoside) {
if (front0) { if (front0) {
back0 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_BFC0, back0 = draw_emit_vertex_attr(vinfo, FORMAT_OMIT, colorInterp);
FORMAT_OMIT, colorInterp);
} }
if (back0) { if (back0) {
back1 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_BFC1, back1 = draw_emit_vertex_attr(vinfo, FORMAT_OMIT, colorInterp);
FORMAT_OMIT, colorInterp);
} }
} }

View File

@@ -79,7 +79,7 @@ struct setup_stage {
float oneoverarea; float oneoverarea;
struct tgsi_interp_coef coef[TGSI_ATTRIB_MAX]; struct tgsi_interp_coef coef[PIPE_MAX_SHADER_INPUTS];
struct quad_header quad; struct quad_header quad;
struct { struct {
@@ -366,7 +366,7 @@ static void const_coeff( struct setup_stage *setup,
unsigned slot, unsigned slot,
unsigned i ) unsigned i )
{ {
assert(slot < TGSI_ATTRIB_MAX); assert(slot < PIPE_MAX_SHADER_INPUTS);
assert(i <= 3); assert(i <= 3);
setup->coef[slot].dadx[i] = 0; setup->coef[slot].dadx[i] = 0;
@@ -391,7 +391,7 @@ static void tri_linear_coeff( struct setup_stage *setup,
float a = setup->ebot.dy * majda - botda * setup->emaj.dy; float a = setup->ebot.dy * majda - botda * setup->emaj.dy;
float b = setup->emaj.dx * botda - majda * setup->ebot.dx; float b = setup->emaj.dx * botda - majda * setup->ebot.dx;
assert(slot < TGSI_ATTRIB_MAX); assert(slot < PIPE_MAX_SHADER_INPUTS);
assert(i <= 3); assert(i <= 3);
setup->coef[slot].dadx[i] = a * setup->oneoverarea; setup->coef[slot].dadx[i] = a * setup->oneoverarea;
@@ -454,7 +454,7 @@ static void tri_persp_coeff( struct setup_stage *setup,
); );
*/ */
assert(slot < TGSI_ATTRIB_MAX); assert(slot < PIPE_MAX_SHADER_INPUTS);
assert(i <= 3); assert(i <= 3);
setup->coef[slot].dadx[i] = a * setup->oneoverarea; setup->coef[slot].dadx[i] = a * setup->oneoverarea;
@@ -910,8 +910,8 @@ setup_point(struct draw_stage *stage, struct prim_header *prim)
= sizeAttr ? (0.5f * v0->data[sizeAttr][0]) = sizeAttr ? (0.5f * v0->data[sizeAttr][0])
: (0.5f * setup->softpipe->rasterizer->point_size); : (0.5f * setup->softpipe->rasterizer->point_size);
const boolean round = setup->softpipe->rasterizer->point_smooth; const boolean round = setup->softpipe->rasterizer->point_smooth;
const float x = v0->data[TGSI_ATTRIB_POS][0]; const float x = v0->data[0][0]; /* Note: data[0] is always position */
const float y = v0->data[TGSI_ATTRIB_POS][1]; const float y = v0->data[0][1];
unsigned slot, j; unsigned slot, j;
assert(sizeAttr >= 0); assert(sizeAttr >= 0);

View File

@@ -63,7 +63,7 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
/* always emit vertex pos */ /* always emit vertex pos */
/* TODO - Figure out if we need to do perspective divide, etc. */ /* TODO - Figure out if we need to do perspective divide, etc. */
draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_POS, FORMAT_4F, INTERP_LINEAR); draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_LINEAR);
for (i = 0; i < fs->num_inputs; i++) { for (i = 0; i < fs->num_inputs; i++) {
switch (fs->input_semantics[i]) { switch (fs->input_semantics[i]) {
@@ -75,15 +75,15 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
softpipe->need_w = TRUE; softpipe->need_w = TRUE;
break; break;
case TGSI_SEMANTIC_COLOR0: case TGSI_SEMANTIC_COLOR0:
front0 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_COLOR0, front0 = draw_emit_vertex_attr(vinfo,
FORMAT_4F, colorInterp); FORMAT_4F, colorInterp);
break; break;
case TGSI_SEMANTIC_COLOR1: case TGSI_SEMANTIC_COLOR1:
front1 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_COLOR1, front1 = draw_emit_vertex_attr(vinfo,
FORMAT_4F, colorInterp); FORMAT_4F, colorInterp);
break; break;
case TGSI_SEMANTIC_FOG: case TGSI_SEMANTIC_FOG:
draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_FOG, draw_emit_vertex_attr(vinfo,
FORMAT_1F, INTERP_PERSPECTIVE); FORMAT_1F, INTERP_PERSPECTIVE);
break; break;
#if 0 #if 0
@@ -91,19 +91,19 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
/* XXX only emit if drawing points or front/back polygon mode /* XXX only emit if drawing points or front/back polygon mode
* is point mode * is point mode
*/ */
draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_POINTSIZE, draw_emit_vertex_attr(vinfo,
FORMAT_4F, INTERP_CONSTANT); FORMAT_4F, INTERP_CONSTANT);
break; break;
#endif #endif
softpipe->psize_slot = i; softpipe->psize_slot = i;
/*case TGSI_SEMANTIC_TEXCOORD:*/ /*case TGSI_SEMANTIC_TEXCOORD:*/
case TGSI_SEMANTIC_TEX0: case TGSI_SEMANTIC_TEX0:
draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_TEX0, draw_emit_vertex_attr(vinfo,
FORMAT_4F, INTERP_PERSPECTIVE); FORMAT_4F, INTERP_PERSPECTIVE);
softpipe->need_w = TRUE; softpipe->need_w = TRUE;
break; break;
case TGSI_SEMANTIC_OTHER: case TGSI_SEMANTIC_OTHER:
draw_emit_vertex_attr(vinfo, i, FORMAT_4F, INTERP_PERSPECTIVE); draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_PERSPECTIVE);
softpipe->need_w = TRUE; softpipe->need_w = TRUE;
break; break;
@@ -120,12 +120,10 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
*/ */
if (softpipe->rasterizer->light_twoside) { if (softpipe->rasterizer->light_twoside) {
if (front0) { if (front0) {
back0 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_BFC0, back0 = draw_emit_vertex_attr(vinfo, FORMAT_OMIT, colorInterp);
FORMAT_OMIT, colorInterp);
} }
if (back0) { if (back0) {
back1 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_BFC1, back1 = draw_emit_vertex_attr(vinfo, FORMAT_OMIT, colorInterp);
FORMAT_OMIT, colorInterp);
} }
} }

View File

@@ -5,6 +5,7 @@
/** /**
* The specific values here are not important (could remove them). * The specific values here are not important (could remove them).
*/ */
#if 0
enum { enum {
TGSI_ATTRIB_POS = 0, TGSI_ATTRIB_POS = 0,
TGSI_ATTRIB_WEIGHT = 1, TGSI_ATTRIB_WEIGHT = 1,
@@ -41,6 +42,7 @@ enum {
#define TGSI_MAX_TEXTURE 8 #define TGSI_MAX_TEXTURE 8
#define TGSI_MAX_VARYING 8 #define TGSI_MAX_VARYING 8
#endif

View File

@@ -77,6 +77,7 @@ pipe_vertex_format(GLenum format, GLuint size)
} }
#if 0
/** /**
* Convert a mesa vertex attribute to a TGSI attribute * Convert a mesa vertex attribute to a TGSI attribute
*/ */
@@ -137,7 +138,7 @@ tgsi_attrib_to_mesa_attrib(GLuint attr)
return 0; return 0;
} }
} }
#endif
/** /**