plugins/backgroundcontrast: use the same texture format as the main framebuffer

With color management, the main framebuffer has values over 1. As the effect used GL_RGBA8 for its
fbos, all values in them got clamped to 1, making the result look much darker than it should be. To
fix that, this commit changes it to use the same format as the main framebuffer, ensuring that the
range of values that can be stored is the same
This commit is contained in:
Xaver Hugl 2023-07-26 12:07:45 +02:00
parent 47c415c119
commit fcf24d98bf

View file

@ -441,8 +441,8 @@ void ContrastEffect::doContrast(const RenderTarget &renderTarget, const RenderVi
Q_ASSERT(m_windowData.contains(w));
auto &windowData = m_windowData[w];
if (!windowData.texture || windowData.texture->size() != r.size()) {
windowData.texture = GLTexture::allocate(GL_RGBA8, r.size().toSize());
if (!windowData.texture || (renderTarget.texture() && windowData.texture->internalFormat() != renderTarget.texture()->internalFormat()) || windowData.texture->size() != r.size()) {
windowData.texture = GLTexture::allocate(renderTarget.texture() ? renderTarget.texture()->internalFormat() : GL_RGBA8, r.size().toSize());
if (!windowData.texture) {
return;
}