70571316da
feat(RHI): 添加 RHIFactory 工厂类
...
- 新增 RHIFactory 头文件和实现,支持通过 RHIType 或字符串创建设备
- 修复 D3D12Buffer 缺失的 Map/Unmap/SetData 实现
- 添加 RHI 工厂测试用例
- 更新 CMakeLists.txt 添加新文件
2026-03-18 01:33:15 +08:00
b7feca59c4
fix(test): zero-initialize state structs to avoid stack corruption
2026-03-17 23:29:31 +08:00
6fe21710e8
test(RHI): add rendering state tests for CommandList
...
- Add tests for SetPrimitiveTopology
- Add tests for SetDepthStencilState
- Add tests for SetBlendState
- Add tests for SetBlendFactor
- OpenGL tests now have 45 test cases
2026-03-17 23:25:40 +08:00
0a2f8050e5
fix(RHI): 修复 OpenGL 测试接口不匹配问题
...
- 修复 RHIDeviceInfo 缺少 majorVersion/minorVersion
- 修复 OpenGLTexture 使用 GetTextureType 替代 GetType
- 修复 OpenGLSampler 使用 OpenGLSamplerDesc
- 修复 BlendFactor::OneMinusSrcAlpha -> InvSrcAlpha
- 修复 OpenGLRenderTargetViewDesc/OpenGLDepthStencilViewDesc 重定义问题
- 恢复 OpenGL 测试文件到 CMakeLists
2026-03-17 19:43:20 +08:00
e138fb2075
fix(RHI): 修复 OpenGL/D3D12 后端编译问题
...
- 修复 OpenGLCommandList 方法签名匹配 RHI 抽象接口
- 修复 OpenGLSwapChain Present/Resize 方法签名
- 添加 OpenGL 特有方法重载支持后端测试(底层逃逸)
- 暂时禁用不兼容的 Resources 模块
- 更新 OpenGL 测试 CMakeLists
2026-03-17 19:35:51 +08:00
f2ae95e0a7
Complete OpenGL test suite - 56 tests
...
Added missing tests to reach planned 56:
- CommandList: EnableDisable_DepthTest, EnableDisable_Blending
- RTV: GetTexture, GetMipLevel
- DSV: Initialize_Texture, GetTexture, GetMipLevel
Final count: 56 tests across all 12 components
2026-03-17 12:48:17 +08:00
7bf586f6fa
Add Phase 5: SwapChain tests (3 tests)
...
- Add SwapChain tests: Initialize, Present, Resize
=== OpenGL Test Suite Complete ===
Total: 49 tests across all phases:
- Phase 1: Device, Buffer, Fence (17 tests)
- Phase 2: Texture, Sampler (9 tests)
- Phase 3: Shader, PipelineState, VertexArray (11 tests)
- Phase 4: CommandList, RTV, DSV (9 tests)
- Phase 5: SwapChain (3 tests)
2026-03-17 12:41:29 +08:00
4b14831c57
Add Phase 4: CommandList, RTV, DSV tests (13 tests)
...
- Add CommandList tests: Clear (color/depth/stencil), SetIndexBuffer, Draw (VAO), SetViewport, SetScissor
- Add RTV tests: Initialize (Texture2D), Bind/Unbind
- Add DSV tests: Bind/Unbind
- Simplify tests to work with available GL context
2026-03-17 12:40:07 +08:00
276a9c476a
Add Phase 3: Shader, PipelineState, VertexArray tests (11 tests)
...
- Add Shader tests: VertexFragment, Geometry, InvalidSource, SetUniforms
- Add PipelineState tests: DepthStencilState, BlendState, Viewport/Scissor
- Add VertexArray tests: Initialize, AddVertexBuffer, SetIndexBuffer, Bind/Unbind
2026-03-17 12:31:05 +08:00
1d181f1109
Add Phase 2: Texture and Sampler tests (9 tests)
...
- Add Texture tests: 2DTexture, CubeMap, Bind/Unbind, GenerateMipmap, SetFiltering/SetWrapping
- Add Sampler tests: Initialize (default/custom), Bind/Unbind, GetID
2026-03-17 12:27:47 +08:00
745f3ab225
Add OpenGL test infrastructure - Phase 1: Device, Buffer, Fence tests (17 tests)
...
- Create test directory structure at tests/RHI/OpenGL/
- Implement OpenGLTestFixture with GLFW/GLAD initialization
- Add Device tests: CreateRenderWindow, InitializeWithExistingWindow, GetDeviceInfo, SwapBuffers, PollEvents
- Add Buffer tests: VertexBuffer, IndexBuffer, UniformBuffer, Dynamic, Bind/Unbind, Map/Unmap
- Add Fence tests: Initialize (signaled/unsignaled), Signal, Wait, IsSignaled, GetStatus
- Add CMakeLists.txt with proper GLFW/GLAD/GTest linking
- Create implementation plan document at docs/OpenGL测试实施计划.md
2026-03-17 12:26:21 +08:00
f42a0795fb
Add D3D12 test progress report
2026-03-17 04:15:48 +08:00
19b33a3061
Add Phase 4 tests for DescriptorHeap, Shader, RootSignature, PipelineState, Views
...
- DescriptorHeap: CBV_SRV_UAV, Sampler, RTV, DSV, HandleIncrementSize
- Shader: Vertex/Pixel/Compute profiles
- RootSignature: Empty, with CBV parameter
- PipelineState: Graphics/Compute pipeline desc defaults
- Views: RTV, DSV, CBV descriptor heaps, handle increment
- All 54 tests pass
2026-03-17 04:04:57 +08:00
3f8805cde8
Add Phase 3 tests for Buffer and Texture
...
- Buffer: CreateBuffer (Default/Upload Heap), GPU Virtual Address, Map/Unmap, Alignment
- Texture: 2D, 3D, MipLevels, TextureArray
- All 38 tests pass
2026-03-17 04:02:35 +08:00
11ea2a4fc5
Fix GPU state issue - make device non-static per test
...
- Each test now creates its own D3D12 device, command queue, allocator, and command list
- Properly cleanup in TearDown to avoid GPU state issues
- All 29 tests now pass
2026-03-17 03:54:50 +08:00
0049f8334d
Add Phase 2 tests for CommandQueue, CommandAllocator, CommandList
...
- CommandAllocator: Reset, MultipleReset, DifferentTypes
- CommandList: Close, GetDesc
- CommandQueue: GetTimestampFrequency, ExecuteCommandLists
- Note: Some tests fail after ExecuteCommandLists due to GPU state
2026-03-17 03:47:51 +08:00
795cb10183
Add Phase 1 D3D12 tests for Device and Fence
...
- Implement real D3D12 tests for Device (feature level, descriptor handle,
shader model, resource binding tier, tiled resources)
- Implement real D3D12 tests for Fence (create, signal, wait, event)
- Move tests from tests/D3D12_engine/test/ to tests/RHI/D3D12/
- All 22 tests pass
2026-03-17 03:39:27 +08:00