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
254f794cdc
feat(RHI): add rendering state abstraction to RHICommandList
...
- Add DepthStencilState and BlendState structs to RHICommandList
- Add SetPrimitiveTopology, SetDepthStencilState, SetStencilRef,
SetBlendState, SetBlendFactor virtual methods
- Implement new methods in OpenGL backend with full state control
- Implement stub methods in D3D12 backend (states controlled via PSO)
2026-03-17 23:17:43 +08:00
0b50a57239
test(Resources): Add ResourceCache tests (8 test cases)
2026-03-17 23:07:33 +08:00
6ca1487279
test(Resources): Add ResourceHandle tests (11 test cases)
2026-03-17 22:52:30 +08:00
0e31cd804b
test(Resources): Add IResource tests (3 test cases)
2026-03-17 22:50:21 +08:00
417477c2ca
feat: Implement resource system Phase 4.5 - ResourceFileSystem (4 files, +305 lines)
2026-03-17 22:43:59 +08:00
967c64faf8
docs: update README with RHI abstraction layer documentation
2026-03-17 22:39:59 +08:00
4710e6ba60
feat: Implement resource system Phase 2 - Concrete resource types
...
- Add Material class with shader/texture bindings and property system
- Add MaterialLoader for .mat/.json format
- Add Shader class (Vertex/Fragment/Geometry/Compute)
- Add ShaderLoader for .vert/.frag/.glsl/.hlsl
- Add AudioClip class (WAV/OGG/MP3/FLAC support)
- Add AudioLoader for audio files
- Add Texture/Mesh classes and loaders (from design doc)
- Fix HashMap iterator and String API usage
- Fix Mutex compatibility with std::lock_guard
- Update CMakeLists.txt with new resource files
- All tests pass: 11 Resources + 51 Containers
2026-03-17 22:32:27 +08:00
05c879a818
fix(OpenGL): 修复 RHIDeviceInfo majorVersion/minorVersion 为0的问题
2026-03-17 19:44:50 +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
94bf04f06c
feat(Resources): 添加资源系统基础框架
...
- ResourceTypes: 资源类型枚举、ResourceGUID生成
- IResource: 资源基类接口
- ResourceHandle: 资源句柄智能指针
- IResourceLoader: 加载器接口
- ResourceManager: 资源管理器(单例模式)
- ResourceCache: LRU缓存实现
- AsyncLoader: 异步加载器
- 测试框架: test_resource_types, test_resource_guid
Note: 当前与现有容器API存在编译差异,需要后续修复
2026-03-17 19:38:27 +08:00
e138fb2075
fix(RHI): 修复 OpenGL/D3D12 后端编译问题
...
- 修复 OpenGLCommandList 方法签名匹配 RHI 抽象接口
- 修复 OpenGLSwapChain Present/Resize 方法签名
- 添加 OpenGL 特有方法重载支持后端测试(底层逃逸)
- 暂时禁用不兼容的 Resources 模块
- 更新 OpenGL 测试 CMakeLists
2026-03-17 19:35:51 +08:00
a257ff2d8b
fix(RHI): 修复抽象基类编译问题
2026-03-17 18:24:08 +08:00
20445999fc
feat(RHI): 实现 RHIPipelineState 抽象基类
2026-03-17 18:09:34 +08:00
354b6a5cfc
feat(RHI): 实现 RHISwapChain 抽象基类
2026-03-17 18:05:40 +08:00
55865a0252
feat(RHI): 实现 RHICommandList 抽象基类
2026-03-17 18:01:55 +08:00
4638539f17
feat(RHI): 实现 RHICommandQueue 抽象基类
2026-03-17 17:54:44 +08:00
14fb51e61e
feat(RHI): 实现 RHIDevice 抽象基类
2026-03-17 17:45:01 +08:00
af718279ff
feat(RHI): 实现 RHIFence 抽象基类
...
- 新增 RHIFence 抽象基类
- D3D12Fence 继承 RHIFence
- OpenGLFence 继承 RHIFence
- 文档更新 RHIFence 差异处理策略
2026-03-17 17:36:17 +08:00
f046e17ad6
feat(RHI): 实现 RHISampler 抽象基类
...
- 新增 RHISampler 抽象基类
- D3D12Sampler 继承 RHISampler
- OpenGLSampler 继承 RHISampler,使用 OpenGLSamplerDesc
- 文档更新 RHISampler 差异处理策略
2026-03-17 17:31:32 +08:00
e38d5ccede
feat(RHI): 实现 RHIBuffer, RHITexture, RHIShader 抽象基类
...
- 新增 RHIBuffer, RHITexture, RHIShader 抽象基类
- D3D12Buffer/Texture/Shader 继承抽象基类
- OpenGLBuffer/Texture/Shader 继承抽象基类
- 添加 RHICapabilities, RHIDevice 头文件
- RHIEnums 添加 Fragment/TessControl/TessEvaluation
- 文档更新差异处理策略
2026-03-17 17:26:41 +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
f5031c89d4
Add OpenGL backend test design document
...
- Complete test design for 12 OpenGL components
- Test fixture design with GLFW context management
- GL error checking utilities and macros
- Detailed test case tables for each component
- CMake build configuration
- CI integration (GitHub Actions)
- Test resource file structure
- Cross-platform considerations
- Implementation priorities (5 phases)
2026-03-17 04:15:44 +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
dae540e97a
docs: 更新 D3D12 测试设计文档,标记已完成项
2026-03-17 03:30:19 +08:00
8c6516183e
test: 添加 D3D12 引擎测试框架
...
- 修复 engine/CMakeLists.txt 路径问题
- 在 tests/D3D12_engine/test/ 创建测试框架
- 添加基础测试夹具 D3D12TestFixture
- 添加 13 个基础测试用例
- 所有测试通过
2026-03-17 03:29:39 +08:00
d1c7c23527
test: 添加 D3D12 测试框架基础设施
...
- 创建 engine/src/RHI/D3D12/test/ 目录
- 添加 CMakeLists.txt 构建配置
- 添加基础测试夹具 D3D12TestFixture.h
- 添加各组件测试文件框架
- 更新 tests/CMakeLists.txt 集成新测试
2026-03-17 02:51:34 +08:00
05c4dfb5eb
docs: 完善 D3D12 测试设计文档,添加构建计划
2026-03-17 02:49:20 +08:00
5683b10e65
Rename RHI header files for clarity
...
- Rename Enums.h to RHIEnums.h
- Rename Types.h to RHITypes.h
- Update all include references in D3D12 headers and test files
2026-03-17 02:39:22 +08:00
2342e3fbfc
docs: 添加 D3D12 后端测试设计文档
2026-03-17 02:32:52 +08:00
0418c61db6
Enhance OpenGLShader with comprehensive shader support
2026-03-17 02:27:13 +08:00
d75780f8c4
Enhance OpenGLSwapChain with presentation control
...
- Add PresentMode enum (Immediate, VSync, Mailbox, Fifo)
- Add SurfaceFormat enum for color formats
- Add Initialize() overloads with vsync, width/height, PresentMode
- Add Resize(), SetVSync() for runtime control
- Add GetWidth/Height/FramebufferWidth/FramebufferHeight
- Add ShouldClose, SetShouldClose, PollEvents for window management
- Implement using GLFW for window/swap control
2026-03-17 02:25:18 +08:00
be72e2f4a7
Enhance OpenGL RTV and DSV with comprehensive framebuffer support
...
OpenGLRenderTargetView:
- Add RenderTargetType enum for different texture types
- Add RenderTargetViewDesc struct with mip level, array slice, layer info
- Add Initialize() with desc parameter for 2D/2DArray/3D/Cube
- Add InitializeCubemap() for cubemap faces
- Add Bind(count) overload for multiple framebuffers
- Add Clear() methods for color and depth-stencil
- Add static BindFramebuffer/UnbindFramebuffer methods
OpenGLDepthStencilView:
- Add DepthStencilType enum for different texture types
- Add DepthStencilViewDesc struct with mip level, array slice, layer info
- Add Initialize() with desc parameter for 2D/2DArray/Cube
- Add InitializeCubemap() for cubemap faces
- Add ClearDepth, ClearStencil, ClearDepthStencil methods
- Add static BindFramebuffer/UnbindFramebuffer methods
2026-03-17 02:20:56 +08:00
6126404e3f
Enhance OpenGLFence with proper synchronization
...
- Add FenceStatus enum for status query
- Add m_sync (GLsync) for OpenGL fence synchronization
- Add Signal(value) overload with fence value
- Add Wait(timeoutNs) with timeout support
- Add GetStatus() for async status check
- Add GetCompletedValue() and GetCurrentValue()
- Implement using glSync for proper GPU synchronization
- Replace glFinish blocking with glClientWaitSync
2026-03-17 02:17:41 +08:00
1de66b835d
Enhance OpenGLPipelineState with comprehensive state management
...
- Add BlendOp enum for blend operations
- Add PolygonMode enum for polygon rendering mode
- Add StencilOp enum for stencil operations
- Add ScissorState and LogicalOperation structs
- Add DepthStencilState: stencil enable, read/write mask, stencil ref, stencil func, stencil ops
- Add BlendState: blend equation, color write mask, blend factor
- Add RasterizerState: polygon mode, polygon offset, depth clip, scissor test, multisample
- Add ViewportState: float coordinates with min/max depth
- Add Apply methods for individual state groups
- Add AttachShader/DetachShader for program management
- Add getter methods for state structs
2026-03-17 02:15:48 +08:00
413f4c178f
Enhance OpenGLCommandList with comprehensive rendering API
...
- Add ClearFlags, ClearColor, ClearDepth, ClearStencil, ClearDepthStencil
- Add SetVertexBuffers (multiple buffers)
- Add SetIndexBuffer with offset
- Add BindVertexArray with index buffer
- Add SetViewport with depth range, SetViewports
- Add SetScissor, SetScissorRects, EnableScissorTest
- Add depth test/write/func methods
- Add stencil test methods
- Add blending methods (enable, blend func, equation, color)
- Add culling methods (enable, cull face, front face, polygon mode)
- Add instanced drawing (DrawInstanced, DrawIndexedInstanced)
- Add indirect drawing (DrawIndirect, DrawIndexedIndirect)
- Add MultiDrawArrays, MultiDrawElements
- Add Dispatch and Compute Shader support
- Add MemoryBarrier and TextureBarrier
- Add texture/sampler binding methods
- Add buffer binding (BindBufferBase, BindBufferRange)
- Add Enable/Disable for OpenGL caps
- Add uniform setting methods
- Add query methods
- Add ReadPixels, BlitFramebuffer, CopyImageSubData
- Add framebuffer invalidation
- Add debug group push/pop
2026-03-17 02:13:02 +08:00
a54666df11
Enhance OpenGLTexture with more texture types
...
- Add OpenGLTextureType enum (1D, 2D, 2DArray, 3D, Cube, CubeArray)
- Add OpenGLFormat enum for texture formats
- Add Initialize() method for generic texture creation
- Add InitializeCubeMap() for cubemap textures
- Add BindImage() for image load/store
- Add GenerateMipmap(), SetFiltering(), SetWrapping() methods
- Add GetType(), GetMipLevels(), GetDepth() getters
2026-03-17 02:10:53 +08:00
56c32bfbde
Enhance OpenGLBuffer with more buffer types and features
...
- Add OpenGLBufferType enum (Vertex, Index, Uniform, CopyRead, CopyWrite, etc.)
- Add Initialize() method with buffer type parameter
- Add Map/Unmap for direct buffer access
- Add SetData for dynamic updates
- Add BindBase for buffer binding to indexed targets
- Add GetType and IsDynamic getters
2026-03-17 02:08:49 +08:00
4c9c03e1a7
Refactor: use engine enums for resource states and heap types
2026-03-17 01:38:57 +08:00