Throw GL_INVALID_OPERATION if mipmaps are specified for non-square textures
This commit is contained in:
parent
f39e2c0972
commit
3395f17687
|
@ -206,6 +206,13 @@ void APIENTRY glGenerateMipmapEXT(GLenum target) {
|
||||||
|
|
||||||
TextureObject* tex = _glGetBoundTexture();
|
TextureObject* tex = _glGetBoundTexture();
|
||||||
|
|
||||||
|
if(tex->width != tex->height) {
|
||||||
|
fprintf(stderr, "[GL ERROR] Mipmaps cannot be supported on non-square textures\n");
|
||||||
|
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
||||||
|
_glKosPrintError();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(!tex || !tex->data || !tex->mipmapCount) {
|
if(!tex || !tex->data || !tex->mipmapCount) {
|
||||||
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
||||||
_glKosPrintError();
|
_glKosPrintError();
|
||||||
|
|
|
@ -852,6 +852,11 @@ void APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalFormat,
|
||||||
_glKosThrowError(GL_INVALID_VALUE, "glTexImage2D");
|
_glKosThrowError(GL_INVALID_VALUE, "glTexImage2D");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(level > 0 && width != height) {
|
||||||
|
fprintf(stderr, "[GL ERROR] Mipmaps cannot be supported on non-square textures\n");
|
||||||
|
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
||||||
|
}
|
||||||
|
|
||||||
if(border) {
|
if(border) {
|
||||||
_glKosThrowError(GL_INVALID_VALUE, "glTexImage2D");
|
_glKosThrowError(GL_INVALID_VALUE, "glTexImage2D");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user