Fixing the spam issue triggered by the external textures, removed 2 warnings

This commit is contained in:
samcake 2017-04-27 18:05:52 -07:00
parent d7dfab6405
commit 8240c3f761
4 changed files with 7 additions and 3 deletions

View file

@ -18,6 +18,9 @@ public:
GLenum format;
GLenum type;
GLTexelFormat(GLenum glinternalFormat, GLenum glformat, GLenum gltype) : internalFormat(glinternalFormat), format(glformat), type(gltype) {}
GLTexelFormat(GLenum glinternalFormat) : internalFormat(glinternalFormat) {}
bool isCompressed() const;
static GLTexelFormat evalGLTexelFormat(const Element& dstFormat) {

View file

@ -103,7 +103,7 @@ GLTexture::GLTexture(const std::weak_ptr<GLBackend>& backend, const Texture& tex
GLObject(backend, texture, id),
_source(texture.source()),
_target(getGLTextureType(texture)),
_texelFormat(GLTexelFormat::evalGLTexelFormat(texture.getTexelFormat(), texture.getStoredMipFormat()))
_texelFormat(GLTexelFormat::evalGLTexelFormatInternal(texture.getTexelFormat()))
{
Backend::setGPUObject(texture, this);
}

View file

@ -358,7 +358,7 @@ void GL41VariableAllocationTexture::promote() {
// Collect the size of the first face, and then compute the total size offset needed for this mip level
glGetTexLevelParameteriv(faceTargets.front(), sourceLevel, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &sourceMip._faceSize);
sourceMip._size = faceTargets.size() * sourceMip._faceSize;
sourceMip._size = (GLint) faceTargets.size() * sourceMip._faceSize;
sourceMip._offset = bufferOffset;
bufferOffset += sourceMip._size;
}
@ -482,7 +482,7 @@ void GL41VariableAllocationTexture::demote() {
// Collect the size of the first face, and then compute the total size offset needed for this mip level
glGetTexLevelParameteriv(faceTargets.front(), sourceLevel, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &sourceMip._faceSize);
sourceMip._size = faceTargets.size() * sourceMip._faceSize;
sourceMip._size = (GLint) faceTargets.size() * sourceMip._faceSize;
sourceMip._offset = bufferOffset;
bufferOffset += sourceMip._size;
}

View file

@ -216,6 +216,7 @@ void Texture::MemoryStorage::assignMipFaceData(uint16 level, uint8 face, const s
TexturePointer Texture::createExternal(const ExternalRecycler& recycler, const Sampler& sampler) {
TexturePointer tex = std::make_shared<Texture>(TextureUsageType::EXTERNAL);
tex->_type = TEX_2D;
tex->_texelFormat = Element::COLOR_RGBA_32;
tex->_maxMipLevel = 0;
tex->_sampler = sampler;
tex->setExternalRecycler(recycler);