.claude
This commit is contained in:
24
.claude/commands/build.md
Normal file
24
.claude/commands/build.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Build Commands
|
||||
|
||||
## Desktop
|
||||
```bash
|
||||
cargo build # debug
|
||||
cargo build --release # release
|
||||
cargo run # game mode
|
||||
cargo run -- --editor # editor mode
|
||||
```
|
||||
|
||||
## iOS
|
||||
iOS builds require macOS. The project uses a custom SDL3 + wgpu iOS export pipeline. See `brain-project/ios/readme.md` in QMD for the full export guide.
|
||||
|
||||
## Android
|
||||
```bash
|
||||
cargo apk build
|
||||
```
|
||||
|
||||
## Checks
|
||||
```bash
|
||||
cargo check
|
||||
cargo fmt
|
||||
cargo clippy
|
||||
```
|
||||
15
.claude/commands/wgsl.md
Normal file
15
.claude/commands/wgsl.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# WGSL Uniform Buffer Alignment
|
||||
|
||||
When creating uniform buffers for WGSL shaders, struct fields must be aligned:
|
||||
|
||||
| Type | Alignment |
|
||||
|------|-----------|
|
||||
| `f32` | 4 bytes |
|
||||
| `vec2<f32>` | 8 bytes |
|
||||
| `vec3<f32>` | 16 bytes (treated as vec4) |
|
||||
| `vec4<f32>` | 16 bytes |
|
||||
| `mat4x4<f32>` | 16 bytes (64 bytes total) |
|
||||
|
||||
Use padding fields to match WGSL struct layout exactly. Prefer `vec4` over individual floats to avoid alignment issues.
|
||||
|
||||
Shaders live in `src/shaders/` and are embedded via `include_str!()`.
|
||||
Reference in New Issue
Block a user