Fix issue #138
Texture arrays not supporting compressed formats Also fixed loading texture arrays with mipmaps
This commit is contained in:
parent
9965d20c44
commit
18807cf175
@ -298,13 +298,25 @@ class TextureUtil {
|
|||||||
if (glFmt.compressed && data != null){
|
if (glFmt.compressed && data != null){
|
||||||
if (target == GL_TEXTURE_3D){
|
if (target == GL_TEXTURE_3D){
|
||||||
glCompressedTexImage3D(target,
|
glCompressedTexImage3D(target,
|
||||||
i,
|
i,
|
||||||
glFmt.internalFormat,
|
glFmt.internalFormat,
|
||||||
mipWidth,
|
mipWidth,
|
||||||
mipHeight,
|
mipHeight,
|
||||||
mipDepth,
|
mipDepth,
|
||||||
border,
|
border,
|
||||||
data);
|
data);
|
||||||
|
} else if (target == GL_TEXTURE_2D_ARRAY_EXT) {
|
||||||
|
// Upload compressed texture array slice
|
||||||
|
glCompressedTexSubImage3D(target,
|
||||||
|
i,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
index,
|
||||||
|
mipWidth,
|
||||||
|
mipHeight,
|
||||||
|
1,
|
||||||
|
glFmt.internalFormat,
|
||||||
|
data);
|
||||||
}else{
|
}else{
|
||||||
//all other targets use 2D: array, cubemap, 2d
|
//all other targets use 2D: array, cubemap, 2d
|
||||||
glCompressedTexImage2D(target,
|
glCompressedTexImage2D(target,
|
||||||
@ -347,8 +359,8 @@ class TextureUtil {
|
|||||||
0, // xoffset
|
0, // xoffset
|
||||||
0, // yoffset
|
0, // yoffset
|
||||||
index, // zoffset
|
index, // zoffset
|
||||||
width, // width
|
mipWidth, // width
|
||||||
height, // height
|
mipHeight, // height
|
||||||
1, // depth
|
1, // depth
|
||||||
glFmt.format,
|
glFmt.format,
|
||||||
glFmt.dataType,
|
glFmt.dataType,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user