mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 07:56:55 +02:00
Fixing the spam issue triggered by the external textures, removed 2 warnings
This commit is contained in:
parent
d7dfab6405
commit
8240c3f761
4 changed files with 7 additions and 3 deletions
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue