Bug fixes: - D3D12Shader::Compile: Set m_type based on target string (cs_/vs_/ps_/gs_) - OpenGLShader::Compile: Parse target parameter to determine shader type - OpenGLShader::CompileCompute: Set m_type = ShaderType::Compute - D3D12CommandList::SetPipelineState: Use correct PSO handle for Compute New tests (test_compute.cpp, 8 tests): - ComputeShader_Compile_ValidShader - ComputeShader_GetType_ReturnsCompute - ComputeShader_Shutdown_Invalidates - PipelineState_SetComputeShader - PipelineState_HasComputeShader_ReturnsTrue - PipelineState_GetType_Compute - PipelineState_EnsureValid_Compute - CommandList_Dispatch_Basic Test results: 232/232 passed (D3D12: 116, OpenGL: 116)
49 lines
1.1 KiB
CMake
49 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
|
|
get_filename_component(PROJECT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../.. ABSOLUTE)
|
|
|
|
find_package(GTest REQUIRED)
|
|
|
|
set(TEST_SOURCES
|
|
fixtures/RHITestFixture.cpp
|
|
test_device.cpp
|
|
test_buffer.cpp
|
|
test_texture.cpp
|
|
test_swap_chain.cpp
|
|
test_command_list.cpp
|
|
test_command_queue.cpp
|
|
test_shader.cpp
|
|
test_pipeline_state.cpp
|
|
test_render_pass.cpp
|
|
test_framebuffer.cpp
|
|
test_fence.cpp
|
|
test_sampler.cpp
|
|
test_descriptor.cpp
|
|
test_compute.cpp
|
|
${CMAKE_SOURCE_DIR}/tests/opengl/package/src/glad.c
|
|
)
|
|
|
|
add_executable(rhi_unit_tests ${TEST_SOURCES})
|
|
|
|
target_compile_definitions(rhi_unit_tests PRIVATE XCENGINE_SUPPORT_OPENGL)
|
|
|
|
target_link_libraries(rhi_unit_tests PRIVATE
|
|
d3d12
|
|
dxgi
|
|
d3dcompiler
|
|
opengl32
|
|
XCEngine
|
|
GTest::gtest
|
|
GTest::gtest_main
|
|
)
|
|
|
|
target_include_directories(rhi_unit_tests PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/fixtures
|
|
${PROJECT_ROOT_DIR}/engine/include
|
|
${PROJECT_ROOT_DIR}/engine/src
|
|
${CMAKE_SOURCE_DIR}/tests/opengl/package/include/
|
|
)
|
|
|
|
include(GoogleTest)
|
|
gtest_discover_tests(rhi_unit_tests)
|