Merge branch 'ambient' of https://github.com/samcake/hifi into ambient

This commit is contained in:
samcake 2017-03-30 09:43:07 -07:00
commit a310a9c66c

View file

@ -79,9 +79,14 @@ GL41Texture::GL41Texture(const std::weak_ptr<GLBackend>& backend, const Texture&
uint8_t face = 0;
for (GLenum target : getFaceTargets(_target)) {
const Byte* mipData = nullptr;
gpu::Texture::PixelsPointer mip;
if (_gpuObject.isStoredMipFaceAvailable(mipLevel, face)) {
auto mip = _gpuObject.accessStoredMipFace(mipLevel, face);
mipData = mip->readData();
mip = _gpuObject.accessStoredMipFace(mipLevel, face);
if (mip) {
mipData = mip->readData();
} else {
mipData = nullptr;
}
}
glTexImage2D(target, mipLevel, texelFormat.internalFormat, dimensions.x, dimensions.y, 0, texelFormat.format, texelFormat.type, mipData);
(void)CHECK_GL_ERROR();