The thought of making a generic texture format selection routine had
occured to me, too. But it seemed to be too much hardware dependent and
I didn't feel like spending much thought on a general solution. Your
suggestion is quite general but I'm not sure it would be worth the
effort.
The glTexImage2D manpage lists 38 internalFormats and 20 types. That would make 760 entries in the matrix you described, each being a priority sorted list/array of texture formats. And that's not including the "made up" formats like GL_UNSIGNED_24_RGB. I don't want to be the one typing that matrix. ;-)
I think you're over estimating it. There's only 32 internalFormats because the non-sized ones (i.e., GL_RGB, GL_INTENSITY, etc.) aren't used in the matrix. The driver has to convert them to a sized type before calling the generic routine. Not only that, but there aren't MESA_FORMAT_ tags for all of the internalFormats. I think we could treat GL_LUMINANCE4_ALPHA4 and GL_LUMINANCE6_ALPHA2 as GL_LUMINANCE8_ALPHA8. :) That should reduce the number of unique rows to not more than 20. It's really driven by what MESA_FORMAT_ values are available.
For the 'types' there are the 12 packed modes listed in the man page, the 2 YCbCr modes, plus the various "made up" formats. Again, I think that entries like {GL_INT, GL_RGB} and {GL_SHORT, GL_RGB} could be treated as the same. That would again be driven by what MESA_FORMAT_ values are available.
I admit, the generation of that table could be automated, though the algorithm for that may well be longer than the four ChooseTextureFormat routines I modified taken together. And it would be definitely harder to debug or verify. If we had a lot more drivers to maintain it may be worth the effort. But right now I believe the current implementation is the most efficient and economic solution.
Either automated or driven by template header files. In any case, it's obviously not a high priority. :)
------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel
