1213 Commits

Author SHA1 Message Date
de4086dbfe docs: Fix core module documentation discrepancies
Fixed the following issues in XCEngine Core module documentation:
- Added 'using namespace XCEngine::Core;' to all code examples that use
  Core types (Event, FileWriter, etc.) without full namespace qualification
- Added missing '#include <XCEngine/Containers/String.h>' to FileWriter
  examples that use Containers::String
- Added '#include <string>' to Flush.md example using std::to_string

Affected files:
- core/core.md: Added using directive and Containers include
- event/*.md: Added using namespace to all 8 event doc files
- filewriter/*.md: Added using namespace and proper includes to all 6 files
2026-03-19 01:04:30 +08:00
3ac93ba2e8 Fix containers documentation discrepancies
- Remove Size() from String docs (does not exist in source, use Length())
- Remove broken links to operator+ and operator==/!= (inline functions)
- Fix string.md to correctly reference Length/Capacity/Empty instead of Size
- Add proper documentation for inline operators in string.md
2026-03-19 01:04:10 +08:00
7dd7858ef2 docs: fix threading module documentation discrepancies
- Fix SpinLock docs: clarify lock()/unlock()/try_lock() are non-const
  (matching source implementation in SpinLock.h)
- Add missing LambdaTask::Execute() method to inherited methods table
- Update TaskGroup::Wait() docs: clarify m_pendingCount never decrements
  causing indefinite block even after all tasks complete (not just
  unexecuted tasks)
- Update TaskGroup::IsComplete() docs: document same m_pendingCount
  issue causing incorrect return values
2026-03-19 01:03:14 +08:00
71413381af docs: fix debug module documentation discrepancies
- Changed include path in debug.md from Logger.h to Debug.h (umbrella header)
- Added XE_ASSERT example in debug.md usage section
- Added documentation for Profiler private types (ProfileNode, ProfileSample)
- Added documentation for Profiler member variables (m_profileStack, m_samples, m_frameStartTime, m_initialized)
- Verified MarkEvent, SetMarker, ExportChromeTracing are correctly marked as stubs
2026-03-19 01:02:15 +08:00
a669ec819d Fix RHI documentation discrepancies and add missing doc files
Fixed incorrect links in OpenGL documentation:
- Fixed wrong links to threading/task-system docs for Initialize/Shutdown methods
- Fixed wrong links to buffer docs for GetNativeHandle methods
- Fixed wrong links to shader docs for Bind/Unbind methods
- Fixed wrong links to command-list docs for Clear/Reset/Close methods
- Fixed wrong links to buffer/get-size.md for width/height methods

Added missing documentation files:
- OpenGL buffer: bind.md, unbind.md, get-type.md, initialize.md
- OpenGL fence: initialize.md, reset.md
- OpenGL swap-chain: get-size.md, initialize.md
- OpenGL render-target-view: initialize.md, shutdown.md, bind.md, unbind.md, clear.md, get-size.md
- OpenGL depth-stencil-view: initialize.md, shutdown.md, bind.md, unbind.md, get-size.md
- OpenGL command-list: clear.md

All links validated with fix_links.py - no broken references.
2026-03-19 00:54:54 +08:00
086eb877b5 docs: fix resources module documentation discrepancies
- Add missing MakeResourceGUID helper function to resourcetypes.md
- Add note about GetResourceType<T>() template specializations
- Merge duplicate '缓存控制' section into '内存管理' in resourcecache.md
- Verify all methods documented match source code implementations

Fixed documentation to match:
- ResourceTypes.h: MakeResourceGUID function now documented
- ResourceCache.h: OnZeroRefCount and Clear methods now properly listed
- AsyncLoader.md: Removed duplicate progress query section
2026-03-19 00:52:46 +08:00
bd530dc8b1 Fix Box documentation to accurately reflect AABB vs OBB behavior
- Updated box.md to clarify that Box uses OBB semantics for Contains
  but currently uses AABB for Intersects(Box)
- Updated intersects-box.md to document that it uses AABB algorithm
  instead of SAT, since the current implementation ignores transform
- Added notes explaining the current limitations of the Box implementation
2026-03-19 00:52:04 +08:00
6a952473ce docs: fix threading module documentation discrepancies
- Fix include paths: use #include "Threading/..." instead of <XCEngine/Threading/...>
- Document protected ITask constructors (ITask(), ITask(TaskPriority))
- Document Callback typedef in TaskGroup
- Clarify Mutex STL-compatible methods are const
- Note GetProgress() implementation limitation (returns 0.0f)
2026-03-19 00:49:08 +08:00
98c764bab9 docs: Fix memory module documentation discrepancies
- Add missing PoolAllocator class overview with methods table
- Add missing LinearAllocator class overview with methods table
- Add missing ProxyAllocator class overview with methods table
- Fix PoolAllocator::Allocate example code and comments
- Clarify ProxyAllocator::Free totalFreed calculation behavior
- Fix CreateLinearAllocator complexity from O(size) to O(1)
- Add note about Reallocate thread safety in ProxyAllocator
2026-03-19 00:48:44 +08:00
5fc18eac6f docs: Fix SmartPtr docs linking to Core Types instead of RHI Types 2026-03-19 00:47:57 +08:00
dae1a63a90 Fix debug module documentation discrepancies
- Fix XE_LOG macro parameter order in debug.md (category, level) was reversed
- Add 'Implementation Status' section to profiler.md listing stub methods
  (MarkEvent, SetMarker, ExportChromeTracing) that are not yet implemented
2026-03-19 00:47:29 +08:00
82cf147817 docs: 修正 API 文档准确性 (第四轮检查)
修复问题:
- containers: HashMap 实现描述修正
- debug: XE_LOG 宏参数顺序修正
- memory: ProxyAllocator 统计示例修正, PoolAllocator allocate size 检查描述
- resources: ResourceManager 缺失 UnloadGroup 方法
- rhi: D3D12 格式枚举名称修正, Texture Format 枚举补全, ResourceStates 补充
- threading: TaskGroup GetProgress/Wait/Cancel 实现限制说明
2026-03-19 00:43:16 +08:00
870cb3116e docs: 修正 API 文档准确性 (第三轮检查)
修复问题:
- containers: HashMap include 路径修复
- core: RefCounted 析构函数访问级别, Event::begin/end 返回值说明
- memory: LinearAllocator::GetMarker 返回偏移量非指针
- resources: LoadAsync 示例使用不存在的模板方法
- rhi: OpenGL 链接错误, ShaderType 枚举缺失8个类型, 链接修复
- threading: SpinLock STL 兼容方法说明, Mutex const 方法说明
2026-03-19 00:35:26 +08:00
a9f882f233 docs: 修正 API 文档准确性 (第二轮检查)
修复的问题:
- math: 修复 Quaternion::Normalize 链接错误
- containers: HashMap 迭代器示例使用不存在的 cbegin/cend,删除冗余构造函数声明
- core: RefCounted 析构函数访问级别修正 (protected)
- debug: LogLevelToString 示例返回值大小写修正
- memory: 修正 LinearAllocator::Reallocate 返回 nullptr,ProxyAllocator 统计描述,头文件路径 IAllocator.h -> Allocator.h
- resources: Texture::Create mipLevels 参数描述修正
- rhi: 修复多处链接错误,新增缺失的方法文档
- threading: TaskSystem 配置项未实现状态标注,Wait 方法空实现标注
2026-03-19 00:31:14 +08:00
dc850d7739 docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录
- 重命名 index.md 为 main.md
- 修正所有模块文档中的错误:
  - math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式
  - containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节
  - core: 修复 types 链接错误
  - debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI
  - memory: 修复头文件路径, malloc vs operator new, 新增方法文档
  - resources: 修复 Shader/Texture 链接错误
  - threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接
- 验证: fix_links.py 确认 0 个断裂引用
2026-03-19 00:22:30 +08:00
d0e16962c8 docs: update README and project docs to reflect game engine scope 2026-03-18 17:58:01 +08:00
9bad996ecf refactor: reorganize docs into plan/ and add skills/ 2026-03-18 17:49:22 +08:00
fc7c8f6797 feat: 完成资源系统导入设置类实现
- 新增 ImportSettings 基类
- 新增 TextureImportSettings 纹理导入设置类
- 新增 MeshImportSettings 网格导入设置类
- 新增 ResourcePath 资源路径类
- 完善 CMakeLists.txt 配置
- 新增对应单元测试 (45个测试用例)
2026-03-18 13:39:32 +08:00
3196261e9b fix(RHI): 添加 OpenGL 源文件到 CMakeLists 并修复编译错误
- 添加 OpenGL RHI 所有源文件到 engine/CMakeLists.txt
- 修复 OpenGLPipelineState 结构体重定义问题
- 修复 BufferDesc/TextureDesc/ShaderCompileDesc API 不匹配
- 添加 OpenGLShader 缺少的基类纯虚函数实现
- 修复 HashMap 迭代器支持和 ResourceManager API 调用
2026-03-18 03:37:34 +08:00
8344057886 feat(resources): add LoadGroup and UnloadGroup for batch resource loading 2026-03-18 03:20:18 +08:00
87835c5f7a Add build2/ to gitignore 2026-03-18 03:07:29 +08:00
508d8b165b feat(RHI): 添加 RHIPipelineLayout 抽象类 2026-03-18 03:04:13 +08:00
17e71218e7 feat(OpenGL): 初始化 RHICapabilities
- 在 OpenGLDevice 初始化时查询 GL 扩展和硬件限制
- 设置 majorVersion、minorVersion
- 设置几何着色器、计算着色器、细分着色器支持标志
- 设置最大纹理尺寸、最大渲染目标数、最大视口数、各向异性最大值、顶点属性最大数
2026-03-18 02:36:40 +08:00
65ce9c84c6 feat(RHI): 在 RHIBuffer 基类中添加资源状态接口
- 添加 GetState() 和 SetState() 纯虚函数到 RHIBuffer 抽象基类
- D3D12Buffer 已有实现,现在通过基类接口可用
- OpenGLBuffer 添加空实现(OpenGL 无资源状态概念)
2026-03-18 02:34:17 +08:00
60c8461be3 refactor(RHI): 将窗口管理接口从 RHIDevice 移至 RHISwapChain
- 从 RHIDevice 抽象基类中移除 PollEvents/SwapBuffers/ShouldClose/SetShouldClose 接口
- 这些功能现在应该通过 RHISwapChain 访问
- 符合设计文档中定义的分层架构
2026-03-18 02:32:31 +08:00
83c2426830 fix(OpenGL): 修复工厂方法返回 nullptr 的问题
- OpenGLDevice::CreateBuffer 现在创建并返回 OpenGLBuffer 对象
- OpenGLDevice::CreateTexture 现在创建并返回 OpenGLTexture 对象
- OpenGLDevice::CreateSwapChain 现在创建并返回 OpenGLSwapChain 对象
- OpenGLDevice::CreateCommandList 现在创建并返回 OpenGLCommandList 对象
- OpenGLDevice::CreateCommandQueue 现在创建并返回 OpenGLCommandQueue 对象
- OpenGLDevice::CompileShader 现在创建并返回 OpenGLShader 对象
- OpenGLDevice::CreatePipelineState 现在创建并返回 OpenGLPipelineState 对象
- OpenGLDevice::CreateFence 现在创建并返回 OpenGLFence 对象
- OpenGLDevice::CreateSampler 现在创建并返回 OpenGLSampler 对象
2026-03-18 02:29:12 +08:00
a532cabf92 feat(RHI): 添加 RHIDescriptorPool 抽象类
- 新增 RHIDescriptorPool 抽象基类,定义描述符池统一接口
- D3D12DescriptorHeap 现在继承自 RHIDescriptorPool
- 添加 DescriptorPoolDesc 结构体,包含设备指针、类型、数量等信息
- 添加 Initialize(const DescriptorPoolDesc&) 统一初始化方法
2026-03-18 01:46:01 +08:00
a220638298 fix(D3D12): 修复 D3D12Fence::IsSignaled() 实现错误
- 原来实现假设 GetCompletedValue() > 0 即为 signaled,这是错误的
- 添加 m_signalValue 成员变量跟踪最后一次 signal 的值
- IsSignaled() 现在正确检查 GetCompletedValue() >= m_signalValue
2026-03-18 01:37:55 +08:00
70571316da feat(RHI): 添加 RHIFactory 工厂类
- 新增 RHIFactory 头文件和实现,支持通过 RHIType 或字符串创建设备
- 修复 D3D12Buffer 缺失的 Map/Unmap/SetData 实现
- 添加 RHI 工厂测试用例
- 更新 CMakeLists.txt 添加新文件
2026-03-18 01:33:15 +08:00
d2585f14b3 feat(Resources): Add ResourceDependencyGraph for resource dependency tracking
- Implement dependency graph for resource management
- Add/remove nodes and dependencies
- Reference counting support
- Circular dependency detection
- Add unit tests
2026-03-18 01:13:02 +08:00
bd69c3e124 feat(Resources): Add ResourcePackage system for asset bundling
- Implement ResourcePackageBuilder for creating .xcp packages
- Implement ResourcePackage for reading packaged assets
- Add unit tests for package builder and package reader
2026-03-18 00:49:22 +08:00
02ca59edf6 test(Resources): Add comprehensive resource system tests (8 new test files, +48 test cases)
- Add Shader tests (8 test cases)
- Add Material tests (13 test cases)
- Add FileArchive tests (7 test cases)
- Add Loader tests for Texture, Mesh, Audio, Shader, Material (4 tests each)
- Implement IResourceLoader.cpp with ReadFileData and GetExtension
- Update CMakeLists.txt to include new test files and source
2026-03-18 00:09:06 +08:00
640557cbb5 test(Resources): Add ResourceFileSystem tests (4 test cases) 2026-03-17 23:46:46 +08:00
e71edc2f46 test(Resources): Add AudioClip tests (2 test cases) 2026-03-17 23:45:06 +08:00
8cc4322d22 test(Resources): Add Texture and Mesh tests (8 test cases) 2026-03-17 23:38:29 +08:00
2325b4ba7d test(Resources): Add IResourceLoader/LoadResult tests (4 test cases) 2026-03-17 23:36:12 +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
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