Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 515818 Details for
Bug 644732
media-libs/libsdl2: vulkan support
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
SDL_x11vulkan.c hack patch
file_644732.txt (text/plain), 4.94 KB, created by
Niklas Haas
on 2018-01-22 10:36:25 UTC
(
hide
)
Description:
SDL_x11vulkan.c hack patch
Filename:
MIME Type:
Creator:
Niklas Haas
Created:
2018-01-22 10:36:25 UTC
Size:
4.94 KB
patch
obsolete
>diff -r c3446901fc1c configure.in >--- a/configure.in Wed Jan 17 17:24:15 2018 -0800 >+++ b/configure.in Mon Jan 22 11:36:01 2018 +0100 >@@ -2546,6 +2546,12 @@ > if test x$enable_video_vulkan = xyes; then > AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ]) > SUMMARY_video="${SUMMARY_video} vulkan" >+ >+ VULKAN_CFLAGS=`$PKG_CONFIG --cflags vulkan` >+ VULKAN_LIBS=`$PKG_CONFIG --libs vulkan` >+ >+ EXTRA_CFLAGS="$EXTRA_CFLAGS $VULKAN_CFLAGS" >+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $VULKAN_LIBS" > fi > } > >diff -r c3446901fc1c src/video/SDL_vulkan_internal.h >--- a/src/video/SDL_vulkan_internal.h Wed Jan 17 17:24:15 2018 -0800 >+++ b/src/video/SDL_vulkan_internal.h Mon Jan 22 11:36:01 2018 +0100 >@@ -25,11 +25,6 @@ > > #include "SDL_stdinc.h" > >-#if defined(SDL_LOADSO_DISABLED) >-#undef SDL_VIDEO_VULKAN >-#define SDL_VIDEO_VULKAN 0 >-#endif >- > #if SDL_VIDEO_VULKAN > > #if SDL_VIDEO_DRIVER_ANDROID >@@ -57,8 +52,7 @@ > #define VK_USE_PLATFORM_XCB_KHR > #endif > >-#define VK_NO_PROTOTYPES >-#include "./khronos/vulkan/vulkan.h" >+#include <vulkan/vulkan.h> > > #include "SDL_vulkan.h" > >diff -r c3446901fc1c src/video/x11/SDL_x11vulkan.c >--- a/src/video/x11/SDL_x11vulkan.c Wed Jan 17 17:24:15 2018 -0800 >+++ b/src/video/x11/SDL_x11vulkan.c Mon Jan 22 11:36:01 2018 +0100 >@@ -25,7 +25,6 @@ > #include "SDL_x11video.h" > #include "SDL_assert.h" > >-#include "SDL_loadso.h" > #include "SDL_x11vulkan.h" > > #include <X11/Xlib.h> >@@ -43,22 +42,11 @@ > SDL_bool hasSurfaceExtension = SDL_FALSE; > SDL_bool hasXlibSurfaceExtension = SDL_FALSE; > SDL_bool hasXCBSurfaceExtension = SDL_FALSE; >- PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL; > Uint32 i; >- if(_this->vulkan_config.loader_handle) >+ if(_this->vulkan_config.vkGetInstanceProcAddr) > return SDL_SetError("Vulkan already loaded"); > > /* Load the Vulkan loader library */ >- if(!path) >- path = SDL_getenv("SDL_VULKAN_LIBRARY"); >- if(!path) >- path = "libvulkan.so.1"; >- _this->vulkan_config.loader_handle = SDL_LoadObject(path); >- if(!_this->vulkan_config.loader_handle) >- return -1; >- SDL_strlcpy(_this->vulkan_config.loader_path, path, SDL_arraysize(_this->vulkan_config.loader_path)); >- vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction( >- _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr"); > if(!vkGetInstanceProcAddr) > goto fail; > _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr; >@@ -93,47 +81,23 @@ > { > videoData->vulkan_xlib_xcb_library = NULL; > } >- else if(!hasXCBSurfaceExtension) >+ else > { > SDL_SetError("Installed Vulkan doesn't implement either the " > VK_KHR_XCB_SURFACE_EXTENSION_NAME "extension or the " > VK_KHR_XLIB_SURFACE_EXTENSION_NAME " extension"); > goto fail; > } >- else >- { >- const char *libX11XCBLibraryName = SDL_getenv("SDL_X11_XCB_LIBRARY"); >- if(!libX11XCBLibraryName) >- libX11XCBLibraryName = "libX11-xcb.so"; >- videoData->vulkan_xlib_xcb_library = SDL_LoadObject(libX11XCBLibraryName); >- if(!videoData->vulkan_xlib_xcb_library) >- goto fail; >- videoData->vulkan_XGetXCBConnection = >- SDL_LoadFunction(videoData->vulkan_xlib_xcb_library, "XGetXCBConnection"); >- if(!videoData->vulkan_XGetXCBConnection) >- { >- SDL_UnloadObject(videoData->vulkan_xlib_xcb_library); >- goto fail; >- } >- } > return 0; > > fail: >- SDL_UnloadObject(_this->vulkan_config.loader_handle); >- _this->vulkan_config.loader_handle = NULL; >+ _this->vulkan_config.vkGetInstanceProcAddr = NULL; > return -1; > } > > void X11_Vulkan_UnloadLibrary(_THIS) > { > SDL_VideoData *videoData = (SDL_VideoData *)_this->driverdata; >- if(_this->vulkan_config.loader_handle) >- { >- if(videoData->vulkan_xlib_xcb_library) >- SDL_UnloadObject(videoData->vulkan_xlib_xcb_library); >- SDL_UnloadObject(_this->vulkan_config.loader_handle); >- _this->vulkan_config.loader_handle = NULL; >- } > } > > SDL_bool X11_Vulkan_GetInstanceExtensions(_THIS, >@@ -142,7 +106,7 @@ > const char **names) > { > SDL_VideoData *videoData = (SDL_VideoData *)_this->driverdata; >- if(!_this->vulkan_config.loader_handle) >+ if(!_this->vulkan_config.vkGetInstanceProcAddr) > { > SDL_SetError("Vulkan is not loaded"); > return SDL_FALSE; >@@ -173,7 +137,7 @@ > SDL_VideoData *videoData = (SDL_VideoData *)_this->driverdata; > SDL_WindowData *windowData = (SDL_WindowData *)window->driverdata; > PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; >- if(!_this->vulkan_config.loader_handle) >+ if(!_this->vulkan_config.vkGetInstanceProcAddr) > { > SDL_SetError("Vulkan is not loaded"); > return SDL_FALSE;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 644732
: 515818