Commit Graph
57 Commits
Author SHA1 Message Date
codegirl007 00ba400d15 Add crowd_batch, crowd_overdraw, and clip_thrash stress examples. 2026-08-14 23:08:03 -07:00
codegirl007 a24f547709 Add set_sprite_clip_def for pre-resolved clip switches. 2026-08-14 23:07:58 -07:00
codegirl007 9df98ef73d Merge pull request #31 from Codegirl-Games/test-sprite-clip-cache
Test sprite clip_def cache on set_sprite_clip
2026-08-14 22:44:52 -07:00
codegirl007 f65b0354df Test that set_sprite_clip caches clip_def on sprites.
Locks spawn/switch cache fill and that a bad clip name leaves the prior cache intact.
2026-08-14 22:43:42 -07:00
codegirl007 cc196afd2e Cache sprite clip defs to cut per-frame map lookups 2026-08-14 22:42:15 -07:00
codegirl007 8d9faaaee0 Drop verbose comments from the clip-cache change. 2026-08-14 22:40:42 -07:00
codegirl007 41fb0a3d5a Cache clip defs on sprites to avoid per-frame map lookups.
Crowd stress (128 sprites) showed Clip_Def string map_get as the top engine cost; cache on set_sprite_clip and use it in update/draw.
2026-08-14 22:32:28 -07:00
codegirl007 dcf5ea29b0 Texture batching with prepare_draw_batches test coverage 2026-08-14 22:20:08 -07:00
codegirl007 70784b0f1b Test DXIL shader runtime preference without MSL 2026-08-14 22:19:16 -07:00
codegirl007 deef204bd3 Test DXIL preference when MSL is unavailable.
Locks the MSL > DXIL > SPIRV shader runtime order so Windows paths cannot silently fall through to Vulkan.
2026-08-14 22:16:58 -07:00
codegirl007 25dd3aa920 Add texture batching with TDD coverage at enqueue and prepare seams.
Opt-in batch_group regrouping cuts texture binds; prepare_draw_batches and draw_list tests lock the contract so end_frame cannot silently drop regroup.
2026-08-14 22:15:08 -07:00
codegirl007 0d4cdbd8ca Optimize build with -o:speed 2026-08-09 14:28:21 -07:00
codegirl007 9727aa4d7a Merge branch 'master' into optimized-build 2026-08-09 14:16:11 -07:00
codegirl007 b8b05954b1 fixes 2026-08-09 14:13:13 -07:00
codegirl007 58a2d5267e optimize build for speed 2026-08-09 14:05:28 -07:00
codegirl007 cd29426bbe initial perf tools 2026-08-07 00:45:56 -07:00
codegirl007 b32255ebc5 fix CI 2026-08-06 23:40:19 -07:00
codegirl007 e6be17fb71 initial perf tools 2026-08-03 13:45:59 -07:00
codegirl007 85d475314f Add more tests + explicit failure messages 2026-08-03 00:40:36 -07:00
codegirl007 4dced062a5 Add missing changes that causes failures 2026-08-03 00:39:30 -07:00
codegirl007 cf888f26cd Add explicit failure reasons to tests 2026-08-02 23:53:34 -07:00
codegirl007 248e57d3f0 add more tests 2026-08-02 23:50:37 -07:00
codegirl007 3539943e4e Adding more examples so that we have a good basis on how to do things 2026-08-02 23:46:18 -07:00
codegirl007 209e774230 add missing input file 2026-08-02 23:45:02 -07:00
codegirl007 4dc173ecee Add associated make commands for added examples 2026-08-02 23:37:29 -07:00
codegirl007 5041753bad add more examples 2026-08-02 23:37:29 -07:00
codegirl007 9e680c62fe Initial Camera implementation 2026-08-01 23:53:08 -07:00
codegirl007 589f2bd45c camera 2026-08-01 23:50:03 -07:00
codegirl007 c720774c79 sprite batching
Batch adjacent same-texture sprite draws in end_frame.
Replaces per-sprite DrawGPUPrimitives with texture runs so shared atlases issue one GPU draw.
2026-08-01 23:49:06 -07:00
codegirl007 c1f3d0e61b revert example testing 2026-08-01 23:27:08 -07:00
codegirl007 a85380fb71 sprite batching 2026-08-01 23:25:17 -07:00
codegirl007 21d2a2c0e4 trim atlas of excess transparent pixels from pngs 2026-08-01 12:42:21 -07:00
codegirl007 d488161433 trim atlas of excess transparent pixels 2026-08-01 12:34:11 -07:00
codegirl007 49a3b8a682 queue drawing
- `draw_sprite` now builds verts on the CPU and appends to a per-frame draw list instead of uploading mid-render-pass.
- `begin_frame` only acquires the command buffer / swapchain; `end_frame` does one copy pass on that same buffer, then the render pass, then submit.
- Removes the second command buffer + `WaitForGPUFences` that stalled the CPU once per sprite every frame.
- Vertex/transfer buffers sized for `MAX_SPRITES` (128). Example API unchanged: `begin_frame` → `draw_sprite` → `end_frame`.
2026-08-01 12:15:43 -07:00
codegirl007 35420b7344 queue drawing 2026-08-01 12:10:19 -07:00
codegirl007 2c209da3b2 Merge pull request #7 from Codegirl-Games/sprite-flipping-movement
Movement and sprite flipping
2026-08-01 12:03:41 -07:00
codegirl007 5040446ec1 movement and sprite flipping 2026-08-01 12:01:17 -07:00
codegirl007 269578548a Determine pivot based on manifest 2026-08-01 11:48:55 -07:00
codegirl007 90da5934d7 determine pivot based on manifest 2026-08-01 10:37:36 -07:00
codegirl007 4aa3ed6ed8 Merge pull request #5 from Codegirl-Games/animation
Add sprite clip animation player + unit tests
2026-08-01 08:40:32 -07:00
codegirl007 fbae54aef0 animation + test 2026-08-01 08:27:44 -07:00
codegirl007 eea672023f Set up github to run tests 2026-08-01 01:13:12 -07:00
codegirl007 3a8c2ee830 change the way we install sdl 2026-08-01 01:10:37 -07:00
codegirl007 a1fa9863b6 Set up github to run tests 2026-08-01 01:06:05 -07:00
codegirl007 d5ef7f478e Add initial unit tests
- Pulled pure logic out of GPU-facing code so it can be tested without a window: parse_char_def (JSON → Char_Def) and choose_shader_runtime_from_formats (MSL → DXIL → SPIR-V preference)
- Added eight Odin @(test) cases in engine/ covering happy/bad JSON parse, frame-rect hit/miss/OOB, clip-space conversion corners, shader filename mapping, and backend selection
- Added make test to run odin test engine
2026-08-01 01:04:31 -07:00
codegirl007 71d3ce4041 small edit to makefile 2026-08-01 01:03:16 -07:00
codegirl007 fca6bd0945 add unit tests 2026-08-01 00:59:18 -07:00
codegirl007 22cca621f7 Add shader backend + support for multiple shader formats- #2
Adds a runtime GPU shader-backend selection layer so the engine is no longer hardcoded to #load SPIR-V only.

- Introduce Shader_Runtime / choose_shader_runtime (engine/shader_backend.odin)
- Create the GPU device with {.SPIRV, .DXIL, .MSL}, then pick a supported format + shaders/<backend>/ directory
- Load shader blobs from disk and build the sprite pipeline with the chosen format/entrypoint
- Add shader build scripts + Makefile targets (shaders-vulkan / d3d12 / metal / all)
2026-08-01 00:57:32 -07:00
codegirl007 06ade6a4b7 minor clean up to app.odin 2026-08-01 00:46:37 -07:00
codegirl007 fee46730b1 add shader backend + support for multiple shader formats 2026-08-01 00:41:50 -07:00
codegirl007 1a7b777b0f Initial pipeline work
Migrates the toad example from SDL’s 2D Renderer API to SDL_GPU, keeping the same Character_Data / Sprite engine API and baked asset pipeline.

- Replaces CreateWindowAndRenderer / RenderTexture with GPU device + swapchain framing (begin_frame / end_frame)
- Adds sprite vertex/fragment GLSL shaders and compiled SPIR-V (shaders/sprite.*.glsl / .spv)
- Uploads atlas PNGs as GPUTexture via transfer buffer + copy pass (with fence sync)
- Draws sprites as UV quads (DrawGPUPrimitives) using atlas frame rects from char.json
2026-07-31 19:17:47 -07:00
codegirl007 ebb6ea383f Initial pipeline work 2026-07-31 19:11:19 -07:00
codegirl007 742cfcff6a abstracting to engine package 2026-07-28 21:20:47 -07:00
codegirl007 fc1c39f4f2 render one frame only 2026-07-27 22:32:12 -07:00
codegirl007 33eb055c87 Load and render an atlas 2026-07-27 22:04:35 -07:00
codegirl007 b28c23279b example of rendering a window in SDL3 2026-07-27 21:44:45 -07:00
codegirl007 404e1d86df asset pipeline for packing sprites 2026-07-27 21:32:28 -07:00