X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fffvertex_prog.c;h=356476e35a5c5b90408a9f971ee4c103935a7e1b;hb=8130375e775bd5ba6a47412b0ea8ec9f23dc5972;hp=80dde4b5aa2338a93a79d3db5ddd4625f3266d7e;hpb=4147bb24d49a10498e00039fc1dc9aa5f1316777;p=mesa.git diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 80dde4b5aa2..356476e35a5 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -46,6 +46,9 @@ #include "shader/prog_statevars.h" +/** Max of number of lights and texture coord units */ +#define NUM_UNITS MAX2(MAX_TEXTURE_COORD_UNITS, MAX_LIGHTS) + struct state_key { unsigned light_color_material_mask:12; unsigned light_global_enabled:1; @@ -77,7 +80,7 @@ struct state_key { unsigned texgen_mode1:4; unsigned texgen_mode2:4; unsigned texgen_mode3:4; - } unit[8]; + } unit[NUM_UNITS]; }; @@ -1306,7 +1309,9 @@ static void build_fog( struct tnl_program *p ) input = swizzle1(register_input(p, VERT_ATTRIB_FOG), X); } + /* result.fog = {abs(f),0,0,1}; */ emit_op1(p, OPCODE_ABS, fog, WRITEMASK_X, input); + emit_op1(p, OPCODE_MOV, fog, WRITEMASK_YZW, get_identity_param(p)); }