- Add gzdoom-sdlbug.patch.

OBS-URL: https://build.opensuse.org/package/show/games/gzdoom?expand=0&rev=48
This commit is contained in:
Jan Engelhardt 2020-06-12 00:26:48 +00:00 committed by Git OBS Bridge
parent 7faf227ae9
commit 2968b01b0e
3 changed files with 44 additions and 3 deletions

35
gzdoom-sdlbug.patch Normal file
View File

@ -0,0 +1,35 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2020-06-12 02:05:34.009865606 +0200
When a SDL_PollEvent is sandwiched between SDL_CreateWindow and
SDL_CreateRenderer, SDL crashes during SDL_IME_PumpEvents because dbus message
still references the old window (still exists and pointer is non-NULL) and
tries to access members of window->driverdata (block was freed and pointer is
NULL.)
Workaround this by recreating the SDL_Window object and immediately afterwards
creating the renderer.
This crash only happens for gzdoom when running with the SoftPoly rasterizer,
as that is the only place that issues SDL_CreateRenderer after the mainloop has
started.
Needs a bugreport on libsdl.org.
---
src/common/platform/posix/sdl/sdlglvideo.cpp | 2 ++
1 file changed, 2 insertions(+)
Index: gzdoom-g4.4.1/src/common/platform/posix/sdl/sdlglvideo.cpp
===================================================================
--- gzdoom-g4.4.1.orig/src/common/platform/posix/sdl/sdlglvideo.cpp
+++ gzdoom-g4.4.1/src/common/platform/posix/sdl/sdlglvideo.cpp
@@ -294,6 +294,8 @@ uint8_t *I_PolyPresentLock(int w, int h,
{
polyvsync = vsync;
+ Priv::DestroyWindow();
+ Priv::CreateWindow(Priv::VulkanWindowFlag | (Priv::softpolyEnabled ? SDL_WINDOW_HIDDEN : 0));
polyrendertarget = SDL_CreateRenderer(Priv::window, -1, vsync ? SDL_RENDERER_PRESENTVSYNC : 0);
if (!polyrendertarget)
{

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jun 12 00:26:10 UTC 2020 - Jan Engelhardt <jengelh@inai.de>
- Add gzdoom-sdlbug.patch.
-------------------------------------------------------------------
Thu Jun 11 15:19:30 UTC 2020 - Jan Engelhardt <jengelh@inai.de>

View File

@ -30,7 +30,8 @@ Patch1: gzdoom-waddir.patch
Patch2: gzdoom-lzma.patch
Patch3: gzdoom-asmjit.patch
Patch4: gzdoom-spirv.patch
Patch5: gzdoom-vulkan.patch
Patch5: gzdoom-sdlbug.patch
Patch6: gzdoom-vulkan.patch
BuildRequires: cmake >= 2.8.7
BuildRequires: gcc-c++
BuildRequires: libjpeg-devel
@ -77,9 +78,9 @@ GZDoom is a port (a modification) of the original Doom source code, featuring:
%prep
%setup -qn %name-g%version
%patch -P 1 -P 2 -P 3 -P 4 -p1
%patch -P 1 -P 2 -P 3 -P 4 -P 5 -p1
%if 0%{?sle_version} >= 150200
%patch -P 5 -p1
%patch -P 6 -p1
rm -Rf glslang src/common/rendering/vulkan/thirdparty/vulkan
%endif
perl -i -pe 's{__DATE__}{""}g' src/posix/sdl/i_main.cpp