From: Gareth H. <ga...@va...> - 2001-02-06 04:19:06
|
Keith Whitwell wrote: > > I'll chime in without having read the whole thread. > > Allowing DD functions to fail is always a bad idea. It blurs the distinction > between the actuall work required in core mesa to implement a function, and > the fallback case. These two pieces of code are at very different levels of > abstraction -- they are actually seperated by a whole level. You can get the > same effect by bundling up the fallback case and giving it a well-known name. > If the driver can't handle a case, it explicitly calls the fallback code. > > This is what 'swrast' is all about. A good example is ctx->DD.Clear, which > used to be allowed to fail or perform a partial execution. As a result the > core coded needed to either implement software fallbacks, or know about the > existence of 'swrast' and call into it itself -- this is pretty clunky. Now, > the same behaviour is simply achieved by requiring the driver to call into > swrast if it is unable to fulfill the request from core mesa. To my eye this > is cleaner, and the requirement on the driver is pretty trivial. Thank you, Keith. This is exactly what I'm going for. What I'd like to see is the Tex[Sub]Image* DD calls hand the raw image data to the driver, and what gets hung off the gl_texture_image structure is an image in whatever format the driver wants it in. It is up to the driver to choose the format and to do the conversion, if required. This is why I'd like the conversion utility functions to accept any input, have conversion fastpaths for common cases in a pluggable way (to allow MMX assembly), but have the generic case handling as well. I think this fits the spirit of 3.5 more than the current approach. -- Gareth |