Skip to content

Commit

Permalink
Merge branch 'NatronGitHub:RB-2.5' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
TodicaIonut authored Mar 8, 2024
2 parents 568e216 + 95fd6d5 commit 6282582
Show file tree
Hide file tree
Showing 12 changed files with 211 additions and 92 deletions.
42 changes: 37 additions & 5 deletions .github/workflows/build_installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
with:
submodules: recursive

Expand Down Expand Up @@ -59,8 +59,24 @@ jobs:
echo "INSTALLER_NAME=${INSTALLER_NAME}" >> $GITHUB_OUTPUT
echo "INSTALLER_DIR=$(cygpath -m ${INSTALLER_DIR})" >> $GITHUB_OUTPUT
- name: Build verify_plugin_loads binary
run: |
g++ -DWINDOWS -o verify_plugin_loads .github/workflows/verify_plugin_loads.cpp libs/OpenFX/HostSupport/src/ofxhBinary.cpp libs/OpenFX/HostSupport/src/ofxhUtilities.cpp -I libs/OpenFX/HostSupport/include/ -I libs/OpenFX/include/
- name: Uninstall Natron dependencies
run: |
pacman -Rs --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
- name: Verify plugin loading
run: |
INSTALLER_DIR=$(cygpath -u '${{ steps.build.outputs.INSTALLER_DIR }}')/${{ steps.build.outputs.INSTALLER_NAME }}
for x in $(find ${INSTALLER_DIR}/Plugins -name *.ofx); do
echo "Testing $(basename ${x}) ..."
PATH=${INSTALLER_DIR}/bin ./verify_plugin_loads.exe "${x}"
done
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ steps.build.outputs.INSTALLER_NAME }}
path: ${{ steps.build.outputs.INSTALLER_DIR }}
Expand All @@ -74,7 +90,7 @@ jobs:

steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
with:
submodules: recursive

Expand Down Expand Up @@ -125,14 +141,30 @@ jobs:
echo "SYMBOLS_NAME=${SYMBOLS_NAME}" >> $GITHUB_OUTPUT
echo "SYMBOLS_DIR=$(cygpath -m ${SYMBOLS_DIR})" >> $GITHUB_OUTPUT
- name: Build verify_plugin_loads binary
run: |
g++ -DWINDOWS -o verify_plugin_loads .github/workflows/verify_plugin_loads.cpp libs/OpenFX/HostSupport/src/ofxhBinary.cpp libs/OpenFX/HostSupport/src/ofxhUtilities.cpp -I libs/OpenFX/HostSupport/include/ -I libs/OpenFX/include/
- name: Uninstall Natron dependencies
run: |
pacman -Rs --noconfirm mingw-w64-x86_64-natron-build-deps-qt5
- name: Verify plugin loading
run: |
INSTALLER_DIR=$(cygpath -u '${{ steps.build.outputs.INSTALLER_DIR }}')/${{ steps.build.outputs.INSTALLER_NAME }}
for x in $(find ${INSTALLER_DIR}/Plugins -name *.ofx); do
echo "Testing $(basename ${x}) ..."
PATH=${INSTALLER_DIR}/bin ./verify_plugin_loads.exe "${x}"
done
- name: Upload installer
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ steps.build.outputs.INSTALLER_NAME }}
path: ${{ steps.build.outputs.INSTALLER_DIR }}

- name: Upload symbols
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ steps.build.outputs.SYMBOLS_NAME }}
path: ${{ steps.build.outputs.SYMBOLS_DIR }}
8 changes: 4 additions & 4 deletions .github/workflows/build_pacman_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
shell: msys2 {0}
steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
with:
submodules: recursive
- name: Setup MinGW environment
Expand All @@ -44,7 +44,7 @@ jobs:
pacman -Sl mingw64 msys > mingw-package-version-list.txt
- name: Restore natron repo directory from cache
id: restore-natron-repo-cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4.0.0
with:
path: natron_repo
key: ${{ env.cache-name }}-${{ hashFiles('mingw-package-version-list.txt', 'tools/MINGW-packages/**/PKGBUILD') }}
Expand All @@ -59,14 +59,14 @@ jobs:
echo "REPO_VERSION=${REPO_VERSION}" >> "$GITHUB_OUTPUT"
- name: Save natron repo directory to cache
id: save-natron-repo-cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4.0.0
# save even if build fails.
if: always()
with:
path: natron_repo
key: ${{ env.cache-name }}-${{ hashFiles('mingw-package-version-list.txt', 'tools/MINGW-packages/**/PKGBUILD') }}
- name: Upload natron_package_repo artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.1
with:
name: natron_package_repo-${{ steps.build-package-repo.outputs.REPO_VERSION }}
path: natron_repo
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
branches:
- RB-2.5
- RB-2.6
- fix-ci # For testing. Remove before commit.
paths-ignore:
- Documentation
pull_request:
Expand Down Expand Up @@ -40,7 +39,7 @@ jobs:
python-version: '3.10'
steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
with:
submodules: recursive
- name: Install Linux system packages
Expand Down Expand Up @@ -102,7 +101,7 @@ jobs:
OFX_PLUGIN_PATH=$PWD/../Plugins OCIO=$PWD/../OpenColorIO-Configs/blender/config.ocio ctest -V
- name: Upload ${{ matrix.os }} Test Log artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ matrix.os }} Test Logs
path: ${{ github.workspace }}/release/Testing/Temporary/LastTest.log
Expand Down Expand Up @@ -130,7 +129,7 @@ jobs:
python-version: ['3.10']
steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
with:
submodules: recursive

Expand Down Expand Up @@ -173,7 +172,7 @@ jobs:
PYTHONHOME=/mingw64 OFX_PLUGIN_PATH=$PWD/Plugins OCIO=$PWD/../OpenColorIO-Configs/blender/config.ocio ctest -V
- name: Upload ${{ matrix.os }} Test Log artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ matrix.os }} Test Logs
path: ${{ github.workspace }}/build/Testing/Temporary/LastTest.log
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/verify_plugin_loads.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

#include "ofxhBinary.h"
#include "ofxhPluginCache.h"

int
main(int argc, const char* argv[])
{
if (argc < 2) {
std::cerr << "Usage: " << argv[0] << " <plugin>\n";
return 1;
}

const char* const binaryPath = argv[1];

// TODO: Change code to _dlHandle = dlopen(_binaryPath.c_str(), RTLD_NOW|RTLD_LOCAL);
OFX::Binary bin(binaryPath);

if (bin.isInvalid()) {
std::cerr << "error: '" << binaryPath << "' is invalid.\n";
return 1;
}

bin.load();

if (!bin.isLoaded()) {
std::cerr << "error: '" << binaryPath << "' failed to load.\n";
return 1;
}

auto* getNumberOfPlugins = (OFX::Host::OfxGetNumberOfPluginsFunc)bin.findSymbol("OfxGetNumberOfPlugins");
auto* getPluginFunc = (OFX::Host::OfxGetPluginFunc)bin.findSymbol("OfxGetPlugin");

if (getNumberOfPlugins == nullptr || getPluginFunc == nullptr) {
std::cerr << "error: '" << binaryPath << "' missing required symbols.\n";
return 1;
}

const int numPlugins = getNumberOfPlugins();

std::cout << "numPlugins: " << numPlugins << "\n";

if (numPlugins <= 0) {
std::cerr << "error: unexpected number of plugins.\n";
return 1;
}

for (int i = 0; i < numPlugins; ++i) {
auto* plugin = getPluginFunc(i);
if (plugin == nullptr) {
std::cerr << "Failed to get plugin " << i << "\n";
return 1;
}

std::cout << "plugin[" << i << "] : " << plugin->pluginIdentifier << " v" << plugin->pluginVersionMajor << "." << plugin->pluginVersionMinor << "\n";
}

return 0;
}
10 changes: 6 additions & 4 deletions Engine/EffectInstanceRenderRoI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@ EffectInstance::renderRoI(const RenderRoIArgs & args,
roi = args.roi.toNewMipmapLevel(args.mipmapLevel, 0, par, rod);

if (frameArgs->tilesSupported) {
if (!roi.clipIfOverlaps(upscaledImageBoundsNc)) {
roi.clip(upscaledImageBoundsNc);
if (roi.isNull()) {
return eRenderRoIRetCodeOk;
}
assert(upscaledImageBoundsNc.contains(roi));
Expand All @@ -747,7 +748,8 @@ EffectInstance::renderRoI(const RenderRoIArgs & args,
roi = args.roi;

if (frameArgs->tilesSupported) {
if (!roi.clipIfOverlaps(downscaledImageBoundsNc)) {
roi.clip(downscaledImageBoundsNc);
if (roi.isNull()) {
return eRenderRoIRetCodeOk;
}
assert(downscaledImageBoundsNc.contains(roi));
Expand Down Expand Up @@ -844,8 +846,8 @@ EffectInstance::renderRoI(const RenderRoIArgs & args,
renderMappedMipmapLevel = args.mipmapLevel;
renderMappedScale = RenderScale::fromMipmapLevel(renderMappedMipmapLevel);
if (frameArgs->tilesSupported) {
roi = args.roi;
if ( !roi.clipIfOverlaps(downscaledImageBoundsNc) ) {
roi = args.roi.intersect(downscaledImageBoundsNc);
if ( roi.isNull() ) {
return eRenderRoIRetCodeOk;
}
} else {
Expand Down
Loading

0 comments on commit 6282582

Please sign in to comment.