diff options
author | Sven Gothel <[email protected]> | 2009-10-18 07:42:54 -0700 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-10-18 07:53:05 -0700 |
commit | e4b0e57b9fe28296fcd8d9eb372242c33643886b (patch) | |
tree | f1d2c72b1dc17674c9a7dc14049960ef65c3d350 /make/config/jogl/gl-common.cfg | |
parent | 4d493ac36bd5d763d2af3243e799bbaef3679594 (diff) |
New iteration of check 'imageSizeInBytes':
Premises:
See http://www.glprogramming.com/red/chapter08.html
"If the rectangle in memory is larger than the subrectangle that's being drawn or read,
you need to specify the actual length (measured in pixels) of the larger rectangle with *ROW_LENGTH. "
This equals ROW_LENGTH == SubPicture-Width + 'Dirt', ie the offset to go from one line to the next.
"You also need to specify the number of rows and pixels to skip before starting to copy the data for the subrectangle.
These numbers are set using the parameters *SKIP_ROWS and *SKIP_PIXELS, as shown in Figure 8-9.
By default, both parameters are 0, so you start at the lower-left corner."
This equals to a one time offset _before_ you start copy the data, ie with your DMA engine,
using ROW_LENGTH and HEIGHT only.
Compared to Mesa3D's implementation (proof):
http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/x11/pixelstore.c
Line 78 - 200
PixelStore State Tracker: Store the values in the PixelStore structure.
http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/x11/pixel.c
Line 82 - 155
Line 210: Start position is set one time using SKIP_* values the same way we do.
Line 228: Jump to the first pixel in the newxt row, just using ROW_LENGTH
Line 230: Jump to the first pixel in the next 'image' just using imageSize,
rowsPerImage = IMAGE_HEIGHT>0?IMAGE_HEIGHT:height;
groupsPerRow = ROW_LENGTH>0?ROW_LENGTH:width;
groupSize = elementSize * components;
rowSize = groupsPerRow * groupSize;
imageSize = rowSize * rowsPerImage;
changes:
Removed redundand 'dimension' parameted, which is derived from depth and height,
1D == depth:1 height:1
2D == depth:1 height>1
nD == depth>1 height>1
Safe fail depth to >= 1
Safe fail height to >= 1D
Take either the ROW_LENGTH / IMAGE_HEIGHT PixelStore value if > 0,
or the given width / height.
Diffstat (limited to 'make/config/jogl/gl-common.cfg')
-rw-r--r-- | make/config/jogl/gl-common.cfg | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index a1414f0ad..37c030cb5 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -519,20 +519,20 @@ JavaPrologue glGetTexImage depth = tmp[0]; JavaPrologue glGetTexImage } # Range check directives for various image-related routines -RangeCheckBytes glColorTable 5 imageSizeInBytes({3}, {4}, {2} , 1 , 1 , 1, false) -RangeCheckBytes glColorTableEXT 5 imageSizeInBytes({3}, {4}, {2} , 1 , 1 , 1, false) -RangeCheckBytes glConvolutionFilter1D 5 imageSizeInBytes({3}, {4}, {2} , 1 , 1 , 1, false) -RangeCheckBytes glConvolutionFilter2D 6 imageSizeInBytes({4}, {5}, {2} , {3} , 1 , 2, false) -RangeCheckBytes glDrawPixels 4 imageSizeInBytes({2}, {3}, {0} , {1} , 1 , 2, false) -RangeCheckBytes glReadPixels 6 imageSizeInBytes({4}, {5}, {2} , {3} , 1 , 2, true) -RangeCheckBytes glTexImage1D 7 imageSizeInBytes({5}, {6}, {3} , 1 , 1 , 1, false) -RangeCheckBytes glTexImage2D 8 imageSizeInBytes({6}, {7}, {3} , {4} , 1 , 2, false) -RangeCheckBytes glTexImage3D 9 imageSizeInBytes({7}, {8}, {3} , {4} , {5} , 3, false) -RangeCheckBytes glTexSubImage1D 6 imageSizeInBytes({4}, {5}, {3} , 1 , 1 , 1, false) -RangeCheckBytes glTexSubImage2D 8 imageSizeInBytes({6}, {7}, {4} , {5} , 1 , 2, false) -RangeCheckBytes glTexSubImage3D 10 imageSizeInBytes({8}, {9}, {5} , {6} , {7} , 3, false) +RangeCheckBytes glColorTable 5 imageSizeInBytes({3}, {4}, {2} , 1 , 1 , false) +RangeCheckBytes glColorTableEXT 5 imageSizeInBytes({3}, {4}, {2} , 1 , 1 , false) +RangeCheckBytes glConvolutionFilter1D 5 imageSizeInBytes({3}, {4}, {2} , 1 , 1 , false) +RangeCheckBytes glConvolutionFilter2D 6 imageSizeInBytes({4}, {5}, {2} , {3} , 1 , false) +RangeCheckBytes glDrawPixels 4 imageSizeInBytes({2}, {3}, {0} , {1} , 1 , false) +RangeCheckBytes glReadPixels 6 imageSizeInBytes({4}, {5}, {2} , {3} , 1 , true) +RangeCheckBytes glTexImage1D 7 imageSizeInBytes({5}, {6}, {3} , 1 , 1 , false) +RangeCheckBytes glTexImage2D 8 imageSizeInBytes({6}, {7}, {3} , {4} , 1 , false) +RangeCheckBytes glTexImage3D 9 imageSizeInBytes({7}, {8}, {3} , {4} , {5} , false) +RangeCheckBytes glTexSubImage1D 6 imageSizeInBytes({4}, {5}, {3} , 1 , 1 , false) +RangeCheckBytes glTexSubImage2D 8 imageSizeInBytes({6}, {7}, {4} , {5} , 1 , false) +RangeCheckBytes glTexSubImage3D 10 imageSizeInBytes({8}, {9}, {5} , {6} , {7} , false) # This may produce wrong answers for 1D textures -RangeCheckBytes glGetTexImage 4 imageSizeInBytes({2}, {3}, width , height , depth, ((depth > 1) ? 3 : 2), true) +RangeCheckBytes glGetTexImage 4 imageSizeInBytes({2}, {3}, width , height , depth, true) # Note we don't support glTexImage4DSGIS / glTexSubImage4DSGIS # FIXME: add the following unpack operations: # glBitmap, glPolygonStipple |