* to read from a newly allocated temporary.
*
*/
-static void insert_WPOS_trailer(struct r300_fragment_program_compiler *compiler)
+static void insert_WPOS_trailer(struct r300_fragment_program_compiler *compiler, struct r300_fragment_program * fp)
{
int i;
if (!(compiler->Base.Program.InputsRead & FRAG_BIT_WPOS)) {
- compiler->code->wpos_attr = FRAG_ATTRIB_MAX;
+ fp->wpos_attr = FRAG_ATTRIB_MAX;
return;
}
for (i = FRAG_ATTRIB_TEX0; i <= FRAG_ATTRIB_TEX7; ++i)
{
if (!(compiler->Base.Program.InputsRead & (1 << i))) {
- compiler->code->wpos_attr = i;
+ fp->wpos_attr = i;
break;
}
}
- rc_transform_fragment_wpos(&compiler->Base, FRAG_ATTRIB_WPOS, compiler->code->wpos_attr);
+ rc_transform_fragment_wpos(&compiler->Base, FRAG_ATTRIB_WPOS, fp->wpos_attr);
}
/**
*
* See also the counterpart rewriting for vertex programs.
*/
-static void rewriteFog(struct r300_fragment_program_compiler *compiler)
+static void rewriteFog(struct r300_fragment_program_compiler *compiler, struct r300_fragment_program * fp)
{
- struct rX00_fragment_program_code *code = compiler->code;
struct prog_src_register src;
int i;
if (!(compiler->Base.Program.InputsRead & FRAG_BIT_FOGC)) {
- code->fog_attr = FRAG_ATTRIB_MAX;
+ fp->fog_attr = FRAG_ATTRIB_MAX;
return;
}
for (i = FRAG_ATTRIB_TEX0; i <= FRAG_ATTRIB_TEX7; ++i)
{
if (!(compiler->Base.Program.InputsRead & (1 << i))) {
- code->fog_attr = i;
+ fp->fog_attr = i;
break;
}
}
memset(&src, 0, sizeof(src));
src.File = PROGRAM_INPUT;
- src.Index = code->fog_attr;
+ src.Index = fp->fog_attr;
src.Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ONE);
rc_move_input(&compiler->Base, FRAG_ATTRIB_FOGC, src);
}
rc_mesa_to_rc_program(&compiler.Base, &cont->Base.Base);
- insert_WPOS_trailer(&compiler);
+ insert_WPOS_trailer(&compiler, fp);
- rewriteFog(&compiler);
+ rewriteFog(&compiler, fp);
r3xx_compile_fragment_program(&compiler);
fp->error = compiler.Base.Error;
ADD_ATTR(VERT_ATTRIB_POINT_SIZE, R300_DATA_TYPE_FLOAT_1, SWTCL_OVM_POINT_SIZE, swiz, MASK_X, 0);
}
- if (rmesa->selected_fp->code.wpos_attr != FRAG_ATTRIB_MAX) {
- int tex_id = rmesa->selected_fp->code.wpos_attr - FRAG_ATTRIB_TEX0;
+ if (rmesa->selected_fp->wpos_attr != FRAG_ATTRIB_MAX) {
+ int tex_id = rmesa->selected_fp->wpos_attr - FRAG_ATTRIB_TEX0;
VB->AttribPtr[VERT_ATTRIB_TEX0 + tex_id] = VB->AttribPtr[VERT_ATTRIB_POS];
VB->TexCoordPtr[tex_id] = VB->AttribPtr[VERT_ATTRIB_POS];
RENDERINPUTS_SET(tnl->render_inputs_bitset, _TNL_ATTRIB_TEX0 + tex_id);
}
- if (rmesa->selected_fp->code.fog_attr != FRAG_ATTRIB_MAX) {
- int tex_id = rmesa->selected_fp->code.fog_attr - FRAG_ATTRIB_TEX0;
+ if (rmesa->selected_fp->fog_attr != FRAG_ATTRIB_MAX) {
+ int tex_id = rmesa->selected_fp->fog_attr - FRAG_ATTRIB_TEX0;
VB->AttribPtr[VERT_ATTRIB_TEX0 + tex_id] = VB->AttribPtr[VERT_ATTRIB_FOG];
VB->TexCoordPtr[tex_id] = VB->AttribPtr[VERT_ATTRIB_FOG];
vpc = (struct r300_vertex_program_cont *)ctx->VertexProgram._Current;
wanted_key.FpReads = r300->selected_fp->InputsRead;
- wanted_key.FogAttr = r300->selected_fp->code.fog_attr;
- wanted_key.WPosAttr = r300->selected_fp->code.wpos_attr;
+ wanted_key.FogAttr = r300->selected_fp->fog_attr;
+ wanted_key.WPosAttr = r300->selected_fp->wpos_attr;
for (vp = vpc->progs; vp; vp = vp->next) {
if (_mesa_memcmp(&vp->key, &wanted_key, sizeof(wanted_key))