vulkan: Initial Vulkan support!

This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.
This commit is contained in:
Ryan C. Gordon committed 2017-08-27 22:15:57 -04:00
1 parent 8e7998e19d
commit 25e3a1ec90
60 files changed
+5456 -80

No files matched your search

+66
View File
@@ -2401,6 +2401,62 @@ CheckEmscriptenGLES()
fi
}
dnl Check to see if Vulkan surface support is desired
AC_ARG_ENABLE(video-vulkan,
AC_HELP_STRING([--enable-video-vulkan], [include Vulkan surface support [[default=yes]]]),
, enable_video_vulkan=yes)
dnl Find Vulkan Header
CheckVulkan()
{
have_vulkan_hdr=no
if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
case "$host" in
*-*-androideabi*)
AC_TRY_COMPILE([
#if defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
#error Vulkan doesn't work on this configuration
#endif
int main()
{
return 0;
}
],[
enable_video_vulkan=no
],[
])
;;
*)
;;
esac
if test x$enable_video_vulkan = xno; then
# For reasons I am totally unable to see, I get an undefined macro error if
# I put this in the AC_TRY_COMPILE.
AC_MSG_WARN([Sorry, Vulkan does not work on this configuration.])
fi
if test x$enable_video_vulkan = xyes; then
vsdk_include_dir="${VULKAN_SDK}/include"
vulkan_header="vulkan/vulkan.h"
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="${save_CPPFLAGS} -I$vsdk_include_dir"
AC_CHECK_HEADER($vulkan_header,
have_vulkan_hdr=yes,
have_vulkan_hdr=no)
CPPFLAGS="$save_CPPFLAGS"
fi
fi
if test x$have_vulkan_hdr = xyes; then
# vulkan.h has been found in either $VULKAN_SDK/include or along the
# the standard include path. Unfortunately there seems no easy
# way to find out which, so...
if test -n "$VULKAN_SDK" -a -f "$vsdk_include_dir/$vulkan_header"; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -I$vsdk_include_dir"
fi
AC_DEFINE(SDL_VIDEO_VULKAN_SURFACE, 1, [ ])
SUMMARY_video="${SUMMARY_video} vulkan"
fi
}
dnl See if we can use the new unified event interface in Linux 2.4
CheckInputEvents()
{
@@ -3230,6 +3286,7 @@ case "$host" in
CheckKMSDRM
CheckOpenGLX11
CheckOpenGLESX11
CheckVulkan
CheckMir
CheckWayland
CheckLibUDev
@@ -3375,6 +3432,7 @@ case "$host" in
CheckWINDOWS
CheckWINDOWSGL
CheckWINDOWSGLES
CheckVulkan
CheckDIRECTX
# Set up the core platform files
@@ -3559,6 +3617,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
CheckDummyAudio
CheckDLOPEN
CheckPTHREAD
CheckVulkan
# Set up files for the audio library
if test x$enable_audio = xyes; then
@@ -3621,6 +3680,9 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
if test x$ac_cv_header_vulkan_vulkan_h = xyes; then
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
fi
;;
*-*-darwin* )
# This could be either full "Mac OS X", or plain "Darwin" which is
@@ -3642,6 +3704,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
CheckX11
CheckMacGL
CheckOpenGLX11
CheckVulkan
CheckPTHREAD
# Set up files for the audio library
@@ -3695,6 +3758,9 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
if test x$ac_cv_header_vulkan_vulkan_h = xyes; then
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
fi
;;
*-nacl|*-pnacl)
ARCH=nacl