SDL2: Graphic issues with bilinear filtering enabled (Win, direct3d)
|Reported by:||rootfather||Owned by:||rootfather|
Note: This bug seems to be related with #9592.
OS: Windows 10
ScummVM: currently at f7381c2, but happens with all versions that include SDL2+filtering
GPU: AMD Radeon HD 6320 [integrated solution]
I noticed that when I enable the linear filtering feature in fullscreen mode, on my Windows system, it seems that the image is about 1px too small on each side and the image starts to 'wrap around'. See the attached screenshot from 'Myst', it should be much clearer than my explanation.
Basically, it seems that the linear filter uses image data from the last pixel column on the right side to draw/fill/interpolate the image data of the first pixel column on the left side (and the same going on with the top and the bottom). This does *not* happen when you turn off the linear filtering.
criezy couldn't reproduce the issue on his system. After some poking around in the source code from my side, criezy suggested to insert the lines
right before the call of SDL_CreateRenderer in line 2622 of surfacesdl-graphics.cpp.
First, I tried direct3d11. It really works like a charm, it fixes this bug and even resolves #9592. The downside of this is that direct3d11 support in SDL is pretty new (from 2015), and we don't know how it behaves on older SDL2 versions or unsupported Windows versions (although I think DirectX 11 is supported in Windows XP SP3 and higher). Will it just ignore the setting and do a fallback to the first supported driver? Will it segfault? Will it kill your hamster? We have to investigate this.
Next, I tried opengl. Using OpenGL solved this issue, but #9592 is persisting, although the rendering artefacts in the launcher changed the location. While both direct3d11 and opengl have a good ingame-performance, it is interesting to see that opengl has a better performance when switching between scalers (like 2x->3x and vice versa).
Because using direct3d11 solves both issues for me, I would opt for using this if there are no unwanted side-effects with older versions of SDL2 or Windows or even with other operating systems. In case we can't use direct3d11 due to non-existing fallback mechanisms, opengl seems to be a good solution too (but then, we have to care about #9592 again).
Change History (18)
comment:4 by , 7 years ago
|Summary:||SDL2: Graphic issues with bilinear filtering enabled → SDL2: Graphic issues with bilinear filtering enabled (Win, direct3d)|