static struct ureg get_material( struct tnl_program *p, GLuint side, GLuint property ) { GLuint attrib = material_attrib(side, property); if (p->color_materials & (1<<attrib)) return register_input(p, VERT_ATTRIB_COLOR0); else if (p->materials & (1<<attrib)) return register_input( p, attrib + _TNL_ATTRIB_MAT_FRONT_AMBIENT ); else return register_param3( p, STATE_MATERIAL, side, property ); }
static struct ureg get_lightprod( struct tnl_program *p, GLuint light, GLuint side, GLuint property ) { GLuint attrib = material_attrib(side, property); if (p->materials & (1<<attrib)) { struct ureg light_value = register_param3(p, STATE_LIGHT, light, property); struct ureg material_value = get_material(p, side, property); struct ureg tmp = get_temp(p); emit_op2(p, OPCODE_MUL, tmp, 0, light_value, material_value); return tmp; } else return register_param4(p, STATE_LIGHTPROD, light, side, property); }
static struct ureg get_material( struct tnl_program *p, GLuint side, GLuint property ) { GLuint attrib = material_attrib(side, property); if (p->color_materials & (1<<attrib)) return register_input(p, VERT_ATTRIB_COLOR0); else if (p->materials & (1<<attrib)) { /* Put material values in the GENERIC slots -- they are not used * for anything in fixed function mode. */ return register_input( p, attrib + VERT_ATTRIB_GENERIC0 ); } else return register_param3( p, STATE_MATERIAL, side, property ); }