Files
XCEngine/tests/RHI/D3D12/integration/minimal/CMakeLists.txt
ssdfasd e9f4f2dc49 Integrate RenderDoc frame capture into D3D12 minimal test
- Add SetDevice() and GetNumCaptures() methods to RenderDocCapture
- Fix initialization order: RenderDoc before D3D12, then SetDevice after
- Use nullptr for window param in StartFrameCapture/EndFrameCapture
- Add BeginCapture at frame 29, EndCapture at frame 30
- Set capture file path template to .\minimal_frame30
- Copy renderdoc.dll (26MB redistributable) to test output
- Engine/third_party/renderdoc/ now contains working renderdoc.dll
2026-03-23 17:47:43 +08:00

55 lines
1.5 KiB
CMake

cmake_minimum_required(VERSION 3.15)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
project(D3D12_Minimal)
set(ENGINE_ROOT_DIR ${CMAKE_SOURCE_DIR}/engine)
add_executable(D3D12_Minimal
WIN32
main.cpp
)
target_include_directories(D3D12_Minimal PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${ENGINE_ROOT_DIR}/include
)
target_compile_definitions(D3D12_Minimal PRIVATE
UNICODE
_UNICODE
)
target_link_libraries(D3D12_Minimal PRIVATE
d3d12
dxgi
d3dcompiler
winmm
XCEngine
)
add_custom_command(TARGET D3D12_Minimal POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/tests/rhi/d3d12/integration/compare_ppm.py
$<TARGET_FILE_DIR:D3D12_Minimal>/
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/tests/rhi/d3d12/integration/run_integration_test.py
$<TARGET_FILE_DIR:D3D12_Minimal>/
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/GT.ppm
$<TARGET_FILE_DIR:D3D12_Minimal>/
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ENGINE_ROOT_DIR}/third_party/renderdoc/renderdoc.dll
$<TARGET_FILE_DIR:D3D12_Minimal>/
)
add_test(NAME D3D12_Minimal_Integration
COMMAND ${Python3_EXECUTABLE} $<TARGET_FILE_DIR:D3D12_Minimal>/run_integration_test.py
$<TARGET_FILE:D3D12_Minimal>
minimal.ppm
${CMAKE_CURRENT_SOURCE_DIR}/GT.ppm
0
WORKING_DIRECTORY $<TARGET_FILE_DIR:D3D12_Minimal>
)