Files
XCEngine/tests/RHI/integration/README.md

65 lines
1.9 KiB
Markdown

# RHI Integration Tests
This directory contains backend-agnostic integration tests for the RHI abstraction layer.
Current goals:
- Verify that the same RHI scene code runs on `D3D12`, `OpenGL`, and `Vulkan`
- Verify real rendering output, not just object creation
- Catch abstraction regressions through golden-image comparison
## Current scenes
- `minimal`: clear, present, screenshot, GT compare
- `triangle`: minimal graphics pipeline and vertex input
- `quad`: textured quad rendering
- `sphere`: textured sphere and descriptor-set path with `firstSet != 0`
- `backpack`: real OBJ model rendering through the RHI abstraction
## Golden image rule
Each scene directory keeps exactly one baseline image:
```text
GT.ppm
```
Runtime screenshots are backend-specific:
- `<scene>_d3d12.ppm`
- `<scene>_opengl.ppm`
- `<scene>_vulkan.ppm`
All backends must compare against the same `GT.ppm`.
## Build
Build all abstraction-layer integration tests:
```bash
cmake --build build --config Debug --target rhi_abstraction_integration_tests
```
Build a single scene:
```bash
cmake --build build --config Debug --target rhi_integration_backpack
```
## Run
Examples:
```bash
build\tests\RHI\integration\minimal\Debug\rhi_integration_minimal.exe --gtest_filter=Vulkan/MinimalTest.RenderClear/0
build\tests\RHI\integration\triangle\Debug\rhi_integration_triangle.exe --gtest_filter=D3D12/TriangleTest.RenderTriangle/0
build\tests\RHI\integration\quad\Debug\rhi_integration_quad.exe --gtest_filter=OpenGL/QuadTest.RenderQuad/0
build\tests\RHI\integration\backpack\Debug\rhi_integration_backpack.exe --gtest_filter=Vulkan/BackpackTest.RenderBackpack/0
```
## Rules
- Integration tests in this directory may only depend on public RHI interfaces and shared fixtures.
- If a new scene exposes an abstraction problem, fix the RHI first, then extend the test.
- Do not split golden images by backend unless the abstraction contract itself changes.