Don't add border when checking image sizes
This commit is contained in:
parent
5d15006837
commit
ca35f3b2b4
|
@ -133,7 +133,7 @@ public final class BufferUtils {
|
||||||
else if (buf instanceof LongBuffer || buf instanceof DoubleBuffer)
|
else if (buf instanceof LongBuffer || buf instanceof DoubleBuffer)
|
||||||
return 3;
|
return 3;
|
||||||
else
|
else
|
||||||
throw new IllegalStateException("Unsupported buffer type");
|
throw new IllegalStateException("Unsupported buffer type: " + buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -148,16 +148,16 @@ class GLChecks {
|
||||||
return calculateImageStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer);
|
return calculateImageStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int calculateTexImage1DStorage(Buffer buffer, int format, int type, int width, int border) {
|
static int calculateTexImage1DStorage(Buffer buffer, int format, int type, int width) {
|
||||||
return calculateTexImage1DStorage(format, type, width, border) >> BufferUtils.getElementSizeExponent(buffer);
|
return calculateTexImage1DStorage(format, type, width) >> BufferUtils.getElementSizeExponent(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int calculateTexImage2DStorage(Buffer buffer, int format, int type, int width, int height, int border) {
|
static int calculateTexImage2DStorage(Buffer buffer, int format, int type, int width, int height) {
|
||||||
return calculateTexImage2DStorage(format, type, width, height, border) >> BufferUtils.getElementSizeExponent(buffer);
|
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) {
|
static int calculateTexImage3DStorage(Buffer buffer, int format, int type, int width, int height, int depth) {
|
||||||
return calculateTexImage3DStorage(format, type, width, height, depth, border) >> BufferUtils.getElementSizeExponent(buffer);
|
return calculateTexImage3DStorage(format, type, width, height, depth) >> BufferUtils.getElementSizeExponent(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -175,16 +175,16 @@ class GLChecks {
|
||||||
return calculateBytesPerPixel(format, type) * width * height * depth;
|
return calculateBytesPerPixel(format, type) * width * height * depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int calculateTexImage1DStorage(int format, int type, int width, int border) {
|
private static int calculateTexImage1DStorage(int format, int type, int width) {
|
||||||
return calculateBytesPerPixel(format, type) * (width + (border << 1));
|
return calculateBytesPerPixel(format, type) * width;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int calculateTexImage2DStorage(int format, int type, int width, int height, int border) {
|
private static int calculateTexImage2DStorage(int format, int type, int width, int height) {
|
||||||
return calculateTexImage1DStorage(format, type, width, border) * (height + (border << 1));
|
return calculateTexImage1DStorage(format, type, width) * height;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int calculateTexImage3DStorage(int format, int type, int width, int height, int depth, int border) {
|
private static int calculateTexImage3DStorage(int format, int type, int width, int height, int depth) {
|
||||||
return calculateTexImage2DStorage(format, type, width, height, border) * (depth + (border << 1));
|
return calculateTexImage2DStorage(format, type, width, height) * depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int calculateBytesPerPixel(int format, int type) {
|
private static int calculateBytesPerPixel(int format, int type) {
|
||||||
|
|
|
@ -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,
|
void glTexImage1D(@GLenum int target, int level, int internalformat, @GLsizei int width, int border, @GLenum int format, @GLenum int type,
|
||||||
@BufferObject(BufferKind.UnpackPBO)
|
@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
|
@Const
|
||||||
@GLbyte
|
@GLbyte
|
||||||
@GLshort
|
@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,
|
void glTexImage2D(@GLenum int target, int level, int internalformat, int width, int height, int border, @GLenum int format, @GLenum int type,
|
||||||
@BufferObject(BufferKind.UnpackPBO)
|
@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
|
@Const
|
||||||
@GLbyte
|
@GLbyte
|
||||||
@GLshort
|
@GLshort
|
||||||
|
|
|
@ -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,
|
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)
|
@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
|
@Const
|
||||||
@GLbyte
|
@GLbyte
|
||||||
@GLshort
|
@GLshort
|
||||||
|
|
Loading…
Reference in New Issue