Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #8871: [OpenGL] Initialize all buffers after resize and clear back buffer. #8877

Merged
merged 1 commit into from Mar 20, 2021

Conversation

michicc
Copy link
Member

@michicc michicc commented Mar 19, 2021

Motivation / Problem

On some driver/OS/GPU combinations, the back buffer (and maybe textures) get created with random contents, leading to an ugly display until the first proper full draw.

Description

Explicitly clear all texture buffers/back buffer and do a swap right after resize.

Limitations

I don't really see the reported behaviour on a Windows/nVidia system, so this fix is mostly speculation and needs (just like all 3D driver related things) testing on as many different systems as possible.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

src/video/opengl.cpp Show resolved Hide resolved
@LordAro
Copy link
Member

@LordAro LordAro commented Mar 20, 2021

Fixes the issue for me (debug/MinGW/win32)

@LordAro LordAro added the backport requested label Mar 20, 2021
@JGRennison
Copy link
Contributor

@JGRennison JGRennison commented Mar 20, 2021

This seems to fix the issue for me, running on the configuration in #8871 (Linux, SDL2, AMD Radeon R9 270).

@michicc michicc merged commit f0f96e3 into OpenTTD:master Mar 20, 2021
12 checks passed
@michicc michicc deleted the pr/ogl_amd_buffer branch Mar 20, 2021
@michicc
Copy link
Member Author

@michicc michicc commented Mar 21, 2021

When backporting this, #8881 and #8883 must be backported as well.

2TallTyler pushed a commit to 2TallTyler/OpenTTD that referenced this issue Mar 29, 2021
TrueBrain pushed a commit to TrueBrain/OpenTTD that referenced this issue Mar 30, 2021
@TrueBrain TrueBrain added backported and removed backport requested labels Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported component: OpenGL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants