platforms/drm: Properly clean up the shadow framebuffer object

In case hardware transforms can be used again, the shadow framebuffer
must be destroyed; otherwise rendered results will be distorted due to a
mismatch between the dimensions of the shadow framebuffer and the mode
size.
This commit is contained in:
Vlad Zahorodnii 2020-12-02 17:24:39 +02:00
parent 9236254d5c
commit 389407805c

View file

@ -345,6 +345,8 @@ const float texCoords[] = {
bool EglGbmBackend::resetFramebuffer(Output &output)
{
cleanupFramebuffer(output);
if (output.output->hardwareTransforms() && !output.onSecondaryGPU) {
// No need for an extra render target.
return true;
@ -352,8 +354,6 @@ bool EglGbmBackend::resetFramebuffer(Output &output)
makeContextCurrent(output);
cleanupFramebuffer(output);
glGenFramebuffers(1, &output.render.framebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, output.render.framebuffer);
GLRenderTarget::setKWinFramebuffer(output.render.framebuffer);