| 17 | } |
| 18 | |
| 19 | void GFXTextureArray::set(U32 width, U32 height, U32 size, GFXFormat format, U32 mipLevels) |
| 20 | { |
| 21 | if (mipLevels == 0 && width == height && isPow2(width)) |
| 22 | { |
| 23 | mipLevels = mLog2(static_cast<F32>(width)) + 1; |
| 24 | } |
| 25 | if ( |
| 26 | mWidth == width && |
| 27 | mHeight == height && |
| 28 | mArraySize == size && |
| 29 | mFormat == format && |
| 30 | mMipLevels == mipLevels |
| 31 | ) |
| 32 | { |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | Release(); |
| 37 | |
| 38 | mWidth = width; |
| 39 | mHeight = height; |
| 40 | mArraySize = size; |
| 41 | mFormat = format; |
| 42 | mIsCompressed = ImageUtil::isCompressedFormat(mFormat); |
| 43 | mMipLevels = getMax(mipLevels, static_cast<U32>(1)); |
| 44 | |
| 45 | mTextures.setSize(size); |
| 46 | |
| 47 | init(); |
| 48 | } |
| 49 | |
| 50 | bool GFXTextureArray::fromTextureArray(const Vector<GFXTexHandle>& textureArray, U32 capacity) |
| 51 | { |