AMF + NVENC control and support
This commit is contained in:
@@ -93,6 +93,11 @@ if /I "%DISABLE_CGO%"=="true" (
|
||||
echo Run scripts\vendor-nvcodec-headers.bat from the repo root or set DISABLE_CGO=true.
|
||||
goto :err
|
||||
)
|
||||
if not exist "%CLIENT_DIR%\third_party\amf\include\core\Factory.h" (
|
||||
echo AMD AMF headers are not cached; fetching them now...
|
||||
call "%ROOT%scripts\vendor-amf-headers.bat"
|
||||
if errorlevel 1 goto :err
|
||||
)
|
||||
)
|
||||
%BUILD_CMD% %BUILD_TAGS% -ldflags="%LDFLAGS% %WIN_LDFLAGS%" -o "%OUT_DIR%\agent-windows-amd64.exe" ./cmd/agent
|
||||
if errorlevel 1 goto :err
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set "SCRIPT_DIR=%~dp0"
|
||||
for %%I in ("%SCRIPT_DIR%..") do set "ROOT_DIR=%%~fI"
|
||||
set "DEST_DIR=%ROOT_DIR%\Overlord-Client\third_party\amf"
|
||||
set "DEST_HEADER=%DEST_DIR%\include\core\Factory.h"
|
||||
if "%AMF_REPO%"=="" set "AMF_REPO=https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git"
|
||||
if "%AMF_REF%"=="" set "AMF_REF=v1.5.2"
|
||||
|
||||
if exist "%DEST_HEADER%" if /I not "%~1"=="--force" (
|
||||
echo AMF headers already cached: "%DEST_DIR%\include"
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
where git >nul 2>&1 || (echo git is required to vendor AMF headers & exit /b 1)
|
||||
set "TMP_DIR=%DEST_DIR%\.amf-sdk.tmp"
|
||||
if exist "%TMP_DIR%" rd /s /q "%TMP_DIR%"
|
||||
if not exist "%DEST_DIR%" mkdir "%DEST_DIR%"
|
||||
|
||||
git clone --depth 1 --filter=blob:none --sparse --branch "%AMF_REF%" "%AMF_REPO%" "%TMP_DIR%" || goto :err
|
||||
git -C "%TMP_DIR%" sparse-checkout set --no-cone amf/public/include/ LICENSE.txt || goto :err
|
||||
if exist "%DEST_DIR%\include" rd /s /q "%DEST_DIR%\include"
|
||||
xcopy /e /i /q /y "%TMP_DIR%\amf\public\include" "%DEST_DIR%\include" >nul || goto :err
|
||||
copy /y "%TMP_DIR%\LICENSE.txt" "%DEST_DIR%\LICENSE.txt" >nul || goto :err
|
||||
rd /s /q "%TMP_DIR%"
|
||||
echo Cached AMD AMF %AMF_REF% headers in "%DEST_DIR%\include"
|
||||
exit /b 0
|
||||
|
||||
:err
|
||||
if exist "%TMP_DIR%" rd /s /q "%TMP_DIR%"
|
||||
echo Failed to fetch AMD AMF headers
|
||||
exit /b 1
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
DEST_DIR="${ROOT_DIR}/Overlord-Client/third_party/amf"
|
||||
DEST_HEADER="${DEST_DIR}/include/core/Factory.h"
|
||||
REPO_URL="${AMF_REPO:-https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git}"
|
||||
REF="${AMF_REF:-v1.5.2}"
|
||||
|
||||
if [[ -s "${DEST_HEADER}" && "${1:-}" != "--force" ]]; then
|
||||
echo "AMF headers already cached: ${DEST_DIR}/include"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
command -v git >/dev/null 2>&1 || { echo "git is required to vendor AMF headers" >&2; exit 1; }
|
||||
TMP_DIR="${DEST_DIR}/.amf-sdk.tmp"
|
||||
rm -rf "${TMP_DIR}"
|
||||
trap 'rm -rf "${TMP_DIR}"' EXIT
|
||||
mkdir -p "${DEST_DIR}"
|
||||
git clone --depth 1 --filter=blob:none --sparse --branch "${REF}" "${REPO_URL}" "${TMP_DIR}"
|
||||
git -C "${TMP_DIR}" sparse-checkout set --no-cone amf/public/include/ LICENSE.txt
|
||||
rm -rf "${DEST_DIR}/include"
|
||||
cp -R "${TMP_DIR}/amf/public/include" "${DEST_DIR}/include"
|
||||
cp "${TMP_DIR}/LICENSE.txt" "${DEST_DIR}/LICENSE.txt"
|
||||
rm -rf "${TMP_DIR}"
|
||||
trap - EXIT
|
||||
echo "Cached AMD AMF ${REF} headers in ${DEST_DIR}/include"
|
||||
Reference in New Issue
Block a user