From: Brian P. <br...@va...> - 2001-02-06 16:29:39
|
Gareth Hughes wrote: > > Also, the _mesa_convert_teximage() and _mesa_convert_texsubimage() > > functions could be merged into one with a little bit of work. > > You really don't want to do that. You can specifically optimize for > nice power-of-two dimensions with the full teximage convert, while you > have to handle the subimage with a little more care. In fact, the > driver should check for a subimage update that updates the full image > and call _mesa_convert_teximage() instead of _mesa_convert_texsubimage() > -- the tdfx driver does this now. How do power-of-two dimensions make for better optimization? It's the case when then the source image row stride equals the dest image row stride and the stride equals the row length (all in bytes) that you can simplify the conversion down to a single loop. As far as I see it, the only real difference between full image conversion and sub-image conversion is that dest image stride may not match the row length. We handle that now as-is. The only reason I had separate _mesa_convert_teximage() and _mesa_convert_texsubimage() functions was the weirdness involving image rescaling. > > Right. glTexImage2D should do error checking, then call Driver.TexImage2D(). > > The driver function could either do all the work or call a fallback > > routine, like _mesa_store_teximage2D(). > > > > This sounds simple but things like image unpacking, image transfer ops, > > image rescaling, texture compression, etc make it a little complicated. > > Sure, no argument there. It sounds like we agree on the fact that once > Driver.TexImage*D returns, we should have a valid texture image, even if > the driver has to call the fallback routine manually. Right? Right. -Brian |