So the nv40 code is doing the wrong thing... :) The rule currently is that the generic tags are just tags and are used only to establish mapping between fragment shader and vertex shader. Additionaly the vertex shader should always supply at least the inputs required by the fragment shader. Taking a guess, without specific hardware support for routing, nv40 should translate the fragment shader inputs into successive SRC_TC slots, and build a mapping from semantic-index -> SRC_TC slot that can be applied when translating the vertex shader.
You might complain that in this world a vertex shader will require multiple translations depending on which fragment shader is bound, as one taking fewer inputs will have different numberings. That's true, but you also get the opportunity to specialize the vertex shader as a result, eliminating dead code in each case - which may be worth the effort. Anyway, it sounds like what you really want is to change the linkage rules. This is possible, of course, but we should discuss it in those terms. And then if we do revisit those rules, we should take a deeper look at linkage and figure out if anything else can be changed. Keith ________________________________________ From: luca.barbi...@gmail.com [luca.barbi...@gmail.com] On Behalf Of Luca Barbieri [l...@luca-barbieri.com] Sent: Friday, January 29, 2010 10:15 AM To: Brian Paul Cc: Keith Whitwell; mesa3d-dev@lists.sourceforge.net Subject: Re: [Mesa3d-dev] [PATCH] glsl: put varyings in texcoord slots As a concrete example, the current nv40 code does this during fragment program translation. case TGSI_SEMANTIC_GENERIC: if (fdec->Semantic.Index <= 7) { hw = NV40_FP_OP_INPUT_SRC_TC(fdec->Semantic. Index); } else { NOUVEAU_ERR("bad generic semantic index\n"); return FALSE; } break; As a result, GLSL completely fails to work on nv30 and nv40. nv50 instead seems to have hardware routing support, which is used by the driver. ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev