Giter Site home page Giter Site logo

SDL build with configure (autoconf) incorrectly tries to build with Vulkan support on Solaris 10 (probably other UNIXes) about sdl HOT 9 OPEN

joncox123 avatar joncox123 commented on July 17, 2024
SDL build with configure (autoconf) incorrectly tries to build with Vulkan support on Solaris 10 (probably other UNIXes)

from sdl.

Comments (9)

icculus avatar icculus commented on July 17, 2024 1

(But again, there isn't even a hypothetical world where Solaris 10--last official update was in 2013--is getting a Vulkan implementation, so it doesn't really matter if it compiles there. :) )

from sdl.

slouken avatar slouken commented on July 17, 2024

For SDL2, the configure workaround is probably fine, but we should make sure CMake is doing the right thing in SDL3.

from sdl.

icculus avatar icculus commented on July 17, 2024

The correct fix, fwiw, is to disable Vulkan if libxcb isn't available, but no one should spend time writing autoconf tests at this point, so I'm just disabling Vulkan for Solaris in SDL2.

(I also don't understand why our Xlib-based code requires libxcb for Vulkan, when Vulkan offers an Xlib equivalent. Didn't we fix this in SDL3?)

from sdl.

icculus avatar icculus commented on July 17, 2024

I also don't understand why our Xlib-based code requires libxcb for Vulkan

Turns out (in SDL3 at least, if not SDL2) we favor Xlib, but if the Vulkan implementation doesn't have Xlib support but only xcb, we attempt to get the proper lowlevel handles from Xlib to use xcb instead.

We could check for xcb headers in CMake, sprinkle around some ifdefs, and fail in X11_Vulkan_LoadLibrary if we're forced into needing xcb, but I'm not confident this is worth it instead of just turning off Vulkan for Solaris.

Unless we want to do something more for SDL3, this can be closed now.

from sdl.

madebr avatar madebr commented on July 17, 2024

The xcb.h include is commented out in both SDL2 and SDL3.

If libxcb is not available on Solaris, then won't the xcb workaround in SDL_x11vulkan.c simply fail always?
Do we really need to conditionally #ifdef-out the workaround?
Also, because no xcb.h header is included, I think current SDL will build successfully (with and without vulkan enabled) on Solaris.

from sdl.

icculus avatar icculus commented on July 17, 2024

The xcb.h include is commented out in both SDL2 and SDL3.

That one is commented out, but vulkan.h includes it, if VK_USE_PLATFORM_XCB_KHR is defined, which SDL_vulkan_internal.h does.

from sdl.

madebr avatar madebr commented on July 17, 2024

I have the patch below queued for solaris. I've got some questions unanswered in other issues (CMAKE_C_COMPILER_ID of the compiler + what predefined macros the toolchain defines)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -232,6 +232,8 @@ if(SDL_SHARED_DEFAULT AND SDL_STATIC_DEFAULT AND SDL_SHARED_AVAILABLE)
   endif()
 endif()
 
+set(SDL_VULKAN_DEFAULT ON)
+
 set(SDL_X11_OPTIONS Xcursor Xdbe XInput Xfixes Xrandr Xscrnsaver XShape)
 foreach(_SUB ${SDL_X11_OPTIONS})
   string(TOUPPER "SDL_X11_${_SUB}_DEFAULT" _OPT)
@@ -239,6 +241,7 @@ foreach(_SUB ${SDL_X11_OPTIONS})
 endforeach()
 
 if(SOLARIS)
+  set(SDL_VULKAN_DEFAULT OFF)
   set(SDL_X11_XRANDR_DEFAULT OFF)
 endif()
 
@@ -351,7 +354,7 @@ dep_option(SDL_WASAPI              "Use the Windows WASAPI audio driver" ON "WIN
 dep_option(SDL_RENDER_D3D          "Enable the Direct3D render driver" ON "SDL_RENDER" OFF)
 dep_option(SDL_RENDER_METAL        "Enable the Metal render driver" ON "SDL_RENDER;${APPLE}" OFF)
 dep_option(SDL_VIVANTE             "Use Vivante EGL video driver" ON "${UNIX_SYS};SDL_CPU_ARM32" OFF)
-dep_option(SDL_VULKAN              "Enable Vulkan support" ON "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR WINDOWS" OFF)
+dep_option(SDL_VULKAN              "Enable Vulkan support" "${SDL_VULKAN_DEFAULT}" "SDL_VIDEO;ANDROID OR APPLE OR LINUX OR WINDOWS" OFF)
 dep_option(SDL_RENDER_VULKAN       "Enable the Vulkan render driver" ON "SDL_RENDER;SDL_VULKAN;ANDROID OR APPLE OR LINUX OR WINDOWS" OFF)
 dep_option(SDL_METAL               "Enable Metal support" ON "APPLE" OFF)
 dep_option(SDL_KMSDRM              "Use KMS DRM video driver" ${UNIX_SYS} "SDL_VIDEO" OFF)

from sdl.

icculus avatar icculus commented on July 17, 2024

I couldn't coerce CMake itself to build from source, and the prebuilt package of it I dug up fails to load at all...but this isn't my area of expertise, there's probably a super-easy way to install this on Solaris that I missed.

(EDIT: I got it working, see the other bug report.)

from sdl.

icculus avatar icculus commented on July 17, 2024

Yeah, @madebr, go ahead and push the above patch and close this one.

from sdl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.