diff --git a/.github/workflows/ci-steps.yaml b/.github/workflows/ci-steps.yaml index dbce4ae..a88edc3 100644 --- a/.github/workflows/ci-steps.yaml +++ b/.github/workflows/ci-steps.yaml @@ -30,6 +30,62 @@ jobs: if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get install -y libxmu-dev libxi-dev libgl-dev libxrandr-dev libxinerama-dev libxcursor-dev mono-complete + - name: Setup Virtual GPU for Testing (Linux only) + if: runner.os == 'Linux' + run: | + echo "=== Setting up Linux Software Rendering ===" + + # Set up Xvfb (virtual display) and Vulkan software rendering + sudo apt-get update + sudo apt-get install -y xvfb mesa-utils libgl1-mesa-dri mesa-vulkan-drivers vulkan-tools + + # Start Xvfb and wait for it to be ready + Xvfb :99 -screen 0 1024x768x24 & + sleep 2 # Give Xvfb time to start + export DISPLAY=:99 + echo "DISPLAY=:99" >> $GITHUB_ENV + + # Verify Xvfb is running + echo "=== Verifying Xvfb startup ===" + ps aux | grep Xvfb | grep -v grep || echo "Xvfb not found in process list" + echo "DISPLAY variable: $DISPLAY" + + # Try both approaches: OpenGL software + Vulkan software + echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV # OpenGL software fallback + echo "GALLIUM_DRIVER=llvmpipe" >> $GITHUB_ENV # LLVMpipe for OpenGL + echo "VK_ICD_FILENAMES=$LAVAPIPE_ICD" >> $GITHUB_ENV # Lavapipe for Vulkan + + # Find the correct Lavapipe ICD file (for Vulkan fallback testing) + echo "=== Available Vulkan ICD files ===" + ls -la /usr/share/vulkan/icd.d/ || echo "No ICD directory found" + + LAVAPIPE_ICD=$(find /usr/share/vulkan/icd.d/ -name "*lvp*" -o -name "*lavapipe*" 2>/dev/null | head -1) + if [ -z "$LAVAPIPE_ICD" ]; then + LAVAPIPE_ICD="/usr/share/vulkan/icd.d/lvp_icd.x86_64.json" # Fallback + fi + echo "VK_ICD_FILENAMES=$LAVAPIPE_ICD" >> $GITHUB_ENV + echo "Found Lavapipe ICD: $LAVAPIPE_ICD" + + # Mesa tuning for better accuracy (potentially closer to hardware) + echo "MESA_GL_VERSION_OVERRIDE=4.6" >> $GITHUB_ENV + echo "MESA_GLSL_VERSION_OVERRIDE=460" >> $GITHUB_ENV + echo "GALLIUM_LLVM_DISABLE_UNSAFE_FP_MATH=1" >> $GITHUB_ENV # More precise floating point math + echo "MESA_NO_DITHER=1" >> $GITHUB_ENV # Disable dithering + echo "LP_NUM_THREADS=1" >> $GITHUB_ENV # Single-threaded for determinism + + # Test all available software renderers for comparison + echo "=== Testing LLVMpipe (Original) ===" + DISPLAY=:99 LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=llvmpipe glxinfo | grep -E "(OpenGL version|OpenGL renderer)" || echo "LLVMpipe test failed" + + echo "=== Testing Tuned LLVMpipe ===" + DISPLAY=:99 LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=llvmpipe MESA_GL_VERSION_OVERRIDE=4.6 MESA_GLSL_VERSION_OVERRIDE=460 GALLIUM_LLVM_DISABLE_UNSAFE_FP_MATH=1 glxinfo | grep -E "(OpenGL version|OpenGL renderer)" || echo "Tuned LLVMpipe test failed" + + echo "=== Testing Vulkan/Lavapipe availability ===" + DISPLAY=:99 VK_ICD_FILENAMES="$LAVAPIPE_ICD" vulkaninfo --summary 2>/dev/null | grep -E "(deviceName|driverName)" || echo "Vulkan Lavapipe test failed" + + echo "=== Testing Zink + Lavapipe (OpenGL-on-Vulkan fallback) ===" + DISPLAY=:99 LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=zink VK_ICD_FILENAMES="$LAVAPIPE_ICD" glxinfo | grep -E "(OpenGL version|OpenGL renderer)" || echo "Zink+Lavapipe test failed" + - name: Install required dependencies (MacOS only) if: runner.os == 'macOS' run: brew install mono @@ -50,13 +106,87 @@ jobs: - name: Build run: cmake --build --preset ${{ inputs.build_type }} - # Unit tests still failing using pixar USD. - # - name: Test - # run: ctest --preset ${{ inputs.build_type }} + - name: Test + if: runner.os == 'Linux' + run: | + echo "=== Debug: Environment variables before test ===" + echo "DISPLAY: $DISPLAY" + echo "LIBGL_ALWAYS_SOFTWARE: $LIBGL_ALWAYS_SOFTWARE" + echo "GALLIUM_DRIVER: $GALLIUM_DRIVER" + echo "MESA_GL_VERSION_OVERRIDE: $MESA_GL_VERSION_OVERRIDE" + + echo "=== Verifying Xvfb is still running ===" + ps aux | grep Xvfb | grep -v grep || echo "Xvfb not running!" + netstat -ln | grep :6099 || echo "X11 port not listening" + + echo "=== Testing GLX setup before running actual tests ===" + glxinfo | head -10 || echo "glxinfo failed" + + echo "=== Detailed GLX configuration ===" + glxinfo -B || echo "glxinfo -B failed" + + echo "=== Testing Vulkan + Lavapipe directly ===" + vulkaninfo --summary | head -10 || echo "Vulkan test failed" + + echo "=== Note: HVT Vulkan tests disabled by default (would require rebuild) ===" + echo "Current test will use OpenGL + LLVMpipe software rendering" + + echo "=== Running ctest with explicit environment ===" + ctest --preset ${{ inputs.build_type }} --output-on-failure + env: + DISPLAY: :99 + LIBGL_ALWAYS_SOFTWARE: 1 + GALLIUM_DRIVER: llvmpipe + + MESA_GL_VERSION_OVERRIDE: 4.6 + MESA_GLSL_VERSION_OVERRIDE: 460 + GALLIUM_LLVM_DISABLE_UNSAFE_FP_MATH: 1 + MESA_NO_DITHER: 1 + LP_NUM_THREADS: 1 + + - name: Debug Test Output Files + if: runner.os == 'Linux' && always() + run: | + echo "=== Test output directory structure ===" + find build/${{ inputs.build_type }}/ -name "*.png" -type f 2>/dev/null | head -20 || echo "No PNG files found in build dir" + echo "=== Test source baseline structure ===" + find test/ -name "*.png" -type f 2>/dev/null | head -20 || echo "No PNG files found in test dir" + echo "=== Current environment ===" + echo "GALLIUM_DRIVER: $GALLIUM_DRIVER" # Should show "llvmpipe" + echo "VK_ICD_FILENAMES: $VK_ICD_FILENAMES" # Should show lavapipe path (for fallback) + echo "LIBGL_ALWAYS_SOFTWARE: $LIBGL_ALWAYS_SOFTWARE" + echo "MESA_GL_VERSION_OVERRIDE: $MESA_GL_VERSION_OVERRIDE" + echo "MESA_GLSL_VERSION_OVERRIDE: $MESA_GLSL_VERSION_OVERRIDE" + echo "GALLIUM_LLVM_DISABLE_UNSAFE_FP_MATH: $GALLIUM_LLVM_DISABLE_UNSAFE_FP_MATH" + echo "MESA_NO_DITHER: $MESA_NO_DITHER" + echo "LP_NUM_THREADS: $LP_NUM_THREADS" + + - name: Upload Generated Test Images + if: runner.os == 'Linux' && always() + uses: actions/upload-artifact@v4 + with: + name: test-images-llvmpipe-tuned-${{ inputs.build_type }} + path: | + build/${{ inputs.build_type }}/test/**/generated_*.png + build/${{ inputs.build_type }}/test/**/*_computed.png + build/${{ inputs.build_type }}/test/**/*_output.png + if-no-files-found: warn + + - name: Upload Baseline Images for Comparison + if: runner.os == 'Linux' && always() + uses: actions/upload-artifact@v4 + with: + name: baseline-images-${{ inputs.build_type }} + path: | + test/**/baseline_*.png + test/**/*_linux.png + test/**/*_osx.png + test/**/baselines/**/*.png + if-no-files-found: warn - name: Upload vcpkg failure logs if: failure() uses: actions/upload-artifact@v4 with: - name: vcpkg-build-logs + name: vcpkg-build-logs-${{ runner.os }}-${{ inputs.build_type }} path: externals/vcpkg/buildtrees \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bb04d0..3eb7b5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,15 @@ string(COMPARE EQUAL "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" _HVT_PR if (_HVT_PROJECT_IS_TOP_LEVEL AND UNIX) set_if_not_defined(CMAKE_SKIP_BUILD_RPATH TRUE "") set_if_not_defined(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE "") - set_if_not_defined(CMAKE_INSTALL_RPATH "@loader_path/" "") + if(APPLE) + set_if_not_defined(CMAKE_INSTALL_RPATH "@loader_path/" "") + else() + # Linux and other Unix systems use $ORIGIN instead of @loader_path + set_if_not_defined(CMAKE_INSTALL_RPATH "$ORIGIN/" "") + # Force RPATH instead of RUNPATH on Linux for better library discovery + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--disable-new-dtags") + endif() set_if_not_defined(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE "") # macOS specific (ignored on other platforms) diff --git a/test/RenderingFramework/TestHelpers.cpp b/test/RenderingFramework/TestHelpers.cpp index 8a93d1d..58cbba7 100644 --- a/test/RenderingFramework/TestHelpers.cpp +++ b/test/RenderingFramework/TestHelpers.cpp @@ -10,6 +10,8 @@ #include +#include // For getenv + #if TARGET_OS_IPHONE #include #else @@ -102,11 +104,28 @@ std::string toCamelCase(const std::string& filename) return camelCaseFilename; } +bool isSoftwareRenderingEnabled() +{ + // Check if software rendering is enabled via environment variable + // Note: In test environment, this is safe - worst case is wrong baseline selection + // NOLINTNEXTLINE(concurrency-mt-unsafe) - Test code, single-threaded usage + const char* softwareRendering = getenv("LIBGL_ALWAYS_SOFTWARE"); + if (softwareRendering != nullptr) { + // Validate the environment variable value for safety + std::string envValue(softwareRendering); + return (envValue == "1" || envValue == "true"); + } + return false; +} + std::string HydraRendererContext::getFilename( const std::filesystem::path& filePath, const std::string& filename) { std::string fullFilepath = filePath.string() + "/" + filename; + // Use helper function to detect software rendering + bool isSoftwareRendering = isSoftwareRenderingEnabled(); + #ifdef __ANDROID__ fullFilepath += "_android"; #elif defined(__APPLE__) @@ -120,8 +139,15 @@ std::string HydraRendererContext::getFilename( } fullFilepath += "_ios"; #else + // macOS hardware GPU uses _osx baselines fullFilepath += "_osx"; #endif // TARGET_OS_IPHONE +#elif defined(__linux__) + if (isSoftwareRendering) { + // Linux software rendering (CI environment) + fullFilepath += "_linux"; + } + // Linux hardware GPU uses main baselines #endif // __ANDROID__ fullFilepath += ".png"; diff --git a/test/RenderingFramework/TestHelpers.h b/test/RenderingFramework/TestHelpers.h index 3c48971..49d30d6 100644 --- a/test/RenderingFramework/TestHelpers.h +++ b/test/RenderingFramework/TestHelpers.h @@ -92,6 +92,10 @@ std::filesystem::path const& getAssetsDataFolder(); /// Gets the path to the data directory where to find baseline images. std::filesystem::path const& getBaselineFolder(); +/// Detects if software rendering is enabled via environment variable. +/// Returns true if LIBGL_ALWAYS_SOFTWARE is set to "1" or "true". +bool isSoftwareRenderingEnabled(); + /// Base class for the OpenGL and Metal context renderers. class HydraRendererContext { diff --git a/test/data/baselines/TestFramePasses_ClearColorBuffer_linux.png b/test/data/baselines/TestFramePasses_ClearColorBuffer_linux.png new file mode 100644 index 0000000..a02a446 --- /dev/null +++ b/test/data/baselines/TestFramePasses_ClearColorBuffer_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5c4cbecda042847858f19113c96cf49525f3bc303e8581a65aa4c186c9e718c +size 20729 diff --git a/test/data/baselines/TestFramePasses_ClearDepthBuffer_linux.png b/test/data/baselines/TestFramePasses_ClearDepthBuffer_linux.png new file mode 100644 index 0000000..a368edb --- /dev/null +++ b/test/data/baselines/TestFramePasses_ClearDepthBuffer_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35c9f26a106439cb548e0fe31ecc8790db7ee7958b1ef14cc68bd88fc943fb0d +size 10643 diff --git a/test/data/baselines/TestFramePasses_MainOnly_linux.png b/test/data/baselines/TestFramePasses_MainOnly_linux.png new file mode 100644 index 0000000..6fdbd3c --- /dev/null +++ b/test/data/baselines/TestFramePasses_MainOnly_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2832e961716fb6f30bed5140d83c030344209aab3a87ae1604379716712475d8 +size 7458 diff --git a/test/data/baselines/TestFramePasses_MainWithBlur_linux.png b/test/data/baselines/TestFramePasses_MainWithBlur_linux.png new file mode 100644 index 0000000..14d37dd --- /dev/null +++ b/test/data/baselines/TestFramePasses_MainWithBlur_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2164217aff5bdf1ed9c5ead30f9ac77e1bc9590d711d6066151422b236c5a641 +size 11883 diff --git a/test/data/baselines/TestFramePasses_MainWithFxaa_linux.png b/test/data/baselines/TestFramePasses_MainWithFxaa_linux.png new file mode 100644 index 0000000..eba0338 --- /dev/null +++ b/test/data/baselines/TestFramePasses_MainWithFxaa_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d8bff79045ac8fd3bba6cce05314ef016b92683b4563ea77bbdc2e82aa4152d +size 9517 diff --git a/test/data/baselines/TestFramePasses_MultiViewportsClearDepth_linux.png b/test/data/baselines/TestFramePasses_MultiViewportsClearDepth_linux.png new file mode 100644 index 0000000..44ffb60 --- /dev/null +++ b/test/data/baselines/TestFramePasses_MultiViewportsClearDepth_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5631416582438138e8c6aea4adeaaa4a8c3ffc4c1e6fd85e1b329c2b2e766bd4 +size 9957 diff --git a/test/data/baselines/TestFramePasses_MultiViewports_linux.png b/test/data/baselines/TestFramePasses_MultiViewports_linux.png new file mode 100644 index 0000000..a02a446 --- /dev/null +++ b/test/data/baselines/TestFramePasses_MultiViewports_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5c4cbecda042847858f19113c96cf49525f3bc303e8581a65aa4c186c9e718c +size 20729 diff --git a/test/data/baselines/TestFramePasses_SceneIndex_linux.png b/test/data/baselines/TestFramePasses_SceneIndex_linux.png new file mode 100644 index 0000000..6fdbd3c --- /dev/null +++ b/test/data/baselines/TestFramePasses_SceneIndex_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2832e961716fb6f30bed5140d83c030344209aab3a87ae1604379716712475d8 +size 7458 diff --git a/test/data/baselines/TestFramePasses_TestDynamicAovInputs_linux.png b/test/data/baselines/TestFramePasses_TestDynamicAovInputs_linux.png new file mode 100644 index 0000000..a02a446 --- /dev/null +++ b/test/data/baselines/TestFramePasses_TestDynamicAovInputs_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5c4cbecda042847858f19113c96cf49525f3bc303e8581a65aa4c186c9e718c +size 20729 diff --git a/test/data/baselines/TestSearchFaces_linux.png b/test/data/baselines/TestSearchFaces_linux.png new file mode 100644 index 0000000..e5bd85e --- /dev/null +++ b/test/data/baselines/TestSearchFaces_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:229bac41869b155471e2ca2fdfc85a9e66c8f54f1e358195f43a8ca2bf236f11 +size 33003 diff --git a/test/data/baselines/TestSearchPrims_linux.png b/test/data/baselines/TestSearchPrims_linux.png new file mode 100644 index 0000000..33c6f66 --- /dev/null +++ b/test/data/baselines/TestSearchPrims_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:250fc3161f0190ceffd28f4b3ec0cd025987683cdef3bf0022cb29831c8a4e5c +size 22359 diff --git a/test/data/baselines/TestTaskManager_linux.png b/test/data/baselines/TestTaskManager_linux.png new file mode 100644 index 0000000..aecabc3 --- /dev/null +++ b/test/data/baselines/TestTaskManager_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da814be58100d00904f8e949a616458bd4cc616d7c84fdd75181467f5331a106 +size 9252 diff --git a/test/data/baselines/compose_ComposeTask2_linux.png b/test/data/baselines/compose_ComposeTask2_linux.png new file mode 100644 index 0000000..76f69bc --- /dev/null +++ b/test/data/baselines/compose_ComposeTask2_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76662d43aa10e35d36c4645aeea778134a0b0920fa7718282d21e07055745817 +size 9337 diff --git a/test/data/baselines/compose_ComposeTask3_linux.png b/test/data/baselines/compose_ComposeTask3_linux.png new file mode 100644 index 0000000..1699e87 --- /dev/null +++ b/test/data/baselines/compose_ComposeTask3_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c825ad3fa205c06c57a882d18a7998862903a4780f65265de8f8f48d058f0ee +size 8822 diff --git a/test/data/baselines/compose_ComposeTask_linux.png b/test/data/baselines/compose_ComposeTask_linux.png new file mode 100644 index 0000000..75a0e08 --- /dev/null +++ b/test/data/baselines/compose_ComposeTask_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83aae14cd76d0ce8d3b3b2edd321771ee0ab75755ea987bb7d4eedb1fbb011c7 +size 117454 diff --git a/test/data/baselines/compose_ShareTextures4_linux.png b/test/data/baselines/compose_ShareTextures4_linux.png new file mode 100644 index 0000000..d70cd1c --- /dev/null +++ b/test/data/baselines/compose_ShareTextures4_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d88a6102626f86ca489c2357a80893ad3905d5ce6918cd07def715dc91783805 +size 8662 diff --git a/test/data/baselines/compose_ShareTextures_linux.png b/test/data/baselines/compose_ShareTextures_linux.png new file mode 100644 index 0000000..6568687 --- /dev/null +++ b/test/data/baselines/compose_ShareTextures_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d13dc94b2875f4041a1cf0ee6af46dd9b5b0fdb99ef3057729102b7d080c5f5b +size 92622 diff --git a/test/data/baselines/howTo/createACustomRenderTask_linux.png b/test/data/baselines/howTo/createACustomRenderTask_linux.png new file mode 100644 index 0000000..14d37dd --- /dev/null +++ b/test/data/baselines/howTo/createACustomRenderTask_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2164217aff5bdf1ed9c5ead30f9ac77e1bc9590d711d6066151422b236c5a641 +size 11883 diff --git a/test/data/baselines/howTo/createMinimalListOfTasks_linux.png b/test/data/baselines/howTo/createMinimalListOfTasks_linux.png new file mode 100644 index 0000000..46a4e34 --- /dev/null +++ b/test/data/baselines/howTo/createMinimalListOfTasks_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15a9277bd0b64ff2424a52f6af3d779ebb238ce92095d6e3980610bdc43e8f7a +size 7683 diff --git a/test/data/baselines/howTo/createOneFramePass_linux.png b/test/data/baselines/howTo/createOneFramePass_linux.png new file mode 100644 index 0000000..6fdbd3c --- /dev/null +++ b/test/data/baselines/howTo/createOneFramePass_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2832e961716fb6f30bed5140d83c030344209aab3a87ae1604379716712475d8 +size 7458 diff --git a/test/data/baselines/howTo/useBoundingBoxSceneIndexFilter_linux.png b/test/data/baselines/howTo/useBoundingBoxSceneIndexFilter_linux.png new file mode 100644 index 0000000..d820ee3 --- /dev/null +++ b/test/data/baselines/howTo/useBoundingBoxSceneIndexFilter_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc0019a02f32251e5aec5349348bf74df17e68d313027149bbe9356c557da2e2 +size 4247 diff --git a/test/data/baselines/howTo/useCollectionToExclude_linux.png b/test/data/baselines/howTo/useCollectionToExclude_linux.png new file mode 100644 index 0000000..6fdbd3c --- /dev/null +++ b/test/data/baselines/howTo/useCollectionToExclude_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2832e961716fb6f30bed5140d83c030344209aab3a87ae1604379716712475d8 +size 7458 diff --git a/test/data/baselines/howTo/useCollectionToInclude_linux.png b/test/data/baselines/howTo/useCollectionToInclude_linux.png new file mode 100644 index 0000000..8bfc725 --- /dev/null +++ b/test/data/baselines/howTo/useCollectionToInclude_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fbea0da572eaec2ea04ddb7ccb5ddc0bd35947ea8c0bbab1b557e951031ad13 +size 4945 diff --git a/test/data/baselines/howTo/useFXAARenderTask_linux.png b/test/data/baselines/howTo/useFXAARenderTask_linux.png new file mode 100644 index 0000000..eba0338 --- /dev/null +++ b/test/data/baselines/howTo/useFXAARenderTask_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d8bff79045ac8fd3bba6cce05314ef016b92683b4563ea77bbdc2e82aa4152d +size 9517 diff --git a/test/data/baselines/howTo/useSSAORenderTask_linux.png b/test/data/baselines/howTo/useSSAORenderTask_linux.png new file mode 100644 index 0000000..5fe56ae --- /dev/null +++ b/test/data/baselines/howTo/useSSAORenderTask_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3844142c747ccb9fcbc939d1bf722acc2a43ead3c94a12e476a471efa79816cb +size 4278 diff --git a/test/data/baselines/howTo/useSkyDomeTask_linux.png b/test/data/baselines/howTo/useSkyDomeTask_linux.png new file mode 100644 index 0000000..abe92e5 --- /dev/null +++ b/test/data/baselines/howTo/useSkyDomeTask_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4252d4623714761b27358c7634cee76605c1ac01093ad4db40b69b88bd8530f5 +size 65077 diff --git a/test/data/baselines/howTo/useWireFrameCollectionRepr_linux.png b/test/data/baselines/howTo/useWireFrameCollectionRepr_linux.png new file mode 100644 index 0000000..bc986f3 --- /dev/null +++ b/test/data/baselines/howTo/useWireFrameCollectionRepr_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e7c4d14ee04064cb7b5c549d628fd08f0dc7d6642793403a333abf7cf2aee11 +size 9936 diff --git a/test/data/baselines/howTo/useWireFrameSceneIndex_linux.png b/test/data/baselines/howTo/useWireFrameSceneIndex_linux.png new file mode 100644 index 0000000..4792fb3 --- /dev/null +++ b/test/data/baselines/howTo/useWireFrameSceneIndex_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b409e7da79d8c29166989e4ff119ecf2bec1c5ef257531024917bbe9dbdd7e19 +size 12009 diff --git a/test/data/baselines/testDynamicCameraAndLights_linux.png b/test/data/baselines/testDynamicCameraAndLights_linux.png new file mode 100644 index 0000000..97f37ff --- /dev/null +++ b/test/data/baselines/testDynamicCameraAndLights_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8c2b2b99128d7be4b8b85f11695c23ee04dbe2f522bddf87f254b9c73614de5 +size 10443 diff --git a/test/data/baselines/testDynamicResolution_linux.png b/test/data/baselines/testDynamicResolution_linux.png new file mode 100644 index 0000000..46a4e34 --- /dev/null +++ b/test/data/baselines/testDynamicResolution_linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15a9277bd0b64ff2424a52f6af3d779ebb238ce92095d6e3980610bdc43e8f7a +size 7683 diff --git a/test/tests/testSearches.cpp b/test/tests/testSearches.cpp index a6b078a..53e5e4b 100644 --- a/test/tests/testSearches.cpp +++ b/test/tests/testSearches.cpp @@ -16,6 +16,8 @@ #include "TargetConditionals.h" #endif +#include + #include PXR_NAMESPACE_USING_DIRECTIVE @@ -314,30 +316,41 @@ TEST(TestViewportToolbox, TestSearchEdges) ASSERT_EQ(primState->pointIndices.size(), 0); ASSERT_EQ(primState->pointColorIndices.size(), 0); + // Use helper function to detect software rendering + bool isSoftwareRendering = TestHelpers::isSoftwareRenderingEnabled(); + static const std::vector results #if defined(_WIN32) || defined(__linux__) - { { 0, 3, 21, 60, 69, 75, 84, 93, 102, 105, 108, 109, 110, 111, 112, 113, 114, 117, 123, - 135, 141, 153, 159, 162, 165, 171, 177, 183, 189, 195, 207, 213, 216, 219, 225, 228, - 231, 237, 243, 249, 261, 264, 267, 276, 321, 327, 328, 329, 333, 561, 570, 573, 618, - 619, 620, 621, 624, 627, 628, 630, 633, 637, 639, 642, 646, 648, 651, 654, 655, 657, - 660, 663, 747, 749, 768, 769, 770, 771, 774, 780, 783, 786, 787, 788, 789, 792, 795, - 796, 797, 799, 800, 801, 804, 807, 808, 810, 826, 940, 945, 948, 951, 1461, 1590, 1599, - 1626, 1656, 1659, 1665, 1692, 1725, 1761, 1791, 1890, 1926, 1977, 1983, 1992, 2022, - 2049, 2070, 4089, 4173, 4701, 4702, 4704, 4719, 4725, 4728, 4734, 4743, 4749, 4755, - 4764, 4767, 4773, 4782, 4785, 4788, 4791, 4794, 4800, 4803, 4956, 5898, 5955, 5970, - 5976, 5991, 6003, 6006, 6012, 6018, 6036, 6045 } }; + = isSoftwareRendering ? + // Software rendering results (Linux CI) + std::vector{ { 102, 105, 108, 109, 110, 111, 112, 113, 114, 117, 615, 618, 619, 620, 621, 624, 627, + 628, 630, 633, 636, 637, 639, 642, 645, 646, 648, 651, 654, 655, 657, 660, 666, 768, + 769, 770, 771, 774, 777, 778, 780, 783, 786, 787, 789, 792, 795, 796, 798, 799, 801, + 804, 807, 808, 810 } } : + // Windows and Linux hardware results (shared) + std::vector{ { 0, 3, 21, 60, 69, 75, 84, 93, 102, 105, 108, 109, 110, 111, 112, 113, 114, 117, 123, + 135, 141, 153, 159, 162, 165, 171, 177, 183, 189, 195, 207, 213, 216, 219, 225, 228, + 231, 237, 243, 249, 261, 264, 267, 276, 321, 327, 328, 329, 333, 561, 570, 573, 618, + 619, 620, 621, 624, 627, 628, 630, 633, 637, 639, 642, 646, 648, 651, 654, 655, 657, + 660, 663, 747, 749, 768, 769, 770, 771, 774, 780, 783, 786, 787, 788, 789, 792, 795, + 796, 797, 799, 800, 801, 804, 807, 808, 810, 826, 940, 945, 948, 951, 1461, 1590, 1599, + 1626, 1656, 1659, 1665, 1692, 1725, 1761, 1791, 1890, 1926, 1977, 1983, 1992, 2022, + 2049, 2070, 4089, 4173, 4701, 4702, 4704, 4719, 4725, 4728, 4734, 4743, 4749, 4755, + 4764, 4767, 4773, 4782, 4785, 4788, 4791, 4794, 4800, 4803, 4956, 5898, 5955, 5970, + 5976, 5991, 6003, 6006, 6012, 6018, 6036, 6045 } }; #elif PXR_VERSION <= 2505 && __APPLE__ { { 102, 105, 108, 109, 110, 111, 112, 113, 114, 117, 159, 243, 618, 619, 620, 621, 624, 627, 628, 630, 633, 636, 637, 639, 642, 646, 648, 651, 655, 657, 660, 768, 769, 770, 771, 774, 777, 778, 780, 783, 786, 787, 789, 792, 795, 796, 798, 799, 801, 804, 807, 808, 810 } }; -#else +#else // Newer Apple { { 102, 105, 108, 109, 110, 111, 112, 113, 114, 117, 159, 243, 615, 618, 619, 620, 621, 624, 627, 628, 630, 633, 636, 637, 639, 642, 645, 646, 648, 651, 654, 655, 657, 660, 666, 768, 769, 770, 771, 774, 777, 778, 780, 783, 786, 787, 789, 792, 795, 796, 798, 799, 801, 804, 807, 808, 810 } }; #endif _PrintData("Edges: ", primState->edgeIndices); + ASSERT_TRUE(primState->edgeIndices == results); // Validates the rendering result. @@ -412,18 +425,28 @@ TEST(TestViewportToolbox, TestSearchPoints) ASSERT_EQ(primState->pointIndices.size(), 1); // Found one list of points. ASSERT_EQ(primState->pointColorIndices.size(), 1); + // Use helper function to detect software rendering + bool isSoftwareRendering = TestHelpers::isSoftwareRenderingEnabled(); + static const std::vector results #if defined(_WIN32) || defined(__linux__) - { { 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 244, 245, 247, 272, 273, 274, 290, 336, - 872, 1129, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, - 1168, 1169 } }; + = isSoftwareRendering ? + // Software rendering results (Linux CI) + std::vector{ { 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 244, 245, 273, 274, 290, 336, 872, 1129, + 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, + 1169, 1171 } } : + // Windows and Linux hardware results (shared) + std::vector{ { 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 244, 245, 247, 272, 273, 274, 290, 336, + 872, 1129, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, + 1168, 1169 } }; #elif PXR_VERSION <= 2505 && __APPLE__ { { 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 244, 245, 247, 272, 273, 274, 290, 336, 872, 1129, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169 } }; -#else +#else // Newer Apple { { 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 244, 245, 273, 274, 290, 336, 872, 1129, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, @@ -431,6 +454,7 @@ TEST(TestViewportToolbox, TestSearchPoints) #endif _PrintData("Points: ", primState->pointIndices); + ASSERT_TRUE(primState->pointIndices == results); // Validates the rendering result.