[1/6] Disable GL_TEXTURE_2D in the standard blit setup

Stefan Dösinger stefan at codeweavers.com
Wed Nov 28 13:15:33 CST 2007


This patchset implements conditional non power of two textures using 
GL_ARB_texture_rectangle instead of using a bigger power of two texture and 
scaling texture coordinates. This has the following advantages:

1) The clamp to border is enforced. With our past approach, textures might be 
read outside the defined NP2 size into the padding areas, and we had no way 
to clamp to an arbitrary line inside the texture. This is the main reason for 
these patches

2) Better memory efficiency: No extra video memory is needed for the padding

3) Faster: Since we do not have to repack on download, we can use pbos for 
loading conditional NP2 textures

Missing support for real non power of two textures is quite widespread among 
cards: Older nvidia cards do not support GL_ARB_texture_non_power_of_two, and 
all radeon cards up to and including R500 chips(X1000 series) have the 
limitations.

Issues:

* Addressing: Unfortunately, texture_rectangle uses non-normalized 
coordinates, so we still have to change the matrices, and it does not fix 
shaders.

* We have to deal with another texture target: The state manager has to take 
care about enabling / disabling GL_TEXTURE_RECTANGLE_ARB, and shaders have to 
use a special instruction to sample from these textures. This instruction is 
implemented in these patches, but NP2 textures in shaders remain broken as 
they were before because the texture coordinates are incorrect.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Disable-GL_TEXTURE_2D-in-the-standard-blit-setup.patch
Type: text/x-diff
Size: 7265 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20071128/69a1e759/attachment.patch 


More information about the wine-patches mailing list