-
Notifications
You must be signed in to change notification settings - Fork 0
fix: Optimize memory zig and wgsl #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR optimizes memory usage for Zig and WGSL components by restructuring data layouts and improving GPU buffer handling. The changes focus on reducing memory footprint and improving performance through better data organization.
- Refactored vertex data structures to use more efficient memory layouts with extern structs
- Replaced Float32Array buffers with direct ArrayBuffer handling for better memory control
- Migrated from separate coordinate components to packed vertex structures
Reviewed Changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/run.ts | Updated WebGPU program interface to use ArrayBuffer and new vertex data access patterns |
| src/logic/types.zig | Added extern struct attribute to Point and PointUV for C-compatible memory layout |
| src/logic/triangle.zig | Restructured triangle vertex data using new DrawInstance and PickInstance structs |
| src/logic/transform_ui.zig | Updated to use new triangle instance-based rendering approach |
| src/logic/msdf.zig | Refactored MSDF vertex data to use structured instances instead of flat arrays |
| src/logic/line.zig | Simplified line rendering to use triangle instances |
| src/logic/index.zig | Updated main rendering logic to use new asset structure and vertex data format |
| src/logic/assets.zig | New file containing restructured Asset and vertex data definitions |
| src/logic/asset.zig | Removed (functionality moved to assets.zig) |
| src/WebGPU/programs/*/shader.wgsl | Updated shaders to work with new vertex attribute layouts |
| src/WebGPU/programs/*/getProgram.ts | Modified GPU programs to handle ArrayBuffer instead of Float32Array |
…ld for accepting screenshots
No description provided.