I need to reduce the number of parameters of each compiler pass function.
This is part of a larger cleanup.
{ &r500_transform_IF, 0 },
{ &radeonTransformALU, 0 },
{ &radeonTransformDeriv, 0 },
- { &radeonTransformTrigScale, 0 }
+ { &radeonTransformTrigScale, 0 },
+ { 0, 0 }
};
- radeonLocalTransform(&c->Base, 4, transformations);
+ radeonLocalTransform(&c->Base, transformations);
debug_program_log(c, "after native rewrite part 1");
} else {
struct radeon_program_transformation transformations[] = {
{ &radeonTransformALU, 0 },
- { &radeonTransformTrigSimple, 0 }
+ { &radeonTransformTrigSimple, 0 },
+ { 0, 0 }
};
- radeonLocalTransform(&c->Base, 2, transformations);
+ radeonLocalTransform(&c->Base, transformations);
debug_program_log(c, "after native rewrite part 1");
* Remember, lowering comes last! */
struct radeon_program_transformation common_transformations[] = {
{ &radeonTransformTEX, c },
+ { 0, 0 }
};
- radeonLocalTransform(&c->Base, 1, common_transformations);
+ radeonLocalTransform(&c->Base, common_transformations);
common_transformations[0].function = &radeonTransformALU;
- radeonLocalTransform(&c->Base, 1, common_transformations);
+ radeonLocalTransform(&c->Base, common_transformations);
if (c->Base.Error)
return;
if (c->Base.is_r500) {
struct radeon_program_transformation transformations[] = {
{ &r300_transform_vertex_alu, 0 },
- { &r300_transform_trig_scale_vertex, 0 }
+ { &r300_transform_trig_scale_vertex, 0 },
+ { 0, 0 }
};
- radeonLocalTransform(&c->Base, 2, transformations);
+ radeonLocalTransform(&c->Base, transformations);
if (c->Base.Error)
return;
} else {
struct radeon_program_transformation transformations[] = {
{ &r300_transform_vertex_alu, 0 },
- { &radeonTransformTrigSimple, 0 }
+ { &radeonTransformTrigSimple, 0 },
+ { 0, 0 }
};
- radeonLocalTransform(&c->Base, 2, transformations);
+ radeonLocalTransform(&c->Base, transformations);
if (c->Base.Error)
return;
*/
struct radeon_program_transformation transformations2[] = {
{ &transform_nonnative_modifiers, 0 },
+ { 0, 0 }
};
- radeonLocalTransform(&c->Base, 1, transformations2);
+ radeonLocalTransform(&c->Base, transformations2);
if (c->Base.Error)
return;
*/
struct radeon_program_transformation transformations[] = {
{ &transform_source_conflicts, 0 },
+ { 0, 0 }
};
- radeonLocalTransform(&c->Base, 1, transformations);
+ radeonLocalTransform(&c->Base, transformations);
if (c->Base.Error)
return;
}
*/
void radeonLocalTransform(
struct radeon_compiler * c,
- int num_transformations,
struct radeon_program_transformation* transformations)
{
struct rc_instruction * inst = c->Program.Instructions.Next;
inst = inst->Next;
- for(i = 0; i < num_transformations; ++i) {
+ for(i = 0; transformations[i].function; ++i) {
struct radeon_program_transformation* t = transformations + i;
if (t->function(c, current, t->userData))
void radeonLocalTransform(
struct radeon_compiler *c,
- int num_transformations,
struct radeon_program_transformation* transformations);
unsigned int rc_find_free_temporary(struct radeon_compiler * c);