diff --git a/.ci/azure.yml b/.ci/azure.yml deleted file mode 100644 index ccd043b3..00000000 --- a/.ci/azure.yml +++ /dev/null @@ -1,115 +0,0 @@ -#*****************************************************************************# -# Copyright (C) 2009 Aali132 # -# Copyright (C) 2018 quantumpencil # -# Copyright (C) 2018 Maxime Bacoux # -# Copyright (C) 2020 myst6re # -# Copyright (C) 2020 Chris Rizzitello # -# Copyright (C) 2020 John Pritchard # -# Copyright (C) 2024 Julian Xhokaxhiu # -# # -# This file is part of FFNx # -# # -# FFNx is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License # -# # -# FFNx is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -#*****************************************************************************# - -# Azure Pipeline YAML file - -name: 1.17.1$(Rev:.r) - -trigger: - batch: true - branches: - include: - - master - tags: - include: - - '*' - -pr: - drafts: false - -variables: - _IS_BUILD_CANARY: false - _IS_GITHUB_RELEASE: false - _RELEASE_NAME: FFNx - _RELEASE_VERSION: v0 - _RELEASE_CONFIGURATION: Release - _BUILD_VERSION: $(Build.BuildNumber) - _BUILD_BRANCH: $(Build.SourceBranch) - _CHANGELOG_VERSION: "0" - # VCPKG: Enable Binary Caching - VCPKG_BINARY_SOURCES: clear;nuget,https://pkgs.dev.azure.com/julianxhokaxhiu/Github/_packaging/FFNx/nuget/v3/index.json,readwrite - # GIT: Fix reporting from stderr to stdout - GIT_REDIRECT_STDERR: 2>&1 - -pool: - vmImage: 'windows-2022' - -jobs: -- job: FFNx - timeoutInMinutes: 1440 - steps: - - task: NuGetAuthenticate@1 - - task: PowerShell@2 - displayName: 'Build $(_RELEASE_NAME)' - inputs: - filePath: .ci\build.ps1 - failOnStderr: true - pwsh: true - - task: PublishPipelineArtifact@1 - displayName: 'Publish PR $(_RELEASE_NAME) Artifact' - condition: and(eq(variables._IS_GITHUB_RELEASE, 'false'), succeeded()) - inputs: - targetPath: .dist\ - artifactName: $(_RELEASE_NAME)-$(_RELEASE_VERSION) - - task: GitHubRelease@0 - condition: and(eq(variables._IS_GITHUB_RELEASE, 'true'), eq(variables._IS_BUILD_CANARY, 'true'), succeeded()) - displayName: 'Delete $(_RELEASE_NAME) (Canary)' - continueOnError: true - inputs: - gitHubConnection: github_ci - action: delete - tagSource: manual - tag: canary - - task: GitHubRelease@0 - condition: and(eq(variables._IS_GITHUB_RELEASE, 'true'), eq(variables._IS_BUILD_CANARY, 'true'), succeeded()) - displayName: 'Create $(_RELEASE_NAME) (Canary)' - inputs: - gitHubConnection: github_ci - assets: .dist\*.zip - isPreRelease: true - tagSource: manual - tag: canary - title: $(_RELEASE_NAME)-$(_RELEASE_VERSION) - releaseNotesSource: input - releaseNotes: | - See https://github.com/julianxhokaxhiu/FFNx/blob/master/Changelog.md#next - - This is a canary build. Please be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK! - - task: GitHubRelease@0 - condition: and(eq(variables._IS_GITHUB_RELEASE, 'true'), eq(variables._IS_BUILD_CANARY, 'false'), succeeded()) - displayName: 'Create $(_RELEASE_NAME) (Stable)' - inputs: - gitHubConnection: github_ci - assets: .dist\*.zip - title: $(_RELEASE_NAME)-$(_RELEASE_VERSION) - releaseNotesSource: input - releaseNotes: | - See https://github.com/julianxhokaxhiu/FFNx/blob/master/Changelog.md#$(_CHANGELOG_VERSION) - - task: PowerShell@2 - condition: and(eq(variables._IS_GITHUB_RELEASE, 'true'), succeeded()) - displayName: 'Alert the $(_RELEASE_NAME) Release' - inputs: - filePath: .ci\alert.ps1 - env: - _MAP_FFNX_TSUNAMODS_FF7: $(_FFNX_TSUNAMODS_FF7) - _MAP_FFNX_TSUNAMODS_FF8: $(_FFNX_TSUNAMODS_FF8) - _MAP_FFNX_QHIMM_FF7: $(_FFNX_QHIMM_FF7) - _MAP_FFNX_QHIMM_FF8: $(_FFNX_QHIMM_FF8) diff --git a/.ci/alert.ps1 b/.github/workflows/alert.ps1 similarity index 100% rename from .ci/alert.ps1 rename to .github/workflows/alert.ps1 diff --git a/.ci/build.ps1 b/.github/workflows/build.ps1 similarity index 80% rename from .ci/build.ps1 rename to .github/workflows/build.ps1 index ab521c5c..ac83cbca 100644 --- a/.ci/build.ps1 +++ b/.github/workflows/build.ps1 @@ -49,11 +49,11 @@ Write-Output "VCPKG BRANCH: $vcpkgBranchName" Write-Output "VCPKG BASELINE: $vcpkgBaseline" Write-Output "--------------------------------------------------" -Write-Host "##vso[task.setvariable variable=_BUILD_VERSION;]${env:_BUILD_VERSION}" -Write-Host "##vso[task.setvariable variable=_RELEASE_VERSION;]${env:_RELEASE_VERSION}" -Write-Host "##vso[task.setvariable variable=_IS_BUILD_CANARY;]${env:_IS_BUILD_CANARY}" -Write-Host "##vso[task.setvariable variable=_IS_GITHUB_RELEASE;]${env:_IS_GITHUB_RELEASE}" -Write-Host "##vso[task.setvariable variable=_CHANGELOG_VERSION;]${env:_CHANGELOG_VERSION}" +Write-Output "_BUILD_VERSION=${env:_BUILD_VERSION}" >> ${env:GITHUB_ENV} +Write-Output "_RELEASE_VERSION=${env:_RELEASE_VERSION}" >> ${env:GITHUB_ENV} +Write-Output "_IS_BUILD_CANARY=${env:_IS_BUILD_CANARY}" >> ${env:GITHUB_ENV} +Write-Output "_IS_GITHUB_RELEASE=${env:_IS_GITHUB_RELEASE}" >> ${env:GITHUB_ENV} +Write-Output "_CHANGELOG_VERSION=${env:_CHANGELOG_VERSION}" >> ${env:GITHUB_ENV} # Load vcvarsall environment for x86 $vcvarspath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease -latest -property InstallationPath @@ -64,6 +64,28 @@ Get-Content "$env:temp\vcvars.txt" | Foreach-Object { } } +# Unset VCPKG_ROOT if set +[Environment]::SetEnvironmentVariable('VCPKG_ROOT','') + +# Add Github Packages registry +nuget sources add -Name github -Source "https://nuget.pkg.github.com/${env:GITHUB_REPOSITORY_OWNER}/index.json" -Username ${env:GITHUB_REPOSITORY_OWNER} -Password ${env:GITHUB_PACKAGES_PAT} -StorePasswordInClearText +nuget sources list + +# Install Scoop +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser +Invoke-Expression "& {$(Invoke-RestMethod get.scoop.sh)} -RunAsAdmin" + +# Install CMake +scoop bucket add main +scoop install main/cmake@3.28.1 + +cmake --version + +# Install Powershell +scoop install main/pwsh@7.4.1 +pwsh --version + +# Vcpkg setup git -C $vcpkgRoot pull --all git -C $vcpkgRoot checkout $vcpkgBaseline git -C $vcpkgRoot clean -fxd @@ -72,9 +94,11 @@ cmd.exe /c "call $vcpkgRoot\bootstrap-vcpkg.bat" vcpkg integrate install +# Start the build cmake --preset "${env:_RELEASE_CONFIGURATION}" -D_DLL_VERSION="$env:_BUILD_VERSION" cmake --build --preset "${env:_RELEASE_CONFIGURATION}" +# Start the packaging mkdir .dist\pkg\FF7_1998 | Out-Null mkdir .dist\pkg\FF8_2000 | Out-Null mkdir .dist\pkg\FFNx_Steam | Out-Null diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..dfc4a80f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,88 @@ +name: FFNx + +run-name: 1.17.1.${{ github.run_number }} + +on: + workflow_dispatch: + push: + branches: + - master + tags: + - "*" + pull_request: + branches: + - master + +env: + _IS_BUILD_CANARY: false + _IS_GITHUB_RELEASE: false + _RELEASE_NAME: FFNx + _RELEASE_VERSION: v0 + _RELEASE_CONFIGURATION: Release + _BUILD_BRANCH: "${{ github.ref }}" + _BUILD_VERSION: "1.17.1.${{ github.run_number }}" + _CHANGELOG_VERSION: "0" + # Force concurrency to 4 threads + VCPKG_MAX_CONCURRENCY: 4 + # GIT: Fix reporting from stderr to stdout + GIT_REDIRECT_STDERR: 2>&1 + +jobs: + FFNx: + runs-on: windows-latest + timeout-minutes: 1440 + strategy: + max-parallel: 1 + steps: + - name: Set Git Config + run: | + git config --global core.autocrlf false + git config --global core.filemode false + git config --global core.longpaths true + - name: Checkout + uses: actions/checkout@v4.1.0 + - name: Build FFNx + run: ".github/workflows/build.ps1" + shell: pwsh + env: + GITHUB_PACKAGES_PAT: ${{ secrets._GITHUB_PACKAGES_PAT }} + - name: Publish PR FFNx Artifact + if: env._IS_GITHUB_RELEASE == 'false' && success() + uses: actions/upload-artifact@v4.0.0 + with: + name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}" + path: ".dist/*.zip" + - name: Create FFNx (Canary) + uses: ncipollo/release-action@v1 + if: env._IS_GITHUB_RELEASE == 'true' && env._IS_BUILD_CANARY == 'true' && success() + with: + artifacts: ".dist/*.zip" + generateReleaseNotes: true + prerelease: true + removeArtifacts: true + tag: canary + name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}" + body: | + See https://github.com/julianxhokaxhiu/FFNx/blob/master/Changelog.md#next + + This is a canary build. Please be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK! + - name: Create FFNx (Stable) + uses: ncipollo/release-action@v1 + if: env._IS_GITHUB_RELEASE == 'true' && env._IS_BUILD_CANARY == 'false' && success() + with: + artifacts: ".dist/*.zip" + generateReleaseNotes: true + makeLatest: true + removeArtifacts: true + name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}" + body: | + See https://github.com/julianxhokaxhiu/FFNx/blob/master/Changelog.md#$(_CHANGELOG_VERSION) + - name: Alert the FFNx Release + if: env._IS_GITHUB_RELEASE == 'true' && success() + env: + _MAP_FFNX_TSUNAMODS_FF7: "${{ secrets._FFNX_TSUNAMODS_FF7 }}" + _MAP_FFNX_TSUNAMODS_FF8: "${{ secrets._FFNX_TSUNAMODS_FF8 }}" + _MAP_FFNX_QHIMM_FF7: "${{ secrets._FFNX_QHIMM_FF7 }}" + _MAP_FFNX_QHIMM_FF8: "${{ secrets._FFNX_QHIMM_FF8 }}" + run: ".github/workflows/alert.ps1" + shell: pwsh diff --git a/.vcpkg/ports/bgfx/portfile.cmake b/.vcpkg/ports/bgfx/portfile.cmake index e4f894d6..4e943bd2 100644 --- a/.vcpkg/ports/bgfx/portfile.cmake +++ b/.vcpkg/ports/bgfx/portfile.cmake @@ -6,22 +6,22 @@ vcpkg_from_github(OUT_SOURCE_PATH BX_SOURCE_DIR REPO "julianxhokaxhiu/bx" HEAD_REF master - REF afd1d16d32debfc996cd6b181d7688d0b24cea05 - SHA512 680ebf950f621ec807082f1a7edc489cf4d4c35b6ee39b0dd3f15f6b93c78871b727a9450bee2ec065cc43e55aff09231e175f375eeaefd1244ee9574763f684 + REF a4951e0bb1755ce08bee2e5e9bda11f5927b9c9f + SHA512 fdb4f7df6d53061a0b60c9e9fb03ac4f1607db03d670e015ae9041e0130e5319326d21ba0c8ab93b08767c831859c82adcb00464a4813125c34ebff8c54ce17f ) vcpkg_from_github(OUT_SOURCE_PATH BIMG_SOURCE_DIR REPO "julianxhokaxhiu/bimg" HEAD_REF master - REF ab96ba9dda6c23273751be81509f3fe3086d7724 - SHA512 1c86cc72224880760b63d67153c2843a4d71932e0a3d1150af1337f09c28598a638afe820b61c56d8cc172924111c7c8da8fbf0720e019307dba10450f3b04c8 + REF 964a5b85483cdf59a30dc006e9bd8bbdde6cb2be + SHA512 6335c5856f52c9525a8a16043880f469f8163888fb65225db90888f5f7230bd6a89c9aac5a8a5cf13a7fecbe8b0fcaa8748996e385bd8ea5c126509f773fcd4b ) vcpkg_from_github(OUT_SOURCE_PATH SOURCE_DIR REPO "julianxhokaxhiu/bgfx" HEAD_REF master - REF e3e5b1372b4ec63170770ce34862667e916bd491 - SHA512 6f0d9a5b73b6b5f08a3c236ffb607b67641236c8d88ee06357e807eb5167757b894a1fa28aa3beb01416e8dbcb522183f56c9745b492cabd087e7cd27c62e72d + REF 6de504638e9890803fcf1eb10b9ef4ac50c8debf + SHA512 1f855e16802db9523c4d399011d92976a74f9bd9dbde8426f8e02011eccbdd643b77c2781367087db1854aca9343832d8c7215887f468926fa438e8431eb656a ) # Move bx source inside bgfx source tree diff --git a/.vcpkg/ports/bimg/portfile.cmake b/.vcpkg/ports/bimg/portfile.cmake index a5f7445b..a424eb1f 100644 --- a/.vcpkg/ports/bimg/portfile.cmake +++ b/.vcpkg/ports/bimg/portfile.cmake @@ -6,15 +6,15 @@ vcpkg_from_github(OUT_SOURCE_PATH BX_SOURCE_DIR REPO "julianxhokaxhiu/bx" HEAD_REF master - REF afd1d16d32debfc996cd6b181d7688d0b24cea05 - SHA512 680ebf950f621ec807082f1a7edc489cf4d4c35b6ee39b0dd3f15f6b93c78871b727a9450bee2ec065cc43e55aff09231e175f375eeaefd1244ee9574763f684 + REF a4951e0bb1755ce08bee2e5e9bda11f5927b9c9f + SHA512 fdb4f7df6d53061a0b60c9e9fb03ac4f1607db03d670e015ae9041e0130e5319326d21ba0c8ab93b08767c831859c82adcb00464a4813125c34ebff8c54ce17f ) vcpkg_from_github(OUT_SOURCE_PATH SOURCE_DIR REPO "julianxhokaxhiu/bimg" HEAD_REF master - REF ab96ba9dda6c23273751be81509f3fe3086d7724 - SHA512 1c86cc72224880760b63d67153c2843a4d71932e0a3d1150af1337f09c28598a638afe820b61c56d8cc172924111c7c8da8fbf0720e019307dba10450f3b04c8 + REF 964a5b85483cdf59a30dc006e9bd8bbdde6cb2be + SHA512 6335c5856f52c9525a8a16043880f469f8163888fb65225db90888f5f7230bd6a89c9aac5a8a5cf13a7fecbe8b0fcaa8748996e385bd8ea5c126509f773fcd4b ) # Move bx source inside bgfx source tree diff --git a/.vcpkg/ports/bx/portfile.cmake b/.vcpkg/ports/bx/portfile.cmake index cc581f92..46fe5de8 100644 --- a/.vcpkg/ports/bx/portfile.cmake +++ b/.vcpkg/ports/bx/portfile.cmake @@ -7,8 +7,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github(OUT_SOURCE_PATH SOURCE_DIR REPO "julianxhokaxhiu/bx" HEAD_REF master - REF afd1d16d32debfc996cd6b181d7688d0b24cea05 - SHA512 680ebf950f621ec807082f1a7edc489cf4d4c35b6ee39b0dd3f15f6b93c78871b727a9450bee2ec065cc43e55aff09231e175f375eeaefd1244ee9574763f684 + REF a4951e0bb1755ce08bee2e5e9bda11f5927b9c9f + SHA512 fdb4f7df6d53061a0b60c9e9fb03ac4f1607db03d670e015ae9041e0130e5319326d21ba0c8ab93b08767c831859c82adcb00464a4813125c34ebff8c54ce17f ) # Set up GENie (custom project generator) diff --git a/.vcpkg/ports/tomlplusplus/portfile.cmake b/.vcpkg/ports/tomlplusplus/portfile.cmake index 350b67ab..36e6d05b 100644 --- a/.vcpkg/ports/tomlplusplus/portfile.cmake +++ b/.vcpkg/ports/tomlplusplus/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO marzer/tomlplusplus - REF v3.3.0 - SHA512 6ab2de83b7fc44de40e58a47c28a9507bf7c50fa9b08925b5a6d48958868a86e6790aff684d29ceb50ad18905e3832840719e1b7bfec3b8a0c00b15bb0f70f38 + REF v3.4.0 + SHA512 c227fc8147c9459b29ad24002aaf6ab2c42fac22ea04c1c52b283a0172581ccd4527b33c1931e0ef0d1db6b6a53f9e9882c6d4231c7f3494cf070d0220741aa5 HEAD_REF master ) diff --git a/.vcpkg/ports/tomlplusplus/vcpkg.json b/.vcpkg/ports/tomlplusplus/vcpkg.json index e33261ea..77b675b9 100644 --- a/.vcpkg/ports/tomlplusplus/vcpkg.json +++ b/.vcpkg/ports/tomlplusplus/vcpkg.json @@ -1,6 +1,6 @@ { "name": "tomlplusplus", - "version": "3.3.0", + "version": "3.4.0", "description": "Header-only TOML config file parser and serializer for modern C++.", "homepage": "https://marzer.github.io/tomlplusplus/", "license": "MIT", diff --git a/.vcpkg/ports/vgmstream/portfile.cmake b/.vcpkg/ports/vgmstream/portfile.cmake index 611a8847..0145d690 100644 --- a/.vcpkg/ports/vgmstream/portfile.cmake +++ b/.vcpkg/ports/vgmstream/portfile.cmake @@ -7,8 +7,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO "vgmstream/vgmstream" HEAD_REF master - REF r1879 - SHA512 900d48367d377862602e1ff11046f26ac537a2809530a880828531de429afc02b3b31611582145f89d50750a1d0d6758e10f49aab4bfb303256e8d4138ae9601 + REF r1896 + SHA512 35e4f004e2282f837df111818545fddba18bb7a1e2014c5d6925ea3709ad94fc1c3ca6ba9cee26f505045fa4da36ab10525eeccb0ca89b4bb9f5f8022d052e4f PATCHES cmake.patch ) diff --git a/.vcpkg/versions/baseline.json b/.vcpkg/versions/baseline.json index 7079033c..39d4c8eb 100644 --- a/.vcpkg/versions/baseline.json +++ b/.vcpkg/versions/baseline.json @@ -33,7 +33,7 @@ "port-version": 0 }, "tomlplusplus": { - "baseline": "3.3.0", + "baseline": "3.4.0", "port-version": 0 } } diff --git a/.vcpkg/versions/t-/tomlplusplus.json b/.vcpkg/versions/t-/tomlplusplus.json index 6ca268e4..26a4bceb 100644 --- a/.vcpkg/versions/t-/tomlplusplus.json +++ b/.vcpkg/versions/t-/tomlplusplus.json @@ -1,7 +1,7 @@ { "versions": [ { - "version": "3.3.0", + "version": "3.4.0", "path": "$/ports/tomlplusplus" } ] diff --git a/CMakeLists.txt b/CMakeLists.txt index 95c945ba..fc4bbf7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,15 +201,6 @@ foreach(FFNX_SHADER IN LISTS FFNX_SHADERS) ${CMAKE_BINARY_DIR}/vcpkg_installed/x86-windows-static/tools/bgfx/shadercRelease -i ${CMAKE_BINARY_DIR}/vcpkg_installed/x86-windows-static/include -f ${CMAKE_SOURCE_DIR}/misc/${FFNX_SHADER}.vert -o ${CMAKE_BINARY_DIR}/bin/shaders/${FFNX_SHADER}.${BGFX_VARYING}.vk.vert --type v --varyingdef ${CMAKE_SOURCE_DIR}/misc/${RELEASE_NAME}.varying.${BGFX_VARYING}.def.sc --platform windows --profile spirv - # Direct3D 9 - COMMAND - ${CMAKE_BINARY_DIR}/vcpkg_installed/x86-windows-static/tools/bgfx/shadercRelease -i ${CMAKE_BINARY_DIR}/vcpkg_installed/x86-windows-static/include -f ${CMAKE_SOURCE_DIR}/misc/${FFNX_SHADER}.frag -o - ${CMAKE_BINARY_DIR}/bin/shaders/${FFNX_SHADER}.${BGFX_VARYING}.d3d9.frag --type f --varyingdef - ${CMAKE_SOURCE_DIR}/misc/${RELEASE_NAME}.varying.${BGFX_VARYING}.def.sc --platform windows -p s_3_0 -O 3 - COMMAND - ${CMAKE_BINARY_DIR}/vcpkg_installed/x86-windows-static/tools/bgfx/shadercRelease -i ${CMAKE_BINARY_DIR}/vcpkg_installed/x86-windows-static/include -f ${CMAKE_SOURCE_DIR}/misc/${FFNX_SHADER}.vert -o - ${CMAKE_BINARY_DIR}/bin/shaders/${FFNX_SHADER}.${BGFX_VARYING}.d3d9.vert --type v --varyingdef - ${CMAKE_SOURCE_DIR}/misc/${RELEASE_NAME}.varying.${BGFX_VARYING}.def.sc --platform windows -p s_3_0 -O 3 # Direct3D 11 COMMAND ${CMAKE_BINARY_DIR}/vcpkg_installed/x86-windows-static/tools/bgfx/shadercRelease -i ${CMAKE_BINARY_DIR}/vcpkg_installed/x86-windows-static/include -f ${CMAKE_SOURCE_DIR}/misc/${FFNX_SHADER}.frag -o diff --git a/CMakePresets.json b/CMakePresets.json index 02d160d9..0a425e7f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -19,7 +19,8 @@ "strategy": "set" }, "environment": { - "VCPKG_ROOT": "C:/vcpkg" + "VCPKG_ROOT": "C:/vcpkg", + "VCPKG_BINARY_SOURCES": "clear;nuget,github,readwrite" }, "binaryDir": "${sourceDir}/.build", "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", diff --git a/README.md b/README.md index c142bf0d..a4667c97 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![License](https://img.shields.io/github/license/julianxhokaxhiu/FFNx) ![Overall Downloads](https://img.shields.io/github/downloads/julianxhokaxhiu/FFNx/total?label=Overall%20Downloads) ![Latest Stable Downloads](https://img.shields.io/github/downloads/julianxhokaxhiu/FFNx/latest/total?label=Latest%20Stable%20Downloads&sort=semver) ![Latest Canary Downloads](https://img.shields.io/github/downloads/julianxhokaxhiu/FFNx/canary/total?label=Latest%20Canary%20Downloads) [![Build Status](https://dev.azure.com/julianxhokaxhiu/Github/_apis/build/status/julianxhokaxhiu.FFNx?branchName=master)](https://dev.azure.com/julianxhokaxhiu/Github/_build/latest?definitionId=1&branchName=master) +![License](https://img.shields.io/github/license/julianxhokaxhiu/FFNx) ![Overall Downloads](https://img.shields.io/github/downloads/julianxhokaxhiu/FFNx/total?label=Overall%20Downloads) ![Latest Stable Downloads](https://img.shields.io/github/downloads/julianxhokaxhiu/FFNx/latest/total?label=Latest%20Stable%20Downloads&sort=semver) ![Latest Canary Downloads](https://img.shields.io/github/downloads/julianxhokaxhiu/FFNx/canary/total?label=Latest%20Canary%20Downloads) ![GitHub Actions Workflow Status](https://github.com/julianxhokaxhiu/FFNx/actions/workflows/main.yml/badge.svg?branch=master)
@@ -24,7 +24,6 @@ FFNx today in a nutshell: - DirectX 12 - Vulkan - OpenGL - - DirectX 9 (Experimental: Not Recommended) ## The Team @@ -159,6 +158,16 @@ Once the project is built you can find the output in this path: `.build/bin` 1. Go inside the `C:\vcpkg` folder and double click `bootstrap-vcpkg.bat` 2. Open a `cmd` window in `C:\vcpkg` and run the following command: `vcpkg integrate install` +### OPTIONAL: NuGet + +> ** Please note:** +> +> This step is completely optional but you can make use of it if you prefer to use your own Github Free package registry plan. + +0. Make sure you have [NuGet CLI installed](https://learn.microsoft.com/en-us/nuget/install-nuget-client-tools?tabs=windows#install-nugetexe). +1. [Create a Personal Access token ( classic )](https://github.com/settings/tokens/new) with the `write:packages` permission. +2. Open a `cmd` window and run the following command: `dotnet nuget add source --name github --username YOUR_GITHUB_USERNAME --password YOUR_GITHUB_PAT --store-password-in-clear-text "https://nuget.pkg.github.com/YOUR_GITHUB_USERNAME/index.json"` ( replace `YOUR_GITHUB_USERNAME` and `YOUR_GITHUB_PAT` accordingly ) + ### Visual Studio > **Please note:** diff --git a/misc/FFNx.frag b/misc/FFNx.frag index 79ca833d..cccb9433 100644 --- a/misc/FFNx.frag +++ b/misc/FFNx.frag @@ -119,8 +119,6 @@ void main() texture2D(tex_2, v_texcoord0.xy).r ); -// d3d9 doesn't support textureSize() -#if BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_GLSL || BGFX_SHADER_LANGUAGE_SPIRV if (!(isFullRange)){ // dither prior to range conversion ivec2 ydimensions = textureSize(tex_0, 0); @@ -130,7 +128,6 @@ void main() // clamp back to tv range yuv = clamp(yuv, vec3_splat(16.0/255.0), vec3(235.0/255.0, 240.0/255.0, 240.0/255.0)); } -#endif if (isBT601ColorMatrix){ yuv.g = yuv.g - (128.0/255.0); @@ -189,10 +186,8 @@ void main() if ((isSRGBColorGamut) || (isSMPTECColorGamut) || (isEBUColorGamut)){ color.rgb = GamutLUT(color.rgb); // dither after the LUT operation - #if BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_GLSL || BGFX_SHADER_LANGUAGE_SPIRV ivec2 dimensions = textureSize(tex_0, 0); color.rgb = QuasirandomDither(color.rgb, v_texcoord0.xy, dimensions, dimensions, dimensions, 255.0, 4320.0); - #endif } // Note: Bring back matrix-based conversions for HDR *if* we can find a way to left potentially out-of-bounds values linger until post processing. } @@ -202,10 +197,8 @@ void main() if ((isNTSCJColorGamut) || (isSMPTECColorGamut) || (isEBUColorGamut)){ color.rgb = GamutLUT(color.rgb); // dither after the LUT operation - #if BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_GLSL || BGFX_SHADER_LANGUAGE_SPIRV ivec2 dimensions = textureSize(tex_0, 0); color.rgb = QuasirandomDither(color.rgb, v_texcoord0.xy, dimensions, dimensions, dimensions, 255.0, 4320.0); - #endif } // Note: Bring back matrix-based conversions for HDR *if* we can find a way to left potentially out-of-bounds values linger until post processing. } @@ -269,10 +262,8 @@ void main() // Hopefully the future will bring a way to set this for types of textures (e.g., world, model, field, spell, etc.) or even for individual textures based on metadata. else if (doGamutOverride){ texture_color.rgb = GamutLUT(texture_color.rgb); - #if BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_GLSL || BGFX_SHADER_LANGUAGE_SPIRV ivec2 dimensions = textureSize(tex_0, 0); texture_color.rgb = QuasirandomDither(texture_color.rgb, v_texcoord0.xy, dimensions, dimensions, dimensions, 255.0, 1.0); - #endif // Note: Bring back matrix-based conversions for HDR *if* we can find a way to left potentially out-of-bounds values linger until post processing. } diff --git a/misc/FFNx.lighting.frag b/misc/FFNx.lighting.frag index 323949d9..945513cd 100644 --- a/misc/FFNx.lighting.frag +++ b/misc/FFNx.lighting.frag @@ -135,8 +135,6 @@ void main() texture2D(tex_2, v_texcoord0.xy).r ); -// d3d9 doesn't support textureSize() -#if BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_GLSL || BGFX_SHADER_LANGUAGE_SPIRV if (!(isFullRange)){ // dither prior to range conversion ivec2 ydimensions = textureSize(tex_0, 0); @@ -146,7 +144,6 @@ void main() // clamp back to tv range yuv = clamp(yuv, vec3_splat(16.0/255.0), vec3(235.0/255.0, 240.0/255.0, 240.0/255.0)); } -#endif if (isBT601ColorMatrix){ yuv.g = yuv.g - (128.0/255.0); @@ -207,10 +204,8 @@ void main() if ((isSRGBColorGamut) || (isSMPTECColorGamut) || (isEBUColorGamut)){ color.rgb = GamutLUT(color.rgb); // dither after the LUT operation - #if BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_GLSL || BGFX_SHADER_LANGUAGE_SPIRV ivec2 dimensions = textureSize(tex_0, 0); color.rgb = QuasirandomDither(color.rgb, v_texcoord0.xy, dimensions, dimensions, dimensions, 255.0, 4320.0); - #endif } // Note: Bring back matrix-based conversions for HDR *if* we can find a way to left potentially out-of-bounds values linger until post processing. } @@ -220,10 +215,8 @@ void main() if ((isNTSCJColorGamut) || (isSMPTECColorGamut) || (isEBUColorGamut)){ color.rgb = GamutLUT(color.rgb); // dither after the LUT operation - #if BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_GLSL || BGFX_SHADER_LANGUAGE_SPIRV ivec2 dimensions = textureSize(tex_0, 0); color.rgb = QuasirandomDither(color.rgb, v_texcoord0.xy, dimensions, dimensions, dimensions, 255.0, 4320.0); - #endif } // Note: Bring back matrix-based conversions for HDR *if* we can find a way to left potentially out-of-bounds values linger until post processing. } @@ -290,10 +283,8 @@ void main() // Hopefully the future will bring a way to set this for types of textures (e.g., world, model, field, spell, etc.) or even for individual textures based on metadata. else if (doGamutOverride){ texture_color.rgb = GamutLUT(texture_color.rgb); - #if BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_GLSL || BGFX_SHADER_LANGUAGE_SPIRV ivec2 dimensions = textureSize(tex_0, 0); texture_color.rgb = QuasirandomDither(texture_color.rgb, v_texcoord0.xy, dimensions, dimensions, dimensions, 255.0, 1.0); - #endif // Note: Bring back matrix-based conversions for HDR *if* we can find a way to left potentially out-of-bounds values linger until post processing. } diff --git a/misc/FFNx.post.frag b/misc/FFNx.post.frag index 525ef8b9..943f26dd 100644 --- a/misc/FFNx.post.frag +++ b/misc/FFNx.post.frag @@ -44,11 +44,8 @@ void main() color.rgb = toLinear(color.rgb); // TODO: If/when a full 10-bit pathway is available for 10-bit FMVs, don't dither those - // d3d9 doesn't support textureSize() - #if BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_GLSL || BGFX_SHADER_LANGUAGE_SPIRV - ivec2 dimensions = textureSize(tex_0, 0); - color.rgb = QuasirandomDither(color.rgb, v_texcoord0.xy, dimensions, dimensions, dimensions, 255.0, 2160.0); - #endif + ivec2 dimensions = textureSize(tex_0, 0); + color.rgb = QuasirandomDither(color.rgb, v_texcoord0.xy, dimensions, dimensions, dimensions, 255.0, 2160.0); if (isOverallNTSCJColorGamut){ color.rgb = convertGamut_NTSCJtoREC2020(color.rgb); } @@ -61,10 +58,8 @@ void main() color.rgb = toLinear(color.rgb); color.rgb = GamutLUT(color.rgb); // dither after the LUT operation - #if BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_GLSL || BGFX_SHADER_LANGUAGE_SPIRV - ivec2 dimensions = textureSize(tex_0, 0); - color.rgb = QuasirandomDither(color.rgb, v_texcoord0.xy, dimensions, dimensions, dimensions, 255.0, 2160.0); - #endif + ivec2 dimensions = textureSize(tex_0, 0); + color.rgb = QuasirandomDither(color.rgb, v_texcoord0.xy, dimensions, dimensions, dimensions, 255.0, 2160.0); color.rgb = toGamma(color.rgb); } diff --git a/misc/FFNx.toml b/misc/FFNx.toml index 9b0704b0..902b31f2 100644 --- a/misc/FFNx.toml +++ b/misc/FFNx.toml @@ -12,7 +12,7 @@ # Available choices are: # - 0: Auto ( default, will pick the best rendering backend for your GPU ) # - 1: OpenGL ( works fine on Intel/Nvidia, MAY break on AMD ) -# - 2: Direct3D9 ( Tech Preview: Not Recommended ) +# - 2: UNUSED ( used to be Direct3D9, no more supported ) # - 3: Direct3D11 ( works fine under any GPU on Windows ) # - 4: Direct3D12 # - 5: Vulkan diff --git a/src/cfg.h b/src/cfg.h index 797c584a..2645ff78 100644 --- a/src/cfg.h +++ b/src/cfg.h @@ -28,7 +28,8 @@ #define RENDERER_BACKEND_AUTO 0 #define RENDERER_BACKEND_OPENGL 1 -#define RENDERER_BACKEND_DIRECT3D9 2 +// Slot 2 used to be used for DIRECT3D9 but is not more officially supported by bgfx. +// Preserve the slot numbers as they are to ensure compatibility with existing installations and tooling. #define RENDERER_BACKEND_DIRECT3D11 3 #define RENDERER_BACKEND_DIRECT3D12 4 #define RENDERER_BACKEND_VULKAN 5 diff --git a/src/renderer.cpp b/src/renderer.cpp index c63a329d..46cd7c5f 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -223,9 +223,6 @@ bgfx::RendererType::Enum Renderer::getUserChosenRenderer() { case RENDERER_BACKEND_OPENGL: ret = bgfx::RendererType::OpenGL; break; - case RENDERER_BACKEND_DIRECT3D9: - ret = bgfx::RendererType::Direct3D9; - break; case RENDERER_BACKEND_DIRECT3D11: ret = bgfx::RendererType::Direct3D11; break; @@ -253,10 +250,6 @@ void Renderer::updateRendererShaderPaths() currentRenderer = "OpenGL"; shaderSuffix = ".gl"; break; - case bgfx::RendererType::Direct3D9: - currentRenderer = "Direct3D9"; - shaderSuffix = ".d3d9"; - break; case bgfx::RendererType::Direct3D11: currentRenderer = "Direct3D11"; shaderSuffix = ".d3d11"; diff --git a/vcpkg.json b/vcpkg.json index 9321c97b..1e3f6c14 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ffnx", "version": "1.17.1", - "builtin-baseline": "a42af01b72c28a8e1d7b48107b33e4f286a55ef6", + "builtin-baseline": "53bef8994c541b6561884a8395ea35715ece75db", "dependencies": [ "bgfx", { @@ -70,22 +70,22 @@ { "name": "ffmpeg", "version": "6.1", - "port-version": 0 + "port-version": 2 }, { "name": "imgui", - "version": "1.89.9", - "port-version": 0 + "version": "1.90", + "port-version": 3 }, { "name": "libpng", - "version": "1.6.39", + "version": "1.6.40", "port-version": 1 }, { "name": "mimalloc", - "version": "2.1.1", - "port-version": 0 + "version": "2.1.2", + "port-version": 1 }, { "name": "openpsf", @@ -109,7 +109,7 @@ }, { "name": "tomlplusplus", - "version": "3.3.0", + "version": "3.4.0", "port-version": 0 }, {