MantisBT - VTK
View Issue Details
0006450VTK(No Category)public2008-02-26 23:442009-07-10 13:34
Michael Halle 
François Bertel 
normalfeatureN/A
closedfixed 
 
 
0006450: Patch to add support for non-power-of-two textures in OpenGL 2.0
This patch against the nightly CVS allows for non-power-of-two textures if that feature is supported in OpenGL. The fallback is the current behavior (resample to nearest power of two), which is also used if the texture is too large. For large textures, this step should save both processing time and memory.

The patch is slightly inefficient in that it instantiates an extension manager object at texture creation to query for the appropriate OpenGL extension. This step only happens once, though.
I have the version patched off the current VTK version for Slicer as well, if needed.
No tags attached.
patch power-of-two.patch (3,087) 2008-02-26 23:45
https://www.vtk.org/Bug/file/6329/power-of-two.patch
patch power-of-two-unified.patch (4,266) 2008-10-03 07:51
https://www.vtk.org/Bug/file/6747/power-of-two-unified.patch
Issue History
2008-02-26 23:44Michael HalleNew Issue
2008-02-26 23:45Michael HalleFile Added: power-of-two.patch
2008-10-03 07:51Mathieu MalaterreFile Added: power-of-two-unified.patch
2008-10-03 07:52Mathieu MalaterreNote Added: 0013718
2008-10-03 07:52Mathieu MalaterreStatusbacklog => tabled
2008-10-03 07:52Mathieu MalaterreAssigned To => François Bertel
2008-10-03 07:54Mathieu MalaterreNote Added: 0013720
2008-10-03 07:58Mathieu MalaterreNote Added: 0013721
2009-05-20 14:02François BertelNote Added: 0016536
2009-05-20 14:02François BertelStatustabled => @80@
2009-05-20 14:02François BertelResolutionopen => fixed
2009-05-21 14:14François BertelNote Added: 0016544
2009-05-21 14:14François BertelStatus@80@ => @20@
2009-05-21 14:14François BertelResolutionfixed => reopened
2009-05-22 08:19François BertelNote Added: 0016545
2009-05-22 09:51François BertelNote Added: 0016548
2009-06-15 16:02Brad KingNote Added: 0016725
2009-07-10 13:34François BertelStatus@20@ => closed
2009-07-10 13:34François BertelResolutionreopened => fixed
2011-06-16 13:11Zack GalbreathCategory => (No Category)

Notes
(0013718)
Mathieu Malaterre   
2008-10-03 07:52   
First patch was done using default diff option, which means basically it cannot be applied to any other version than exactly the one used during the patch.
Applied patch to 1.66 version, then redo patch using unified output.
(0013720)
Mathieu Malaterre   
2008-10-03 07:54   
Tested unified patch on CVS, even if patch report error, it can safely be discarded.

 patch -p0 < /tmp/power-of-two-unified.patch
patching file vtkOpenGLTexture.cxx
Hunk #1 FAILED at 21.
Hunk #2 succeeded at 40 (offset 3 lines).
Hunk #3 succeeded at 266 (offset 97 lines).
Hunk #4 succeeded at 358 (offset 97 lines).
Hunk #5 succeeded at 614 (offset 132 lines).
1 out of 5 hunks FAILED -- saving rejects to file vtkOpenGLTexture.cxx.rej
patching file vtkOpenGLTexture.h
(0013721)
Mathieu Malaterre   
2008-10-03 07:58   
Mike,
Shouldn't the member var: AllowsNonPowerOfTwoTextures now be initialized in the member function: vtkOpenGLTexture::Initialize ?
(0016536)
François Bertel   
2009-05-20 14:02   
Fixed:

VTK/Rendering/vtkOpenGLTexture.cxx, revision 1.76
VTK/Rendering/vtkOpenGLTexture.h, revision 1.28
(0016544)
François Bertel   
2009-05-21 14:14   
The fix passes with Mesa 7.0.4 (on dash6)

The fix seems to make the builds using Mesa GIT to fail for the following tests:

TestTextureRGBA
TestTextureRGBADepthPeeling
TestTStripsColorsTCoords
TestTStripsNormalsColorsTCoords
TestTStripsNormalsTCoords
TestTStripsTCoords

The builds are:
gargon.hooperlab / Linux-gcc-4.3.2-x86_64-DevelMesa
and
hythloth.kitware / Linux-gcc41

The tests use non-power-of-two textures:
rgba texture is 100x19
beach.jpg is 200x200

Tomorrow (2009/05/22), dash6 will have vtk builds with Mesa 7.4.2 instead of Mesa 7.0.4 to try to locate the bug in Mesa.
(0016545)
François Bertel   
2009-05-22 08:19   
Confirmation that it fails with Mesa 7.4.2 on dash6. Revert dash6 to Mesa 7.0.4.
(0016548)
François Bertel   
2009-05-22 09:51   
Bug reported to Mesa bug tracker:

https://bugs.freedesktop.org/show_bug.cgi?id=21872 [^]
(0016725)
Brad King   
2009-06-15 16:02   
Mesa commit "ad053d90f01852ee27e36a21402543562bf46ad6" causes the problem (thanks to "git bisect"). I've updated the Mesa bug entry with this information.