Don't add border when checking image sizes

This commit is contained in:
Elias Naur 2007-04-15 19:33:03 +00:00
parent 5d15006837
commit ca35f3b2b4
4 changed files with 16 additions and 16 deletions

View File

@ -133,7 +133,7 @@ public final class BufferUtils {
else if (buf instanceof LongBuffer || buf instanceof DoubleBuffer)
return 3;
else
throw new IllegalStateException("Unsupported buffer type");
throw new IllegalStateException("Unsupported buffer type: " + buf);
}
/**

View File

@ -148,16 +148,16 @@ class GLChecks {
return calculateImageStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer);
}
static int calculateTexImage1DStorage(Buffer buffer, int format, int type, int width, int border) {
return calculateTexImage1DStorage(format, type, width, border) >> BufferUtils.getElementSizeExponent(buffer);
static int calculateTexImage1DStorage(Buffer buffer, int format, int type, int width) {
return calculateTexImage1DStorage(format, type, width) >> BufferUtils.getElementSizeExponent(buffer);
}
static int calculateTexImage2DStorage(Buffer buffer, int format, int type, int width, int height, int border) {
return calculateTexImage2DStorage(format, type, width, height, border) >> BufferUtils.getElementSizeExponent(buffer);
static int calculateTexImage2DStorage(Buffer buffer, int format, int type, int width, int height) {
return calculateTexImage2DStorage(format, type, width, height) >> BufferUtils.getElementSizeExponent(buffer);
}
static int calculateTexImage3DStorage(Buffer buffer, int format, int type, int width, int height, int depth, int border) {
return calculateTexImage3DStorage(format, type, width, height, depth, border) >> BufferUtils.getElementSizeExponent(buffer);
static int calculateTexImage3DStorage(Buffer buffer, int format, int type, int width, int height, int depth) {
return calculateTexImage3DStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer);
}
/**
@ -175,16 +175,16 @@ class GLChecks {
return calculateBytesPerPixel(format, type) * width * height * depth;
}
private static int calculateTexImage1DStorage(int format, int type, int width, int border) {
return calculateBytesPerPixel(format, type) * (width + (border << 1));
private static int calculateTexImage1DStorage(int format, int type, int width) {
return calculateBytesPerPixel(format, type) * width;
}
private static int calculateTexImage2DStorage(int format, int type, int width, int height, int border) {
return calculateTexImage1DStorage(format, type, width, border) * (height + (border << 1));
private static int calculateTexImage2DStorage(int format, int type, int width, int height) {
return calculateTexImage1DStorage(format, type, width) * height;
}
private static int calculateTexImage3DStorage(int format, int type, int width, int height, int depth, int border) {
return calculateTexImage2DStorage(format, type, width, height, border) * (depth + (border << 1));
private static int calculateTexImage3DStorage(int format, int type, int width, int height, int depth) {
return calculateTexImage2DStorage(format, type, width, height) * depth;
}
private static int calculateBytesPerPixel(int format, int type) {

View File

@ -1261,7 +1261,7 @@ public interface GL11 {
void glTexImage1D(@GLenum int target, int level, int internalformat, @GLsizei int width, int border, @GLenum int format, @GLenum int type,
@BufferObject(BufferKind.UnpackPBO)
@Check(value = "GLChecks.calculateTexImage1DStorage(pixels, format, type, width, border)", canBeNull = true)
@Check(value = "GLChecks.calculateTexImage1DStorage(pixels, format, type, width)", canBeNull = true)
@Const
@GLbyte
@GLshort
@ -1271,7 +1271,7 @@ public interface GL11 {
void glTexImage2D(@GLenum int target, int level, int internalformat, int width, int height, int border, @GLenum int format, @GLenum int type,
@BufferObject(BufferKind.UnpackPBO)
@Check(value = "GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height, border)", canBeNull = true)
@Check(value = "GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height)", canBeNull = true)
@Const
@GLbyte
@GLshort

View File

@ -97,7 +97,7 @@ public interface GL12 {
void glTexImage3D(@GLenum int target, int level, int internalFormat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @GLenum int format, @GLenum int type,
@BufferObject(BufferKind.UnpackPBO)
@Check(value = "GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth, border)", canBeNull = true)
@Check(value = "GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth)", canBeNull = true)
@Const
@GLbyte
@GLshort