Commit Graph

351 Commits

Author SHA1 Message Date
0fc449bc78 feat(ufbx): switch to native ufbx_vec/quat/matrix types
Replaces all Misaki.HighPerformance.Mathematics vector, quaternion, and matrix types in Ghost.Ufbx bindings with new native ufbx_vec2, ufbx_vec3, ufbx_vec4, ufbx_quat, and ufbx_matrix structs. Updates all interop code, struct fields, and API signatures accordingly. Adds struct definitions for the new types and provides matrix operations as struct methods. Removes unnecessary math package reference. Also includes minor fixes to system attributes, meshlet LOD logic, and mesh utility.

BREAKING CHANGE: All Ufbx-related APIs now use ufbx_* types instead of Misaki.HighPerformance.Mathematics types. Existing code using the old types will require updates.
2026-04-07 23:50:55 +09:00
a5c10cfe5a feat(render): support per-frame render payloads
Refactored the render pipeline system to introduce per-frame IRenderPayload management.
IRenderPipelineSettings now requires CreatePipeline and CreatePayload methods.
Updated RenderSystem and test pipeline to use the new payload model.
Removed legacy GhostRenderPipeline and test code.
Added RenderPipelineSystemAttribute for pipeline system registration.
Includes minor fixes such as version field type corrections and typo fixes.

BREAKING CHANGE: Render pipeline and payload creation APIs have changed; implementers must update to the new interface methods.
2026-04-07 17:12:01 +09:00
6c96d4cf50 feat(core,rendering)!: add cleanup component support, refactor render pipeline
Introduce ICleanupComponent and cleanup archetype logic in ECS. Refactor component versioning to uint. Update IResourceDatabase to use map/unmap pattern. Decouple per-frame render requests from RenderSystem via IRenderPayload. Update render pipeline and extraction system to new API.

BREAKING CHANGE: Entity destruction and render pipeline APIs have changed. IResourceDatabase.MapResource signature is updated; all callers must use map/memcpy/unmap. RenderSystem no longer manages per-frame render requests directly.
2026-04-06 22:05:48 +09:00
c6bdbe0710 feat(d3d12): add indirect command execution support
Added ICommandSignature and D3D12CommandSignature for indirect command execution in the D3D12 backend, with supporting types. Updated ICommandBuffer and IGraphicsEngine interfaces to support indirect execution and command signature creation. Refactored command buffer pooling in D3D12GraphicsEngine for more flexible reuse. Changed BeginFrame and EndFrame to void and clarified parameter names. Updated resource and frame data structures to use direct buffer indices. Added RenderingUtility for buffer and texture uploads. Removed IRenderOutput interface. Updated RenderSystem render loop and HLSL/C# code to match new buffer usage patterns.

BREAKING CHANGE: ICommandBuffer, IGraphicsEngine, and related APIs have changed signatures and behaviors. Indirect command execution is now supported and required for some advanced features.
2026-04-05 23:11:08 +09:00
effd33b285 feat(rendergraph): async queue, pool refactor, barrier cleanup
Refactor resource pool to use UnsafeQueue/UnsafeList for transient resources, improving memory management and performance.
Add async GPU wait support to ICommandQueue and D3D12.
Refactor render graph barrier system, streamline CompiledBarrier, and remove ResourceBarrier.
RenderGraphCompiler now returns Result<float2, Error> for dynamic resolution scaling.
Replace custom memory pools with Allocator.FreeList for temp allocations.
Add ResourceUploadBatch for async/sync resource uploads.
Fix D3D12 disposal and fence tracking bugs.
Update NuGet dependencies.
Numerous minor cleanups and code improvements.
2026-04-05 17:54:23 +09:00
92970f85ef feat(render): improve frame sync and CPU write tracking
Refactored frame submission and synchronization logic for more accurate GPU/CPU coordination. Introduced CpuWriteOpen property to enforce correct CPU frame access patterns. Updated ResourceManager to track _submittedFrame and improved event waiting logic. Added debug assertions and enhanced logging for frame start events. Documented known command submission issue in GraphicsTestWindow.
2026-04-03 22:17:54 +09:00
2dc97f3149 feat(resource-manager): add reusable page pool for efficiency
Refactored ResourceManager to introduce a _freePages queue for reusable pages, reducing unnecessary allocations. Added TryRentReusablePage and IsHeapFlagsCompatible helpers to efficiently rent compatible pages. Updated page creation and retirement logic to use the free pool, and ensured all page pools are properly released during cleanup.
2026-04-03 18:19:00 +09:00
ba9e24c46c feat(rhi): refactor resource & barrier management for D3D12
Modernizes resource and barrier management for the D3D12 backend. Key changes:
- Simplifies BarrierDesc by removing nullable "before" states; now inferred from resource database.
- Adds IsAliasing flag to BarrierDesc for aliasing transitions.
- Replaces ResourceMemoryType with HeapType in BufferDesc and related APIs.
- Enhances ResourceViewGroup with usage inference methods.
- Adds D3D12 utility helpers for heap/flag conversions and resource description extraction.
- Optimizes command buffer barrier emission, skipping redundant barriers.
- Refactors Material and RenderContext to use new APIs and state tracking.
- Updates ResourceManager pooling to use HeapType and standard Queue.
- Simplifies RenderGraphExecutor barrier logic and aliasing handling.
- Improves RenderSystem frame synchronization and resource retirement.
- Cleans up obsolete code and improves debug output.

BREAKING CHANGE: Updates to resource and barrier APIs require changes to all code interfacing with resource creation, barriers, and memory types.
2026-04-03 17:03:41 +09:00
6321b36ef5 feat(resource): refactor heap management & suballocation
Major overhaul of GPU resource/heap management:
- Replace resource pooling and upload buffer logic with transient heap/page-based suballocation in ResourceManager.
- Add support for suballocation and heap flags/types, with D3D12 helpers.
- Remove ICommandBuffer.UploadBuffer/UploadTexture; add UpdateSubResources and CopyBuffer, move upload logic to RenderingContext.
- Refactor D3D12ResourceAllocator/Database for suballocation, heap flags, and mapping.
- Standardize on Handle<GPUBuffer> usage.
- Update meshlet/mesh utilities for new allocation handles and memory pools.
- Refactor RenderGraph and docs to use "heap" terminology.
- Use cpuFrame/gpuFrame consistently for frame sync.
- Add s2h.hlsl, s2h_3d.hlsl, s2h_scatter.hlsl shader debug libs.
- Miscellaneous fixes, cleanup, and dependency updates.

BREAKING CHANGE: Resource pooling and upload APIs replaced with new heap/page-based suballocation system. Update all buffer/texture creation and upload code to use new ResourceManager and ICommandBuffer methods.
2026-04-03 01:48:49 +09:00
d03eb659fa feat(meshlet): refactor meshlet pipeline & add benchmark
Refactor meshlet build pipeline for robustness and performance.
Rename DxcShaderCompiler to DXCShaderCompiler. Enhance meshlet
data structures with bounds and LOD info. Add fallback mesh
simplification. Remove obsolete MeshRenderPass. Add
MeshoptBenchmark for meshlet build performance. Update mesh
import utilities for correct handedness. Minor bug fixes and
code cleanups.
2026-04-02 17:50:44 +09:00
e32a24739d feat(rhi): add NoAccess ops, axis conversion, meshlet color
Added NoAccess to attachment ops for depth/stencil, updated D3D12 and RenderGraph to handle new ops, and improved axis/handedness conversion in mesh loading. Enabled meshlet color hashing in test shader. Changed default rasterizer winding, added format helpers, and updated camera transform for correct mesh orientation. JobScheduler usage commented out for now.
2026-04-01 19:57:27 +09:00
eb41f23582 feat(rendergraph): skip redundant SRV barriers, add usage param
Add logic to skip generic SRV barriers for resources explicitly handled as color, depth, or random access in raster passes, preventing redundant transitions. Update RGTextureDesc to accept a TextureUsage parameter for more flexible texture descriptor creation.
2026-04-01 17:20:18 +09:00
3157596b5d Fix D3D12 depth format and stencil barrier issues in Render Graph 2026-04-01 15:38:37 +09:00
a00cb27529 feat(wrapper): span-based interop, resource API refactor
Refactored native wrappers to use ReadOnlySpan<T> for pointer parameters, improving .NET safety and interop. Enhanced wrapper generator with $TYPE and prefix/suffix-based parameter remapping. Added platform-specific native library loading for meshoptimizer, nvtt, and ufbx. Updated D3D12GraphicsEngineFactory for native DLL resolution and removed redundant logic from UnitTestApp. Changed RenderGraphBuilder's resource extraction API to use QueryTextureExtraction/QueryBufferExtraction with explicit handles and flags. Removed IRenderer and D3D12Renderer, moving RenderContext to RenderPipeline. Improved mesh loading, resource management, and updated test shader conventions. Updated project references, build settings, and added launchSettings.json for tooling.

BREAKING CHANGE: Native wrapper APIs now use ReadOnlySpan<T> instead of pointers. RenderGraphBuilder resource extraction API has changed. IRenderer and D3D12Renderer have been removed.
2026-04-01 14:50:20 +09:00
0b6e5b8501 feat(mesh): update Vertex layout, add mesh loader
Refactored Vertex to use float3 position/normal, float2 uv, float4 tangent, and Color128 color, updating all mesh generation and HLSL code accordingly. Added MeshUtility for loading .obj/.fbx meshes with deduplication and normal/tangent computation. Updated GraphicsTestWindow to use the new loader and improved resource management. Fixed D3D12ResourceAllocator resource creation logic, improved camera projection math, and simplified RenderingLayerMask. Updated package references and app display name.

BREAKING CHANGE: Vertex struct layout changed; all mesh code and shaders must use the new format.
2026-04-01 00:06:31 +09:00
89e6c68f2a feat(rhi)!: refactor resource handles to GPUTexture/GPUBuffer
Refactored all graphics resource handles to use Handle<GPUTexture> and Handle<GPUBuffer> instead of Handle<Texture> and Handle<GraphicsBuffer>. Updated all APIs, interfaces, and implementations to use the new types, including ICommandBuffer, IResourceAllocator, ISwapChain, IRenderOutput, IRenderGraphBuilder, and related classes. Introduced TempJobAllocator for frame-latency-aware allocations. Updated ResourceHandleExtensions for new conversions. Performed minor code cleanups and removed the empty ClusterLod.cs file.

BREAKING CHANGE: All usages of Handle<Texture> and Handle<GraphicsBuffer> are replaced with Handle<GPUTexture> and Handle<GPUBuffer>. This affects all APIs and resource management code. Callers must update their code to use the new handle types.
2026-03-30 21:27:16 +09:00
b28b32f502 feat(ui): migrate ProjectBrowser to GridView, improve cleanup
Refactored ProjectBrowser to use GridView instead of ItemsView for file display, updated selection logic, and set a minimum grid height. FloatingWindow now manages DockingLayout cleanup on close to prevent resource leaks. Simplified DockDocument and DockGroup instantiations in EngineEditorWindow. Updated GetDirectoryNameConverter to use Path.GetDirectoryName directly. App shutdown now calls EditorApplication.Shutdown(). Added Ghost.Engine reference in ActivationHandler.
2026-03-29 19:55:05 +09:00
fa617accc3 fix(docking): restore incremental layout updates to prevent visual tree rebuilds 2026-03-29 19:32:44 +09:00
ff22b89ba3 feat(docking): implement proportional sizing for docking layout
- Add DockLength property to DockModule to track star weights
- Add SyncLengths() to DockPanel to capture current Grid weights
- Update DockPanel.UpdateLayoutStructure to use DockLength
- Update DockingLayout.SplitGroup to distribute weights when splitting
2026-03-29 19:02:21 +09:00
2e6e705558 fix: update DockGroup to use DockTabItem and fix tab selection 2026-03-29 18:51:52 +09:00
e6e38f5eea fix(docking): defer container cleanup to avoid visual tree modification during layout 2026-03-29 18:47:38 +09:00
d15bd22743 feat(docking): improve tab management and error handling
Refactored DockGroup to only remove obsolete TabViewItems and restore tab selection more reliably. Updated DockGroup.xaml to enable tab reordering and add-tab button. Switched to CommunityToolkit.WinUI.Controls for GridSplitter and added a style for it. Made DockPanel, DockRegionHighlight, and DockingLayout partial classes. In App.xaml.cs, wrapped initialization in a try-catch to exit on error, and ensured process exit on window close. Improved ProjectBrowser scrollbar behavior and layout settings.
2026-03-29 16:07:18 +09:00
15870ffe89 refactor: adopt WinUI.Dock approach for layout updates and tab content hosting 2026-03-29 15:16:08 +09:00
70b7e56eb7 feat(editor): implement scroll state saving for ProjectBrowser ItemsView 2026-03-29 14:54:26 +09:00
257838b33e refactor: make DockPanel grid definitions incremental to preserve virtualization state 2026-03-29 14:18:49 +09:00
8ff98c56be refactor: remove SizeChanged hack from ProjectBrowser 2026-03-29 14:17:19 +09:00
2c84696994 fix: make DockPanel layout updates incremental to preserve visual tree state 2026-03-29 14:03:38 +09:00
a33a150d06 fix: resolve root module null reference and itemsview scroll bug 2026-03-29 12:30:07 +09:00
60ef684d80 Fixed package version issue. 2026-03-29 01:24:21 +09:00
90ac5e6d4b Untrak the NUL file 2026-03-29 01:21:41 +09:00
bd13e7faa0 Merge branch 'develop' into feature/docking-layout
# Conflicts:
#	src/Editor/Ghost.Editor/ActivationHandler.cs
#	src/Editor/Ghost.Editor/App.xaml
#	src/Editor/Ghost.Editor/View/Windows/EngineEditorWindow.xaml
2026-03-29 01:20:01 +09:00
b5d8009bec Fixed the issue that crash when close. 2026-03-29 01:13:51 +09:00
3aef53cad9 fix: resolve element already child exception during tab drag and drop 2026-03-28 23:44:52 +09:00
99adf8fc3b fix: merge docking resource dictionary and add test layout 2026-03-28 23:36:23 +09:00
1c553a55fa fix(editor): ensure source container cleanup in ReplaceChild and document cross-layout moves 2026-03-28 23:10:46 +09:00
e9f822409d fix(docking): prevent layout tree loss and enforce cross-layout ownership 2026-03-28 23:07:28 +09:00
0d8bc6f868 fix(docking): improve root cleanup and simplify DockPanel cleanup logic 2026-03-28 23:05:23 +09:00
c8f24edfd8 fix(docking): address final code quality issues in docking layout 2026-03-28 23:03:32 +09:00
2946b905c6 fix(docking): address final code quality issues in docking layout 2026-03-28 23:01:28 +09:00
666528263b fix(docking): address final code quality issues in docking layout 2026-03-28 22:57:54 +09:00
c52daf3914 fix(docking): address code quality issues in DockingLayout 2026-03-28 22:54:30 +09:00
9738971369 fix(docking): address code quality issues in DockingLayout and FloatingWindow 2026-03-28 22:52:34 +09:00
af56338347 feat(docking): add floating window support 2026-03-28 22:50:28 +09:00
45711e7770 fix: address re-entrancy in ReplaceChild and invalid split in AddDocument 2026-03-28 22:48:58 +09:00
0f0b36a932 fix: address code quality issues in DockContainer and DockPanel
- Throw ArgumentException in DockContainer.ReplaceChild if newChild is already in the container to avoid index shifting bugs.
- Add comment in DockPanel.CheckCleanup explaining the asymmetric root panel collapse behavior.
2026-03-28 22:46:26 +09:00
e6d0529ef1 fix(docking): address code quality issues in Docking system 2026-03-28 22:43:44 +09:00
d367cff79f fix(docking): address code quality issues and improve structural integrity 2026-03-28 22:42:07 +09:00
35731d4ebe fix(docking): address code quality issues and improve structural integrity 2026-03-28 22:39:57 +09:00
8d3c5ecb1f fix(docking): address reentrancy and validation issues in DockContainer 2026-03-28 22:37:59 +09:00
1d48784a1c fix(docking): improve structural integrity and add null validation 2026-03-28 22:35:43 +09:00