Skip to content

Commit

Permalink
Windows ARM64: Initial support
Browse files Browse the repository at this point in the history
CI: Add GitHub Action Windows ARM64 CI

This mega commit also includes the changes from the following PR:

cmake: Add DISABLE_QSV11 option to disable QSV encoder obsproject#4748

libobs: Restrict emmintrin.h to x86(_64) platform obsproject#4746

Resolve potential symbol clash on MSVC obsproject#4743

obs-filters: Add preprocessor guard to method obsproject#4730

Windows ARM64: Initial support

CI: Add GitHub Action Windows ARM64 CI

This mega commit also includes the changes from the following PR:

cmake: Add DISABLE_QSV11 option to disable QSV encoder obsproject#4748

libobs: Restrict emmintrin.h to x86(_64) platform obsproject#4746

Resolve potential symbol clash on MSVC obsproject#4743

obs-filters: Add preprocessor guard to method obsproject#4730

obs-qsv11: Add ENABLE_QSV11 option

obs-qsv11: Add ENABLE_QSV11 option

UI: Remove Qt Windows Extras for Qt 6 and later

UI: Remove Qt Windows Extras for Qt 6 and later

UI: Remove Qt Windows Extras for Qt 6 and later
Co-Authored-By: Matt Gajownik <[email protected]>
  • Loading branch information
tommyvct and WizardCM committed Jan 8, 2022
1 parent fab293a commit e48b2f7
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 9 deletions.
67 changes: 64 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ on:
paths-ignore:
- '**.md'
branches:
- master
- 'release/**'
- '**'
- '*'
tags:
- '*'
pull_request:
paths-ignore:
- '**.md'
branches:
- master
- '**'
- '*'

env:
MACOS_CEF_BUILD_VERSION: '4638'
Expand Down Expand Up @@ -711,3 +712,63 @@ jobs:
with:
name: '${{ env.FILE_NAME }}'
path: build/*
winarm64:
name: 'Windows on ARM64'
runs-on: [windows-latest]
env:
QT_VERSION: '5.15.2'
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_SYSTEM_VERSION: "10.0.18363.657"
VIRTUALCAM-GUID: "A3FCE0F5-3493-419F-958A-ABA1250EC20B"
steps:
- name: 'Add msbuild to PATH'
uses: microsoft/[email protected]
- name: 'Checkout'
uses: actions/[email protected]
with:
submodules: 'recursive'
- name: 'Fetch Git Tags'
shell: bash
run: |
git fetch --prune --unshallow
echo "OBS_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: 'Check for Github Labels'
if: github.event_name == 'pull_request'
shell: bash
run: |
LABELS_URL="$(echo ${{ github.event.pull_request.url }} | sed s'/pulls/issues/')"
LABEL_FOUND="$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "${LABELS_URL}/labels" | sed -n 's/.*"name": "\(.*\)",/\1/p' | grep 'Seeking Testers' || true)"
if [ "${LABEL_FOUND}" = "Seeking Testers" ]; then
echo "SEEKING_TESTERS=1" >> $GITHUB_ENV
else
echo "SEEKING_TESTERS=0" >> $GITHUB_ENV
fi
- name: 'Install prerequisite: Pre-built dependencies'
run: |
curl -kL https://github.com/tommyvct/obs-deps/releases/latest/download/DepsARM64.zip -f --retry 5 -o DepsARM64.zip
7z x DepsARM64.zip -o"${{ github.workspace }}/cmbuild/"
- name: "Configure"
run: |
mkdir ./build64
cd ./build64
cmake -G"${{ env.CMAKE_GENERATOR }}" -A"ARM64" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=true -DCOMPILE_D3D12_HOOK=true -DDepsPath="${{ github.workspace }}/cmbuild/DepsARM64" -DQTDIR="${{ github.workspace }}/cmbuild/DepsARM64/qt/" -DCEF_ROOT_DIR="${{ github.workspace }}/cmbuild/DepsARM64/cef" -DPYTHON_LIB="${{ github.workspace }}/cmbuild/DepsARM64/bin/python39.lib" -DTWITCH_CLIENTID='${{ env.TWITCH_CLIENTID }}' -DTWITCH_HASH='${{ env.TWITCH_HASH }}' -DRESTREAM_CLIENTID='${{ env.RESTREAM_CLIENTID }}' -DRESTREAM_HASH='${{ env.RESTREAM_HASH }}' -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE -DVIRTUALCAM_GUID=${{ env.VIRTUALCAM-GUID }} -DBUILD_AMD_ENCODER=OFF -DENABLE_SCRIPTING=ON -DCOMPILE_PYTHON=ON -DENABLE_QSV11=OFF -DVULKAN_INCLUDE_DIR="${{ github.workspace }}/cmbuild/DepsARM64/VulkanSDK/include" -DVULKAN_LIB="${{ github.workspace }}/cmbuild/DepsARM64/VulkanSDK/vulkan-1.lib" ..
- name: 'Build'
run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-studio.sln
- name: 'Package'
if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1')
run: |
$env:FILE_DATE=(Get-Date -UFormat "%F")
$env:FILE_NAME="${env:FILE_DATE}-${{ env.OBS_GIT_HASH }}-${{ env.OBS_GIT_TAG }}-windows_arm64"
echo "FILE_NAME=${env:FILE_NAME}" >> ${env:GITHUB_ENV}
robocopy .\build64\rundir\RelWithDebInfo .\build\ /E /XF .gitignore
7z
- name: 'Publish'
if: success() && (github.event_name != 'pull_request' || env.SEEKING_TESTERS == '1')
uses: actions/[email protected]
with:
name: '${{ env.FILE_NAME }}'
path: build/*


7 changes: 7 additions & 0 deletions UI/win-update/updater/updater.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
"processorArchitecture='amd64' " \
"publicKeyToken='6595b64144ccf1df' " \
"language='*'\"")
#elif defined _M_ARM64
#pragma comment(linker, "/manifestdependency:\"type='win32' " \
"name='Microsoft.Windows.Common-Controls' " \
"version='6.0.0.0' " \
"processorArchitecture='arm64' " \
"publicKeyToken='6595b64144ccf1df' " \
"language='*'\"")
#else
#pragma comment(linker, "/manifestdependency:\"type='win32' " \
"name='Microsoft.Windows.Common-Controls' " \
Expand Down
4 changes: 4 additions & 0 deletions cmake/Modules/CopyMSVCBins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ file(GLOB FFMPEG_BIN_FILES
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin/avfilter-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin${_bin_suffix}/avfilter-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/bin${_bin_suffix}/avfilter-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin/avresample-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/../bin${_bin_suffix}/avresample-*.dll"
"${FFMPEG_avfilter_INCLUDE_DIR}/bin${_bin_suffix}/avresample-*.dll"


"${FFMPEG_postproc_INCLUDE_DIR}/../bin/postproc-*.dll"
"${FFMPEG_postproc_INCLUDE_DIR}/../bin${_bin_suffix}/postproc-*.dll"
Expand Down
2 changes: 1 addition & 1 deletion deps/w32-pthreads/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#define PTW32_PROGCTR(Context) ((Context).Rip)
#endif

#if defined(_ARM_) || defined(ARM)
#if defined(_ARM_) || defined(ARM) || defined(_M_ARM) || defined(_M_ARM64)
#define PTW32_PROGCTR(Context) ((Context).Pc)
#endif

Expand Down
8 changes: 7 additions & 1 deletion libobs/obs-win-crash-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@ static inline bool get_dbghelp_imports(struct exception_handler_data *data)

static inline void init_instruction_data(struct stack_trace *trace)
{
#ifdef _WIN64
#if defined(_M_ARM64)
trace->instruction_ptr = trace->context.Pc;
trace->frame.AddrPC.Offset = trace->instruction_ptr;
trace->frame.AddrFrame.Offset = trace->context.Fp;
trace->frame.AddrStack.Offset = trace->context.Sp;
trace->image_type = IMAGE_FILE_MACHINE_ARM64;
#elif defined(_WIN64)
trace->instruction_ptr = trace->context.Rip;
trace->frame.AddrPC.Offset = trace->instruction_ptr;
trace->frame.AddrFrame.Offset = trace->context.Rbp;
Expand Down
2 changes: 1 addition & 1 deletion libobs/util/threading-windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <string.h>

#if !defined(_M_IX86) && !defined(_M_X64) && !defined(_M_ARM) && \
!defined(_M_ARM64)
!defined(_M_ARM64) && !defined(_M_ARM64EC)
#error Processor not supported
#endif

Expand Down
4 changes: 2 additions & 2 deletions libobs/util/util_uint64.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

#pragma once

#if defined(_MSC_VER) && defined(_M_X64)
#if defined(_MSC_VER) && defined(_M_X64) && !defined(_M_ARM64EC)
#include <intrin.h>
#endif

static inline uint64_t util_mul_div64(uint64_t num, uint64_t mul, uint64_t div)
{
#if defined(_MSC_VER) && defined(_M_X64)
#if defined(_MSC_VER) && defined(_M_X64) && !defined(_M_ARM64EC)
unsigned __int64 high;
const unsigned __int64 low = _umul128(num, mul, &high);
unsigned __int64 rem;
Expand Down
2 changes: 1 addition & 1 deletion plugins/obs-vst

0 comments on commit e48b2f7

Please sign in to comment.