What's new in Graphics Test Framework version 9.0
Discover new features and performance improvements in the latest update to Graphics Test Framework.
For more information, refer to the changelog.
New Graphics Tests window
The new Graphics Tests window lets you check test results, compare images in a split window, apply heatmap overlays, manage reference images, and check logs. For more information, refer to Graphics Tests window reference.
New platform API
The new GraphicsTestPlatform API represents a combination of platform characteristics, such as runtime platform, color space, graphics API, GPU manufacturer, and XR device. You can use it to compare platform objects and configure the hierarchy of image folders in the Project view. For more information, refer to Test specific platforms and Graphics Test Build Settings Inspector window reference.
New asset for configuring settings
The new Graphics Test Build Settings asset configures the build process. For more information, refer to Customizing and optimizing tests.
New attribute for ignoring tests
The [IgnoreGraphicsTest] attribute replaces Test Filter assets. The new attribute supports regex matching, platform enumeration filtering, inclusive and exclusive modes, and command-line override with -override-graphics-test-ignores. For more information, refer to Test specific platforms.
[IgnoreGraphicsTest] supports filtering by RenderingThreadingMode.
New image comparison algorithms
You can now select different built-in algorithms, include the DeltaE algorithm, peak signal-to-noise ratio (PSNR), and structural similarity index measure (SSIM). Use Assert.That(actual, IsTexture.EqualTo(expected).Using(algorithm)) to select an algorithm. For more information, refer to Customize tests.
Test shaders
You can now create unit tests for ShaderLab assets and HLSL shader methods. Load a shader, execute a function, and assert on the C# return value. The framework automatically generates wrapper shaders for HLSL methods. For more information, refer to Write a shader test.
Get a copy of the camera view or the back buffer
You can now use the ImageCapture API to capture images with bilinear resizing and save them to disk. For more information, refer to Write a scene test.
Improvements to testing APIs
You can now:
- Use the
ImageAssert.AreEqualAPI to return results. - Store multiple variants of reference images with the
AdditionalReferenceImagesproperty ofGraphicsTestCase. - Parameterize tests with inline values or external data using the
[GraphicsTestParam]and[GraphicsTestParamSource]attributes. For more information, refer to Customize a test. - Test for compute shader functionality in the
GraphicsDeviceInfoAPI. For more information, refer to Test specific platforms.
Performance improvements
This version includes the following performance improvements:
- The framework caches test cache data and reduces redundant calculations when it discovers tests in your project, which significantly improves performance.
- The build workflow now supports grouped scene lists, and improves platform and test case extraction, and asset and image handling. The framework adds transition scenes to each build to avoid state leaking between tests.
- Deduplicating reference images is now more efficient. For more information, refer to Deduplicate reference images.
- The framework is faster at stripping shader variants. For more information, refer to Strip shader variants from test builds.
- The framework now loads reference images from platform-specific paths in order of specificity, starting with the most specific. The load message also includes the AssetBundle path for debugging.
ImageAssertfailure messages now include the root mean square error (RMSE) value.