Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Vulkan: update to 1.1.82, break up into four ports following upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
valpackett committed Aug 7, 2018
1 parent 0283a65 commit 8171240
Show file tree
Hide file tree
Showing 47 changed files with 419 additions and 229 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This fork of the FreeBSD Ports Collection merges the [KDE](https://github.com/fr
- to install and keep pkg happy without rebuilding everything, just `pkg add -f` over existing `mesa-libs/dri`
- `graphics/mesa-dri` and `graphics/mesa-libs`:
- enabled VK_KHR_wayland_surface [221540](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221540)
- `graphics/vulkan-sdk`: [Vulkan SDK](https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers) (headers, ICD loader, validation layers) [222175](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222175)
- `graphics/vulkan-loader` `devel/vulkan-headers` `devel/vulkan-validation-layers` `devel/vulkan-tools`: [222175](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222175)

NOTE: ANV (Intel Vulkan) requires running the apps as root and might not work for complex applications.
RADV (Radeon Vulkan) with the `amdgpu` KMS/DRM driver works very well!
Expand Down
3 changes: 2 additions & 1 deletion devel/glslang/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# $FreeBSD$

PORTNAME= glslang
DISTVERSION= 5.1
DISTVERSION= 6.2.2596-248
DISTVERSIONSUFFIX= -ge0bc65b
CATEGORIES= devel graphics

MAINTAINER= greg@unrelenting.technology
Expand Down
6 changes: 3 additions & 3 deletions devel/glslang/distinfo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TIMESTAMP = 1520705320
SHA256 (KhronosGroup-glslang-5.1_GH0.tar.gz) = 2389ab4d7fa5dc9b8df58da3f5d80653bf415905ef4384e97c2b85701a901d24
SIZE (KhronosGroup-glslang-5.1_GH0.tar.gz) = 2052323
TIMESTAMP = 1533666570
SHA256 (KhronosGroup-glslang-6.2.2596-248-ge0bc65b_GH0.tar.gz) = 497a18bfe7e102cda61377ca4fd7dbd84478a89b80e4d53420cf94c9a380f2f0
SIZE (KhronosGroup-glslang-6.2.2596-248-ge0bc65b_GH0.tar.gz) = 2353165
5 changes: 2 additions & 3 deletions devel/spirv-tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

PORTNAME= spirv-tools
DISTVERSIONPREFIX= v
DISTVERSION= 2018.0-6
DISTVERSIONSUFFIX= -g9e19fc0
DISTVERSION= 2018.4
CATEGORIES= devel graphics

MAINTAINER= greg@unrelenting.technology
Expand All @@ -17,7 +16,7 @@ SHEBANG_FILES= tools/lesspipe/spirv-lesspipe.sh
USE_GITHUB= yes
GH_ACCOUNT= KhronosGroup
GH_PROJECT= SPIRV-Tools
GH_TUPLE= KhronosGroup:SPIRV-Headers:ce309203d:headers/external/spirv-headers
GH_TUPLE= KhronosGroup:SPIRV-Headers:ff684ff:headers/external/spirv-headers

CMAKE_ARGS+= -DSPIRV_SKIP_TESTS:BOOL=ON \
-DSPIRV_WERROR:BOOL=OFF
Expand Down
10 changes: 5 additions & 5 deletions devel/spirv-tools/distinfo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TIMESTAMP = 1519686387
SHA256 (KhronosGroup-SPIRV-Tools-v2018.0-6-g9e19fc0_GH0.tar.gz) = 54892d2a47a68179a9e51f9d648302db6ef77e11bc909acef37097d7823d6827
SIZE (KhronosGroup-SPIRV-Tools-v2018.0-6-g9e19fc0_GH0.tar.gz) = 955907
SHA256 (KhronosGroup-SPIRV-Headers-ce309203d_GH0.tar.gz) = f07b35c2e63dd0c8bcbb7fb50185e79a2a067ac1878dc49353196a688b025583
SIZE (KhronosGroup-SPIRV-Headers-ce309203d_GH0.tar.gz) = 269780
TIMESTAMP = 1533666224
SHA256 (KhronosGroup-SPIRV-Tools-v2018.4_GH0.tar.gz) = e09749d3b9d767cf1cf62ba3cf7d7f992f19681477c434fea214227f3665d8d1
SIZE (KhronosGroup-SPIRV-Tools-v2018.4_GH0.tar.gz) = 1327904
SHA256 (KhronosGroup-SPIRV-Headers-ff684ff_GH0.tar.gz) = dbeb5b65b290519b026f3eb280107929901d671a7f29ae536885bb72e6c38ebd
SIZE (KhronosGroup-SPIRV-Headers-ff684ff_GH0.tar.gz) = 280884
2 changes: 2 additions & 0 deletions devel/spirv-tools/pkg-plist
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ include/spirv-tools/linker.hpp
include/spirv-tools/optimizer.hpp
lib/libSPIRV-Tools-link.a
lib/libSPIRV-Tools-opt.a
lib/libSPIRV-Tools-shared.so
lib/libSPIRV-Tools.a
libdata/pkgconfig/SPIRV-Tools-shared.pc
libdata/pkgconfig/SPIRV-Tools.pc
20 changes: 20 additions & 0 deletions devel/vulkan-headers/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# $FreeBSD$

PORTNAME= vulkan-headers
DISTVERSIONPREFIX=sdk-
DISTVERSION= 1.1.82.0
CATEGORIES= devel graphics

MAINTAINER= greg@unrelenting.technology
COMMENT= Headers for the Vulkan graphics API

LICENSE= APACHE20

USES= cmake:outsource
STRIP= # nothing to strip

USE_GITHUB= yes
GH_ACCOUNT= KhronosGroup
GH_PROJECT= Vulkan-Headers

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions devel/vulkan-headers/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TIMESTAMP = 1533661644
SHA256 (KhronosGroup-Vulkan-Headers-sdk-1.1.82.0_GH0.tar.gz) = df73da07d547cfbe88a797802401ea8225e4844e13d4fde52a7cb6e00e5179e5
SIZE (KhronosGroup-Vulkan-Headers-sdk-1.1.82.0_GH0.tar.gz) = 472646
5 changes: 5 additions & 0 deletions devel/vulkan-headers/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Vulkan is a low-level cross-platform 3D graphics and compute API.

This port provides the development headers for Vulkan applications.

WWW: https://github.com/KhronosGroup/Vulkan-Headers
23 changes: 23 additions & 0 deletions devel/vulkan-headers/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
include/vulkan/vk_icd.h
include/vulkan/vk_layer.h
include/vulkan/vk_platform.h
include/vulkan/vk_sdk_platform.h
include/vulkan/vulkan.h
include/vulkan/vulkan.hpp
include/vulkan/vulkan_android.h
include/vulkan/vulkan_core.h
include/vulkan/vulkan_ios.h
include/vulkan/vulkan_macos.h
include/vulkan/vulkan_mir.h
include/vulkan/vulkan_vi.h
include/vulkan/vulkan_wayland.h
include/vulkan/vulkan_win32.h
include/vulkan/vulkan_xcb.h
include/vulkan/vulkan_xlib.h
include/vulkan/vulkan_xlib_xrandr.h
share/vulkan/registry/cgenerator.py
share/vulkan/registry/generator.py
share/vulkan/registry/genvk.py
share/vulkan/registry/reg.py
share/vulkan/registry/validusage.json
share/vulkan/registry/vk.xml
32 changes: 32 additions & 0 deletions devel/vulkan-tools/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# $FreeBSD$

PORTNAME= vulkan-tools
DISTVERSIONPREFIX= sdk-
DISTVERSION= 1.1.82.0
CATEGORIES= devel graphics

MAINTAINER= greg@unrelenting.technology
COMMENT= Tools and demos for the Vulkan graphics API

LICENSE= APACHE20

BUILD_DEPENDS= ${LOCALBASE}/include/vulkan/vulkan.h:devel/vulkan-headers \
glslangValidator:devel/glslang
LIB_DEPENDS= libvulkan.so:graphics/vulkan-loader \
libX11-xcb.so:x11/libX11 \
libXrandr.so:x11/libXrandr \
libxcb.so:x11/libxcb

USES= cmake:outsource compiler:c++11-lib python:3.4+,build pkgconfig

USE_GITHUB= yes
GH_ACCOUNT= KhronosGroup
GH_PROJECT= Vulkan-Tools

CMAKE_ARGS+= -DBUILD_TESTS:BOOL=OFF \
-DBUILD_ICD:BOOL=OFF \
-DBUILD_WSI_WAYLAND_SUPPORT:BOOL=OFF \
-DBUILD_WSI_MIR_SUPPORT:BOOL=OFF \
-DGLSLANG_INSTALL_DIR=${LOCALBASE}

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions devel/vulkan-tools/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TIMESTAMP = 1533667375
SHA256 (KhronosGroup-Vulkan-Tools-sdk-1.1.82.0_GH0.tar.gz) = 22e5e5dfd47535e1664458ee59706abcaace96575d1a3d7fa9ae779a9e83b89c
SIZE (KhronosGroup-Vulkan-Tools-sdk-1.1.82.0_GH0.tar.gz) = 342057
33 changes: 33 additions & 0 deletions devel/vulkan-tools/files/patch-cube_CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--- cube/CMakeLists.txt.orig 2018-08-07 18:44:03 UTC
+++ cube/CMakeLists.txt
@@ -48,7 +48,7 @@ else()
find_program(GLSLANG_VALIDATOR NAMES ${GLSLANG_VALIDATOR_NAME} HINTS "${PROJECT_SOURCE_DIR}/glslang/bin")
endif()

-if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+if(UNIX AND NOT APPLE)
include(FindPkgConfig)
option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON)
option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON)
@@ -58,10 +58,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")

if(BUILD_WSI_XCB_SUPPORT)
find_package(XCB REQUIRED)
+ include_directories(SYSTEM ${XCB_INCLUDE_DIR})
endif()

if(BUILD_WSI_XLIB_SUPPORT)
find_package(X11 REQUIRED)
+ include_directories(SYSTEM ${X11_Xlib_INCLUDE_PATH})
endif()

if(BUILD_WSI_WAYLAND_SUPPORT)
@@ -87,7 +89,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR)
-elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+elseif(UNIX AND NOT APPLE)
if(NOT CUBE_WSI_SELECTION)
set(CUBE_WSI_SELECTION "XCB")
endif()
11 changes: 11 additions & 0 deletions devel/vulkan-tools/files/patch-cube_cube.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- cube/cube.cpp.orig 2018-08-07 18:51:55 UTC
+++ cube/cube.cpp
@@ -2922,7 +2922,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPre
return (int)msg.wParam;
}

-#elif __linux__
+#elif __unix__

int main(int argc, char **argv) {
Demo demo;
24 changes: 24 additions & 0 deletions devel/vulkan-tools/files/patch-vulkaninfo_CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- vulkaninfo/CMakeLists.txt.orig 2018-08-07 18:45:41 UTC
+++ vulkaninfo/CMakeLists.txt
@@ -28,7 +28,7 @@ else()
add_executable(vulkaninfo vulkaninfo.c)
endif()

-if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+if(UNIX AND NOT APPLE)
include(FindPkgConfig)
option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON)
option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON)
@@ -36,10 +36,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")

if(BUILD_WSI_XCB_SUPPORT)
find_package(XCB REQUIRED)
+ include_directories(SYSTEM ${XCB_INCLUDE_DIR})
endif()

if(BUILD_WSI_XLIB_SUPPORT)
find_package(X11 REQUIRED)
+ include_directories(SYSTEM ${X11_Xlib_INCLUDE_PATH})
endif()

if(VULKANINFO_WSI_SELECTION STREQUAL "XCB")
5 changes: 5 additions & 0 deletions devel/vulkan-tools/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Vulkan is a low-level cross-platform 3D graphics and compute API.

This port provides various tools and demos for Vulkan, e.g. vulkaninfo.

WWW: https://github.com/KhronosGroup/Vulkan-Tools
3 changes: 3 additions & 0 deletions devel/vulkan-tools/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bin/cube
bin/cubepp
bin/vulkaninfo
32 changes: 32 additions & 0 deletions devel/vulkan-validation-layers/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# $FreeBSD$

PORTNAME= vulkan-validation-layers
DISTVERSIONPREFIX= sdk-
DISTVERSION= 1.1.82.0
CATEGORIES= devel graphics

MAINTAINER= greg@unrelenting.technology
COMMENT= Validation layers for the Vulkan graphics API

LICENSE= APACHE20

# NOTE: keep spirv-tools and glslang up to date when updating Vulkan
BUILD_DEPENDS= ${LOCALBASE}/include/vulkan/vulkan.h:devel/vulkan-headers \
${LOCALBASE}/include/spirv-tools/libspirv.h:devel/spirv-tools \
${LOCALBASE}/include/SPIRV/spirv.hpp:devel/glslang

USES= cmake:outsource compiler:c++11-lib python:3.4+,build pkgconfig

USE_GITHUB= yes
GH_ACCOUNT= KhronosGroup
GH_PROJECT= Vulkan-ValidationLayers

# WSI_* in here are leftover from when all of Vulkan SDK was in one repo
CMAKE_ARGS+= -DBUILD_TESTS:BOOL=OFF \
-DBUILD_WSI_XCB_SUPPORT:BOOL=OFF \
-DBUILD_WSI_XLIB_SUPPORT:BOOL=OFF \
-DBUILD_WSI_WAYLAND_SUPPORT:BOOL=OFF \
-DBUILD_WSI_MIR_SUPPORT:BOOL=OFF \
-DGLSLANG_INSTALL_DIR=${LOCALBASE}

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions devel/vulkan-validation-layers/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TIMESTAMP = 1533665599
SHA256 (KhronosGroup-Vulkan-ValidationLayers-sdk-1.1.82.0_GH0.tar.gz) = 6d83d1f7085bcfe67a791fce0bfb500dfb5d4833f062db1fc272bdc86e87eded
SIZE (KhronosGroup-Vulkan-ValidationLayers-sdk-1.1.82.0_GH0.tar.gz) = 962154
23 changes: 23 additions & 0 deletions devel/vulkan-validation-layers/files/patch-CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--- CMakeLists.txt.orig 2018-07-30 17:53:08 UTC
+++ CMakeLists.txt
@@ -63,9 +63,9 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# "Helper" targets that don't have interesting source code should set their FOLDER property to this
set(LAYERS_HELPER_FOLDER "Helper Targets")

-if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+if(UNIX)
set(
- FALLBACK_CONFIG_DIRS "/etc/xdg"
+ FALLBACK_CONFIG_DIRS "${CMAKE_INSTALL_PREFIX}/etc/xdg:/etc/xdg"
CACHE
STRING
"Search path to use when XDG_CONFIG_DIRS is unset or empty or the current process is SUID/SGID. Default is freedesktop compliant."
@@ -78,7 +78,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_
)
endif()

-if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+if(UNIX AND NOT APPLE)
include(FindPkgConfig)
option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON)
option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON)
20 changes: 20 additions & 0 deletions devel/vulkan-validation-layers/files/patch-layers_CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- layers/CMakeLists.txt.orig 2018-07-30 17:53:08 UTC
+++ layers/CMakeLists.txt
@@ -23,7 +23,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(DisplayServer Win32)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR -DVK_USE_PLATFORM_ANDROID_KHX)
-elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+elseif(UNIX AND NOT APPLE)
if(BUILD_WSI_XCB_SUPPORT)
add_definitions(-DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XCB_KHX)
endif()
@@ -131,7 +131,7 @@ if(WIN32)
add_custom_target(vk_validation_error_messages ALL COMMAND copy ${src_val_msgs} ${dst_val_msgs} VERBATIM)
set_target_properties(vk_validation_error_messages PROPERTIES FOLDER ${LAYERS_HELPER_FOLDER})
endif()
-elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+ elseif(UNIX AND NOT APPLE)
# extra setup for out-of-tree builds
if(NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR))
foreach(config_file ${LAYER_JSON_FILES})
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- layers/vk_loader_platform.h.orig 2018-08-07 18:19:43 UTC
+++ layers/vk_loader_platform.h
@@ -31,7 +31,7 @@
#include "vulkan/vk_platform.h"
#include "vulkan/vk_sdk_platform.h"

-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__unix__)
/* Linux-specific common code: */

// Headers:
6 changes: 6 additions & 0 deletions devel/vulkan-validation-layers/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Vulkan is a low-level cross-platform 3D graphics and compute API.

This port provides the official validation layers for Vulkan applications,
which are useful for development and debugging.

WWW: https://github.com/KhronosGroup/Vulkan-ValidationLayers
35 changes: 35 additions & 0 deletions devel/vulkan-validation-layers/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
include/hash_util.h
include/hash_vk_types.h
include/vk_dispatch_table_helper.h
include/vk_enum_string_helper.h
include/vk_extension_helper.h
include/vk_format_utils.cpp
include/vk_format_utils.h
include/vk_layer_config.cpp
include/vk_layer_config.h
include/vk_layer_data.h
include/vk_layer_dispatch_table.h
include/vk_layer_extension_utils.cpp
include/vk_layer_extension_utils.h
include/vk_layer_logging.h
include/vk_layer_utils.cpp
include/vk_layer_utils.h
include/vk_loader_layer.h
include/vk_loader_platform.h
include/vk_object_types.h
include/vk_safe_struct.cpp
include/vk_safe_struct.h
include/vk_typemap_helper.h
include/vk_validation_error_messages.h
lib/libVkLayer_core_validation.so
lib/libVkLayer_object_tracker.so
lib/libVkLayer_parameter_validation.so
lib/libVkLayer_threading.so
lib/libVkLayer_unique_objects.so
lib/libVkLayer_utils.a
share/vulkan/explicit_layer.d/VkLayer_core_validation.json
share/vulkan/explicit_layer.d/VkLayer_object_tracker.json
share/vulkan/explicit_layer.d/VkLayer_parameter_validation.json
share/vulkan/explicit_layer.d/VkLayer_standard_validation.json
share/vulkan/explicit_layer.d/VkLayer_threading.json
share/vulkan/explicit_layer.d/VkLayer_unique_objects.json
4 changes: 2 additions & 2 deletions emulators/rpcs3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ LDFLAGS+= -Wl,--as-needed # GLU

OPTIONS_DEFINE= ALSA EVDEV GDB LLVM PULSEAUDIO VULKAN
OPTIONS_DEFAULT=ALSA LLVM VULKAN
.if !exists(${.CURDIR:H:H}/graphics/vulkan-sdk)
.if !exists(${.CURDIR:H:H}/graphics/vulkan-loader)
OPTIONS_EXCLUDE=VULKAN # XXX ports/222175
.endif

Expand All @@ -70,7 +70,7 @@ PULSEAUDIO_LIB_DEPENDS= libpulse-simple.so:audio/pulseaudio
PULSEAUDIO_CMAKE_BOOL= USE_PULSE

VULKAN_DESC= Vulkan renderer
VULKAN_LIB_DEPENDS= libvulkan.so:graphics/vulkan-sdk
VULKAN_LIB_DEPENDS= libvulkan.so:graphics/vulkan-loader
VULKAN_CMAKE_BOOL= USE_VULKAN

post-patch:
Expand Down
Loading

0 comments on commit 8171240

Please sign in to comment.