|
| 1 | +# Contributing to VCK |
| 2 | + |
| 3 | +Thanks for wanting to contribute. VCK is small on purpose — no scene graph, no |
| 4 | +ECS, no material system — so most contributions fall into one of: |
| 5 | + |
| 6 | +1. **Bug fix** in the core primitives, expansion layer, execution layer, or |
| 7 | + examples. Smallest-possible diff preferred. |
| 8 | +2. **New example** in `example/<Name>Example/` demonstrating a Vulkan feature |
| 9 | + with the same `main.cpp + App.{h,cpp}` pattern as the existing 9. |
| 10 | +3. **Docs / wiki polish** — the wiki is the 1-hour-onboarding surface; the |
| 11 | + `docs/` folder is where the source lives (wiki is mirrored from it). |
| 12 | +4. **Cross-platform fix** for Windows / Linux / macOS compile or runtime issues. |
| 13 | + |
| 14 | +## Before you open a PR |
| 15 | + |
| 16 | +- Read [`docs/Design.md`](docs/Design.md) — the 17 design rules are the |
| 17 | + architectural contract. PRs that violate a rule get a rework request unless |
| 18 | + the rule itself is being changed in the same PR. |
| 19 | +- Read [`VCK.h`](VCK.h) — the header block is the single source of truth for |
| 20 | + the API surface, class index, config, and quick-start. If you add a public |
| 21 | + class or config knob, update `VCK.h`. |
| 22 | +- Run `example/build.bat [A]` (Windows, MinGW) or `example/build.sh` (Linux / |
| 23 | + macOS) and confirm all 9 examples still compile. |
| 24 | + |
| 25 | +## Design rules, in one line |
| 26 | + |
| 27 | +1. Explicit over magic (Init/Shutdown pairs, no singletons). |
| 28 | +2. Core owns resources; expansion/execution borrow raw pointers. |
| 29 | +3. Strict lifecycle order (Context → Device → Swapchain → Command → Sync → …). |
| 30 | +4. No hidden synchronisation (documented `vkDeviceWaitIdle` allow-list in `docs/Design.md`). |
| 31 | +5. Memory is frame-scoped or persistent; no dangling state. |
| 32 | +6. No hidden behaviour; user-visible picks log as `VCKLog::Notice`. |
| 33 | +7. User owns the frame loop unless they opt into `FrameScheduler`. |
| 34 | +8. Explicit synchronisation model; no implicit ordering. |
| 35 | +9. Escape hatches everywhere — every wrapper exposes `Get<VkHandle>()`. |
| 36 | +10. Zero hidden GPU state. |
| 37 | +11. Deterministic frame behaviour under Pipelined / Lockstep; `AsyncMax` is documented nondeterminism. |
| 38 | +12. Explicit recreation events (logged + `DebugTimeline` spans). |
| 39 | +13. Debuggability is a core feature, not optional. |
| 40 | +14. Fail fast, fail loud (`VK_CHECK` routes to `VCKLog::Error`). |
| 41 | +15. Minimal core surface. |
| 42 | +16. No engine assumptions (no scene graph, no materials, no assets). |
| 43 | +17. The frame is the unit of truth. |
| 44 | + |
| 45 | +## Branching |
| 46 | + |
| 47 | +- `master` — stable; only merge via PR with a green CI. |
| 48 | +- `VCK` — current integration branch for v0.2 line. |
| 49 | +- Feature branches — `feature/<name>` or `fix/<issue>`. |
| 50 | + |
| 51 | +## Commit style |
| 52 | + |
| 53 | +- First line: ≤ 72 chars, imperative mood ("Add AA auto-detector", not "Added AA auto-detector"). |
| 54 | +- Body (optional): wrap at 72 cols, explain *why* more than *what*. |
| 55 | +- No `--amend` on pushed commits; no `--no-verify`. |
| 56 | + |
| 57 | +## Code style |
| 58 | + |
| 59 | +- C++17. Follow the surrounding style of the file you're editing. |
| 60 | +- Include order: local (`"../../VCK.h"`) → third-party (`<vulkan/vulkan.h>`) → std (`<vector>`). |
| 61 | +- Prefer minimal comments; `VCK.h` header documents the API, not per-class |
| 62 | + headers. |
| 63 | +- `snake_case` for local variables, `camelCase` for functions/methods, |
| 64 | + `PascalCase` for types, `m_Member` for class members. |
| 65 | + |
| 66 | +## Testing |
| 67 | + |
| 68 | +VCK currently has no unit tests. CI on Windows runs `build.bat [A]` which |
| 69 | +compiles all 9 examples. Runtime validation is manual: |
| 70 | + |
| 71 | +- Run an example, resize the window (including 720p ↔ 4K), confirm no |
| 72 | + stutter. |
| 73 | +- Run with `cfg.debug = true` and verify the `[Context]` / `[Device]` / |
| 74 | + `[Swapchain]` init chatter is visible. |
| 75 | + |
| 76 | +## License |
| 77 | + |
| 78 | +By contributing, you agree your work is licensed under the repo's MIT license |
| 79 | +(see [`LICENSE`](LICENSE)). |
0 commit comments