summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_atifragshader.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-02-01 09:51:48 -0700
committerBrian <[email protected]>2007-02-01 09:51:48 -0700
commitf3e507ef9f75dbfc58ccd07b5fe8cfca10d9a9e3 (patch)
tree52aaa2c8e7f9688752f2010254cd04aa5b117743 /src/mesa/swrast/s_atifragshader.c
parent81ef03be65f1458d627528a13cb86feb992d758f (diff)
New SWspanarrays attribs[] array.
Replace texcoord[], varying[], etc. arrays with single attribs[] array, indexed by FRAG_ATTRIB_* values. Eliminates need to copy data into fragment program machine input registers. Will lead to future clean-ups.
Diffstat (limited to 'src/mesa/swrast/s_atifragshader.c')
-rw-r--r--src/mesa/swrast/s_atifragshader.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c
index 75df50b0baa..1ac6528a91a 100644
--- a/src/mesa/swrast/s_atifragshader.c
+++ b/src/mesa/swrast/s_atifragshader.c
@@ -268,7 +268,7 @@ handle_pass_op(struct atifs_machine *machine, struct atifs_setupinst *texinst,
if (pass_tex >= GL_TEXTURE0_ARB && pass_tex <= GL_TEXTURE7_ARB) {
pass_tex -= GL_TEXTURE0_ARB;
COPY_4V(machine->Registers[idx],
- span->array->texcoords[pass_tex][column]);
+ span->array->attribs[FRAG_ATTRIB_TEX0 + pass_tex][column]);
}
else if (pass_tex >= GL_REG_0_ATI && pass_tex <= GL_REG_5_ATI) {
pass_tex -= GL_REG_0_ATI;
@@ -290,7 +290,8 @@ handle_sample_op(GLcontext * ctx, struct atifs_machine *machine,
if (coord_source >= GL_TEXTURE0_ARB && coord_source <= GL_TEXTURE7_ARB) {
coord_source -= GL_TEXTURE0_ARB;
- COPY_4V(tex_coords, span->array->texcoords[coord_source][column]);
+ COPY_4V(tex_coords,
+ span->array->attribs[FRAG_ATTRIB_TEX0 + coord_source][column]);
}
else if (coord_source >= GL_REG_0_ATI && coord_source <= GL_REG_5_ATI) {
coord_source -= GL_REG_0_ATI;
@@ -572,8 +573,8 @@ init_machine(GLcontext * ctx, struct atifs_machine *machine,
machine->Registers[i][j] = 0.0;
}
- COPY_4V(inputs[ATI_FS_INPUT_PRIMARY], span->array->color.sz4.rgba[col]);
- COPY_4V(inputs[ATI_FS_INPUT_SECONDARY], span->array->color.sz4.spec[col]);
+ COPY_4V(inputs[ATI_FS_INPUT_PRIMARY], span->array->attribs[FRAG_ATTRIB_COL0][col]);
+ COPY_4V(inputs[ATI_FS_INPUT_SECONDARY], span->array->attribs[FRAG_ATTRIB_COL1][col]);
}
@@ -604,7 +605,7 @@ _swrast_exec_fragment_shader(GLcontext * ctx, SWspan *span)
const GLfloat *colOut = machine.Registers[0];
/*fprintf(stderr,"outputs %f %f %f %f\n",
colOut[0], colOut[1], colOut[2], colOut[3]); */
- COPY_4V(span->array->color.sz4.rgba[i], colOut);
+ COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i], colOut);
}
}
}