Am Sonntag 17 Dezember 2006 04:03 schrieb Chris Robinson:
On Saturday 16 December 2006 13:24, Roderick Colenbrander wrote:
Hi,
This patch adds 8-bit paletted texture emulation support using a fragment shader.
Won't this break for programs that attempt to use paletted textures and fragment shaders itself? If you need to emulate paletted textures, IMHO, a better option would be to hold the palette and 8-bit image in RAM, and just convert it to RGB(A) when either's changed.
Though hardware has dropped native support for paletted textures, so, also IMHO, that should be done on the ddraw side, instead of making all d3d apps think paletted textures are available.
If you look at dlls/wined3d/surface.c, d3dfmt_get_conv() and d3dfmt_convert_surface() then you'll see that we do exactly that :-) The problem is that unpacking a 8 bit palettized texture to a 32 bit ARGB texture eats a lot of video memory and cpu time. The idea behind the blitting shader is to have unpacking done in the gpu and avoid eating video memory. But as you've correctly seen, this won't work for 3D rendering, only for 2D blitting.