| 247 | } |
| 248 | |
| 249 | bool GL46TextureArray::GenerateMipmaps() |
| 250 | { |
| 251 | if (CanAutoGenerateMipmaps()) |
| 252 | { |
| 253 | // Save current binding for this texture target in order to restore it |
| 254 | // when done because the gl texture object is needed to be bound to |
| 255 | // this texture target for the operations to follow. |
| 256 | GLint prevBinding; |
| 257 | glGetIntegerv(mTargetBinding, &prevBinding); |
| 258 | glBindTexture(mTarget, mGLHandle); |
| 259 | |
| 260 | // Generate the mipmaps. All of this binding save and restore is not |
| 261 | // necessary in OpenGL 4.6, where glGenerateTextureMipamap(mGLHandle) |
| 262 | // can simply be used. |
| 263 | glGenerateMipmap(mTarget); |
| 264 | |
| 265 | glBindTexture(mTarget, prevBinding); |
| 266 | |
| 267 | return true; |
| 268 | } |
| 269 | return false; |
| 270 | } |
| 271 | |
| 272 | bool GL46TextureArray::DoCopyCpuToGpu(uint32_t item, uint32_t level) |
| 273 | { |
no test coverage detected