From: Brian P. <br...@va...> - 2001-03-28 16:17:01
|
Gareth Hughes wrote: > > Brian Paul wrote: > > > > In the s/w rasterizer I've been replacing the texture Format and Type > > checks with comparisons against the new MESA_FORMAT_* tokens. > > > > And in the texture-object-completeness function, I'm going to check > > if all mipmaps are of the same format by comparing the TexFormat field > > instead of the Format/Type fields. > > > > So, the Type field really might not be needed anymore. However, it > > wouldn't be bad to keep it around a bit longer, I think. > > Sounds good. > > I have a quick question regarding color lookup tables. If a driver > doesn't support paletted textures, the only failure case is when the > data format is a GL_COLOR_INDEX(_*) type and the internalFormat is > GL_COLOR_INDEX, right? If the internalFormat is anything else, it goes > through the color lookup table, which defaults to 0 for all channels, > right? Right. Though it's the format that would be GL_COLOR_INDEX and the internalFormat would be GL_COLOR_INDEX_*. > So, if I've got this right, the driver would have to inspect > internalFormat if the data format was GL_COLOR_INDEX(_*) and choose an > appropriate final destination format, skip the first conversion pass, > call the texstore functions to perform the LUT conversion, and then call > _mesa_convert_texsubimage*() to convert the GLchan-based post-LUT image > to the final image format. Does this sound correct? That sounds right. I'd have to review the code to say for certain. I think a few more utility routines may be in order. Because in all the drivers' TexImage*() functions we always have to do something like this (lots of details omitted): if (anyPixelTransferOps) { allocate tempBuffer _mesa_transfer_teximage(dest = tempBuffer, source = userData) _mesa_convert_texsubimage2d(dest = texImage->Data, src = tempBuffer); free tempBuffer } else { _mesa_convert_texsubimage2d(dest = texImage->Data, src = tempBuffer); } In the 3dfx driver it's more complicated because of the image rescaling that's sometimes needed. -Brian |