Am Dienstag 17 Juni 2008 02:46:11 schrieb Brian Paul: > > Would it > > be better to do this stuff inside Gallium, or should each driver be > > responsible for unpacking and packing shaders as much as they need? > > With regards to both the LIT and MUL/ADD transformations, I'd prefer to > see that kind of thing done in a re-usable gallium/mesa utility function > than duplicated in multiple drivers.
I agree with that goal. I'm still a bit unsure about how the current intermediate program should be passed to such functions. The straightforward thing to seems to be simply passing a gl_program. However, note that simply rewriting the original instruction array is a bad idea, because at least our driver has to perform some modifications to the program based on external state. Some examples: 1. We want to (IIRC: have to, due to some hardware quirks) change vertex programs depending on which of the outputs are actually read by the active fragment program. 2. We want to rewrite TEX instructions in fragment programs *before* other transformations; however for shadow textures, the resulting code depends on the compare function of the referenced texture. In other words, one fragment or vertex program can result in many different final compilation results, depending on the context in which the program is used. So should such generic transformation functions take some different structure as parameter? Or should the driver just create a full copy of the gl_program before compiling the program? Once we've created the machine-readable code, we could discard this copy. cu, Nicolai ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
