From: Keith W. <ke...@tu...> - 2005-05-12 07:52:38
|
Aapo Tahkola wrote: > static void build_passthrough( struct tnl_program *p, GLuint inputs ) > { > + GLcontext *ctx = p->ctx; > + GLuint i, nr_lights = 0; > + > + if (ctx->Light.Enabled == GL_FALSE) > + emit_op1(p, VP_OPCODE_MOV, register_output(p, VERT_RESULT_COL0), 0, > + register_input(p, VERT_ATTRIB_COLOR0)); > + else { > + > + for (i = 0; i < MAX_LIGHTS; i++) > + if (ctx->Light.Light[i].Enabled) > + nr_lights++; > + > + if(nr_lights == 0) { /* Darkness */ > + struct ureg dummy = register_input( p, VERT_ATTRIB_POS ); > + > + emit_op1(p, VP_OPCODE_MOV, register_output(p, VERT_RESULT_COL0), 0, > + swizzle(dummy, ZERO, ZERO, ZERO, ZERO)); Slight problem with the above line - the "reduced swizzle" that arb_f_p allows you for arguments doesn't include the ZERO/ONE options, it's only X,Y,Z,W and optional negation. You can get the full swizzle with the SWZ instruction. I'll fix this up, probably to use an explicit constant. Keith |