Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 721954 - media-libs/libsdl2-2.0.12-r1 with Vulkan useflag fails due to undefined VK_RESULT_RANGE_SIZE (PATCH)
Summary: media-libs/libsdl2-2.0.12-r1 with Vulkan useflag fails due to undefined VK_RE...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords: PATCH
: 732120 732386 733882 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-09 22:33 UTC by silwerspawn
Modified: 2020-08-06 22:35 UTC (History)
18 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patchfile used for media-libs/libsdl2-2.0.12-r1 (2020-07-01_bug721954_VK_RESULT_RANGE_SIZE.patch,396 bytes, patch)
2020-07-01 16:47 UTC, Martin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description silwerspawn 2020-05-09 22:33:20 UTC
libsdl2-2.0.12-r1 with Vulkan useflag fails due to undefined VK_RESULT_RANGE_SIZE, going through the code it i was unable to find any definition of the static VK_RESULT_RANGE_SIZE but this var seems to be used in the source code 
src/video/SDL_vulkan_utils.c

The definition is used only to break out the switch statement and fall to an error from what i can see (correct me if im wrong)

Since this definition is not there maybe it would be an idea to remove it from the switch? this will just result in an error_<unknown> if its every used or defined again.

I used this simple patch

```
--- a/src/video/SDL_vulkan_utils.c
+++ b/src/video/SDL_vulkan_utils.c
@@ -85,7 +85,6 @@
     case VK_ERROR_INVALID_SHADER_NV:
         return "VK_ERROR_INVALID_SHADER_NV";
     case VK_RESULT_MAX_ENUM:
-    case VK_RESULT_RANGE_SIZE:
         break;
     }
     if(result < 0)
```

to solve the build issues.

the ebuild use are as follows:
media-libs/libsdl2-2.0.12-r1::gentoo  USE="X alsa dbus gles2 haptic jack joystick nas opengl oss pulseaudio sound threads udev video vulkan wayland xinerama (-aqua) (-custom-cflags) -kms -libsamplerate -static-libs -tslib -xscreensaver" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="mmx sse sse2 -3dnow" VIDEO_CARDS="(-vc4)"

Note this is caused by the combination of Vulkan and ABI 32
Comment 1 Gabriel David 2020-06-15 11:31:09 UTC
I have this issue too. The patch also worked for me.

However, I believe this issue lies more with upstream than with Gentoo, so someone should report it to them.
Comment 2 cyrillic 2020-06-15 22:40:24 UTC
This error only happens with the latest vulkan-headers, so it is probably better to make the fix conditional.

--- a/src/video/SDL_vulkan_utils.c      2020-03-10 21:36:18.000000000 -0400
+++ b/src/video/SDL_vulkan_utils.c      2020-06-14 21:49:15.780898839 -0400
@@ -85,7 +85,9 @@
     case VK_ERROR_INVALID_SHADER_NV:
         return "VK_ERROR_INVALID_SHADER_NV";
     case VK_RESULT_MAX_ENUM:
+#if VK_HEADER_VERSION < 140
     case VK_RESULT_RANGE_SIZE:
+#endif
         break;
     }
     if(result < 0)
Comment 3 Michael Crawford (ali3nx) 2020-06-21 22:32:33 UTC
Confirming the patch submitted by cyrillic successfully compiled.

using media-libs/libsdl2-2.0.10-r1 and  dev-util/vulkan-headers-1.2.143
Comment 4 silwerspawn 2020-06-22 00:11:19 UTC
(In reply to cyrillic from comment #2)
> This error only happens with the latest vulkan-headers, so it is probably
> better to make the fix conditional.
> 
> --- a/src/video/SDL_vulkan_utils.c      2020-03-10 21:36:18.000000000 -0400
> +++ b/src/video/SDL_vulkan_utils.c      2020-06-14 21:49:15.780898839 -0400
> @@ -85,7 +85,9 @@
>      case VK_ERROR_INVALID_SHADER_NV:
>          return "VK_ERROR_INVALID_SHADER_NV";
>      case VK_RESULT_MAX_ENUM:
> +#if VK_HEADER_VERSION < 140
>      case VK_RESULT_RANGE_SIZE:
> +#endif
>          break;
>      }
>      if(result < 0)

Confirmed that this is working, do we know that its specific to `140` an not other header versions? (at the moment I don't have the time to check)
Comment 5 Davide Palma 2020-06-22 17:12:55 UTC
Issue and proposed solution confirmed by me.
Comment 6 Tetja Rediske 2020-06-28 16:35:47 UTC
Same Problem, the patch made me able to build it.
Comment 7 Martin 2020-07-01 16:02:34 UTC
(In reply to silwerspawn from comment #0)
> libsdl2-2.0.12-r1 with Vulkan useflag fails due to undefined
> VK_RESULT_RANGE_SIZE, ...

> the ebuild use are as follows:
> media-libs/libsdl2-2.0.12-r1::gentoo  USE="X alsa dbus gles2 haptic jack
> joystick nas opengl oss pulseaudio sound threads udev video vulkan wayland
> xinerama (-aqua) (-custom-cflags) -kms -libsamplerate -static-libs -tslib
> -xscreensaver" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="mmx sse sse2 -3dnow"
> VIDEO_CARDS="(-vc4)"
> 
> Note this is caused by the combination of Vulkan and ABI 32

Re: The "ABI 32"

I've just hit the same fail even with ABI_X86= -32 ...

The full set of flags tried are:

media-libs/libsdl2-2.0.12-r1::gentoo [2.0.10-r1::gentoo] USE="X alsa dbus joystick opengl pulseaudio sound threads udev video vulkan xscreensaver (-aqua) (-custom-cflags) -gles2 -haptic -jack% -kms -libsamplerate -nas -oss -static-libs -tslib -wayland -xinerama (-altivec%)" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="3dnow mmx sse sse2" VIDEO_CARDS="(-vc4)"
Comment 8 Martin 2020-07-01 16:47:56 UTC
Created attachment 647320 [details, diff]
Patchfile used for media-libs/libsdl2-2.0.12-r1

Confirmed fixes the compile/emerge.

Thanks,
Martin
Comment 9 Andreas Sturmlechner gentoo-dev 2020-07-10 17:57:53 UTC
*** Bug 732120 has been marked as a duplicate of this bug. ***
Comment 10 Larry the Git Cow gentoo-dev 2020-07-11 13:39:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7cf54bdeb9936fbbe013e776c397933e7d04543b

commit 7cf54bdeb9936fbbe013e776c397933e7d04543b
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2020-07-11 13:38:33 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2020-07-11 13:39:26 +0000

    media-libs/libsdl2: Fix building against the latest Vulkan headers
    
    Closes: https://bugs.gentoo.org/721954
    Package-Manager: Portage-2.3.103, Repoman-2.3.22
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>

 .../libsdl2/files/libsdl2-2.0.12-static-libs.patch      |  4 ++++
 .../libsdl2/files/libsdl2-2.0.12-vulkan-headers.patch   | 17 +++++++++++++++++
 media-libs/libsdl2/libsdl2-2.0.12-r1.ebuild             |  2 +-
 3 files changed, 22 insertions(+), 1 deletion(-)
Comment 11 tt_1 2020-07-11 13:51:52 UTC
there is some background information available: 

https://github.com/KhronosGroup/Vulkan-Docs/issues/1230
Comment 12 Andreas Sturmlechner gentoo-dev 2020-07-13 06:39:01 UTC
*** Bug 732386 has been marked as a duplicate of this bug. ***
Comment 13 dax 2020-08-06 22:32:41 UTC
This bug also exists for 2.0.10-r1. Applying the patch works.
Comment 14 Andreas Sturmlechner gentoo-dev 2020-08-06 22:34:22 UTC
*** Bug 733882 has been marked as a duplicate of this bug. ***