Merge pull request #9104 from jherico/logspam

Reduce logspam, change some debug output to warning
This commit is contained in:
Brad Hefta-Gaub 2016-11-21 14:29:19 -08:00 committed by GitHub
commit abed723a01
6 changed files with 34 additions and 48 deletions

View file

@ -141,19 +141,19 @@ void GLBackend::downloadFramebuffer(const FramebufferPointer& srcFramebuffer, co
auto readFBO = getFramebufferID(srcFramebuffer); auto readFBO = getFramebufferID(srcFramebuffer);
if (srcFramebuffer && readFBO) { if (srcFramebuffer && readFBO) {
if ((srcFramebuffer->getWidth() < (region.x + region.z)) || (srcFramebuffer->getHeight() < (region.y + region.w))) { if ((srcFramebuffer->getWidth() < (region.x + region.z)) || (srcFramebuffer->getHeight() < (region.y + region.w))) {
qCDebug(gpugllogging) << "GLBackend::downloadFramebuffer : srcFramebuffer is too small to provide the region queried"; qCWarning(gpugllogging) << "GLBackend::downloadFramebuffer : srcFramebuffer is too small to provide the region queried";
return; return;
} }
} }
if ((destImage.width() < region.z) || (destImage.height() < region.w)) { if ((destImage.width() < region.z) || (destImage.height() < region.w)) {
qCDebug(gpugllogging) << "GLBackend::downloadFramebuffer : destImage is too small to receive the region of the framebuffer"; qCWarning(gpugllogging) << "GLBackend::downloadFramebuffer : destImage is too small to receive the region of the framebuffer";
return; return;
} }
GLenum format = GL_BGRA; GLenum format = GL_BGRA;
if (destImage.format() != QImage::Format_ARGB32) { if (destImage.format() != QImage::Format_ARGB32) {
qCDebug(gpugllogging) << "GLBackend::downloadFramebuffer : destImage format must be FORMAT_ARGB32 to receive the region of the framebuffer"; qCWarning(gpugllogging) << "GLBackend::downloadFramebuffer : destImage format must be FORMAT_ARGB32 to receive the region of the framebuffer";
return; return;
} }

View file

@ -29,19 +29,19 @@ bool GLFramebuffer::checkStatus(GLenum target) const {
result = true; result = true;
break; break;
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
qCDebug(gpugllogging) << "GLFramebuffer::syncGPUObject : Framebuffer not valid, GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT."; qCWarning(gpugllogging) << "GLFramebuffer::syncGPUObject : Framebuffer not valid, GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT.";
break; break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
qCDebug(gpugllogging) << "GLFramebuffer::syncGPUObject : Framebuffer not valid, GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT."; qCWarning(gpugllogging) << "GLFramebuffer::syncGPUObject : Framebuffer not valid, GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT.";
break; break;
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
qCDebug(gpugllogging) << "GLFramebuffer::syncGPUObject : Framebuffer not valid, GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER."; qCWarning(gpugllogging) << "GLFramebuffer::syncGPUObject : Framebuffer not valid, GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER.";
break; break;
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
qCDebug(gpugllogging) << "GLFramebuffer::syncGPUObject : Framebuffer not valid, GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER."; qCWarning(gpugllogging) << "GLFramebuffer::syncGPUObject : Framebuffer not valid, GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER.";
break; break;
case GL_FRAMEBUFFER_UNSUPPORTED: case GL_FRAMEBUFFER_UNSUPPORTED:
qCDebug(gpugllogging) << "GLFramebuffer::syncGPUObject : Framebuffer not valid, GL_FRAMEBUFFER_UNSUPPORTED."; qCWarning(gpugllogging) << "GLFramebuffer::syncGPUObject : Framebuffer not valid, GL_FRAMEBUFFER_UNSUPPORTED.";
break; break;
} }
return result; return result;

View file

@ -119,7 +119,7 @@ GLShader* compileBackendProgram(GLBackend& backend, const Shader& program) {
if (object) { if (object) {
shaderGLObjects.push_back(object->_shaderObjects[version].glshader); shaderGLObjects.push_back(object->_shaderObjects[version].glshader);
} else { } else {
qCDebug(gpugllogging) << "GLShader::compileBackendProgram - One of the shaders of the program is not compiled?"; qCWarning(gpugllogging) << "GLShader::compileBackendProgram - One of the shaders of the program is not compiled?";
return nullptr; return nullptr;
} }
} }

View file

@ -26,25 +26,25 @@ bool checkGLError(const char* name) {
} else { } else {
switch (error) { switch (error) {
case GL_INVALID_ENUM: case GL_INVALID_ENUM:
qCDebug(gpugllogging) << "GLBackend::" << name << ": An unacceptable value is specified for an enumerated argument.The offending command is ignored and has no other side effect than to set the error flag."; qCWarning(gpugllogging) << "GLBackend::" << name << ": An unacceptable value is specified for an enumerated argument.The offending command is ignored and has no other side effect than to set the error flag.";
break; break;
case GL_INVALID_VALUE: case GL_INVALID_VALUE:
qCDebug(gpugllogging) << "GLBackend" << name << ": A numeric argument is out of range.The offending command is ignored and has no other side effect than to set the error flag"; qCWarning(gpugllogging) << "GLBackend" << name << ": A numeric argument is out of range.The offending command is ignored and has no other side effect than to set the error flag";
break; break;
case GL_INVALID_OPERATION: case GL_INVALID_OPERATION:
qCDebug(gpugllogging) << "GLBackend" << name << ": The specified operation is not allowed in the current state.The offending command is ignored and has no other side effect than to set the error flag.."; qCWarning(gpugllogging) << "GLBackend" << name << ": The specified operation is not allowed in the current state.The offending command is ignored and has no other side effect than to set the error flag..";
break; break;
case GL_INVALID_FRAMEBUFFER_OPERATION: case GL_INVALID_FRAMEBUFFER_OPERATION:
qCDebug(gpugllogging) << "GLBackend" << name << ": The framebuffer object is not complete.The offending command is ignored and has no other side effect than to set the error flag."; qCWarning(gpugllogging) << "GLBackend" << name << ": The framebuffer object is not complete.The offending command is ignored and has no other side effect than to set the error flag.";
break; break;
case GL_OUT_OF_MEMORY: case GL_OUT_OF_MEMORY:
qCDebug(gpugllogging) << "GLBackend" << name << ": There is not enough memory left to execute the command.The state of the GL is undefined, except for the state of the error flags, after this error is recorded."; qCWarning(gpugllogging) << "GLBackend" << name << ": There is not enough memory left to execute the command.The state of the GL is undefined, except for the state of the error flags, after this error is recorded.";
break; break;
case GL_STACK_UNDERFLOW: case GL_STACK_UNDERFLOW:
qCDebug(gpugllogging) << "GLBackend" << name << ": An attempt has been made to perform an operation that would cause an internal stack to underflow."; qCWarning(gpugllogging) << "GLBackend" << name << ": An attempt has been made to perform an operation that would cause an internal stack to underflow.";
break; break;
case GL_STACK_OVERFLOW: case GL_STACK_OVERFLOW:
qCDebug(gpugllogging) << "GLBackend" << name << ": An attempt has been made to perform an operation that would cause an internal stack to overflow."; qCWarning(gpugllogging) << "GLBackend" << name << ": An attempt has been made to perform an operation that would cause an internal stack to overflow.";
break; break;
} }
return true; return true;
@ -751,7 +751,7 @@ void makeProgramBindings(ShaderObject& shaderObject) {
GLint linked = 0; GLint linked = 0;
glGetProgramiv(glprogram, GL_LINK_STATUS, &linked); glGetProgramiv(glprogram, GL_LINK_STATUS, &linked);
if (!linked) { if (!linked) {
qCDebug(gpugllogging) << "GLShader::makeBindings - failed to link after assigning slotBindings?"; qCWarning(gpugllogging) << "GLShader::makeBindings - failed to link after assigning slotBindings?";
} }
// now assign the ubo binding, then DON't relink! // now assign the ubo binding, then DON't relink!

View file

@ -120,7 +120,7 @@ GLenum GLTexelFormat::evalGLTexelFormatInternal(const gpu::Element& dstFormat) {
break; break;
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
} }
@ -132,7 +132,7 @@ GLenum GLTexelFormat::evalGLTexelFormatInternal(const gpu::Element& dstFormat) {
result = GL_RG8; result = GL_RG8;
break; break;
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
@ -155,7 +155,7 @@ GLenum GLTexelFormat::evalGLTexelFormatInternal(const gpu::Element& dstFormat) {
result = GL_COMPRESSED_SRGB; result = GL_COMPRESSED_SRGB;
break; break;
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
@ -241,13 +241,13 @@ GLenum GLTexelFormat::evalGLTexelFormatInternal(const gpu::Element& dstFormat) {
*/ */
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
} }
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
return result; return result;
} }
@ -280,7 +280,7 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
texel.internalFormat = GL_DEPTH24_STENCIL8; texel.internalFormat = GL_DEPTH24_STENCIL8;
break; break;
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
} }
@ -295,7 +295,7 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
texel.internalFormat = GL_RG8; texel.internalFormat = GL_RG8;
break; break;
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
@ -318,7 +318,7 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
texel.internalFormat = GL_COMPRESSED_SRGB; texel.internalFormat = GL_COMPRESSED_SRGB;
break; break;
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
@ -381,13 +381,13 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
*/ */
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
} }
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
return texel; return texel;
} else { } else {
@ -523,7 +523,7 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
texel.internalFormat = GL_DEPTH24_STENCIL8; texel.internalFormat = GL_DEPTH24_STENCIL8;
break; break;
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
@ -539,7 +539,7 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
texel.internalFormat = GL_RG8; texel.internalFormat = GL_RG8;
break; break;
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
@ -566,7 +566,7 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
texel.internalFormat = GL_COMPRESSED_SRGB; texel.internalFormat = GL_COMPRESSED_SRGB;
break; break;
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
} }
@ -648,13 +648,13 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
texel.internalFormat = GL_COMPRESSED_SRGB_ALPHA; texel.internalFormat = GL_COMPRESSED_SRGB_ALPHA;
break; break;
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
break; break;
} }
default: default:
qCDebug(gpugllogging) << "Unknown combination of texel format"; qCWarning(gpugllogging) << "Unknown combination of texel format";
} }
return texel; return texel;
} }

View file

@ -61,7 +61,6 @@ static std::vector<uvec3> getPageDimensionsForFormat(const TextureTypeFormat& ty
for (GLint i = 0; i < count; ++i) { for (GLint i = 0; i < count; ++i) {
result[i] = uvec3(x[i], y[i], z[i]); result[i] = uvec3(x[i], y[i], z[i]);
} }
qCDebug(gpugl45logging) << "Got " << count << " page sizes";
} }
{ {
@ -91,7 +90,6 @@ SparseInfo::SparseInfo(GL45Texture& texture)
void SparseInfo::maybeMakeSparse() { void SparseInfo::maybeMakeSparse() {
// Don't enable sparse for objects with explicitly managed mip levels // Don't enable sparse for objects with explicitly managed mip levels
if (!texture._gpuObject.isAutogenerateMips()) { if (!texture._gpuObject.isAutogenerateMips()) {
qCDebug(gpugl45logging) << "Don't enable sparse texture for explicitly generated mipmaps on texture " << texture._source.c_str();
return; return;
} }
@ -285,11 +283,6 @@ GL45Texture::GL45Texture(const std::weak_ptr<GLBackend>& backend, const Texture&
} }
GL45Texture::~GL45Texture() { GL45Texture::~GL45Texture() {
// // External textures cycle very quickly, so don't spam the log with messages about them.
// if (!_gpuObject.getUsage().isExternal()) {
// qCDebug(gpugl45logging) << "Destroying texture " << _id << " from source " << _source.c_str();
// }
// Remove this texture from the candidate list of derezzable textures // Remove this texture from the candidate list of derezzable textures
if (_transferrable) { if (_transferrable) {
auto mipLevels = usedMipLevels(); auto mipLevels = usedMipLevels();
@ -350,9 +343,6 @@ void GL45Texture::withPreservedTexture(std::function<void()> f) const {
} }
void GL45Texture::generateMips() const { void GL45Texture::generateMips() const {
if (_transferrable) {
qCDebug(gpugl45logging) << "Generating mipmaps for " << _source.c_str();
}
glGenerateTextureMipmap(_id); glGenerateTextureMipmap(_id);
(void)CHECK_GL_ERROR(); (void)CHECK_GL_ERROR();
} }
@ -628,19 +618,16 @@ void GL45Backend::derezTextures() const {
Lock lock(texturesByMipCountsMutex); Lock lock(texturesByMipCountsMutex);
if (texturesByMipCounts.empty()) { if (texturesByMipCounts.empty()) {
qCDebug(gpugl45logging) << "No available textures to derez"; // No available textures to derez
return; return;
} }
auto mipLevel = texturesByMipCounts.rbegin()->first; auto mipLevel = texturesByMipCounts.rbegin()->first;
if (mipLevel <= 1) { if (mipLevel <= 1) {
qCDebug(gpugl45logging) << "Max mip levels " << mipLevel; // No mips available to remove
return; return;
} }
qCDebug(gpugl45logging) << "Allowed texture memory " << Texture::getAllowedGPUMemoryUsage();
qCDebug(gpugl45logging) << "Used texture memory " << (Context::getTextureGPUMemoryUsage() - Context::getTextureGPUFramebufferMemoryUsage());
GL45Texture* targetTexture = nullptr; GL45Texture* targetTexture = nullptr;
{ {
auto& textures = texturesByMipCounts[mipLevel]; auto& textures = texturesByMipCounts[mipLevel];
@ -649,5 +636,4 @@ void GL45Backend::derezTextures() const {
} }
lock.unlock(); lock.unlock();
targetTexture->derez(); targetTexture->derez();
qCDebug(gpugl45logging) << "New Used texture memory " << (Context::getTextureGPUMemoryUsage() - Context::getTextureGPUFramebufferMemoryUsage());
} }