summaryrefslogtreecommitdiff
path: root/TODO.md
blob: 5e77d74c90afeb9718a3d0f1620a1d85c7c956b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# To-Do List

This file tracks the next set of immediate, actionable tasks for the project.

## Next Up

-   **Task #8: Implement Final Build Stripping**
    - [ ] Define and document a consistent set of rules for code stripping under the `STRIP_ALL` macro.
    - [ ] Example sub-tasks: remove unused functions, strip debug fields from structs, simplify code paths where possible.

-   **Task #19: Update README.md with Quick Start**
    - [ ] Add a top-level "Quick Start" section to `README.md` with brief build and run instructions for `demo64k`.

-   ** Task #?: scripts/build_win.sh is always copying MinGW DLLs file ("Copy MinGW DLLs"). Add a check on date or file size to prevent useless systematic copy.

-   ** Task #?: Code hygiene
    - [ ] make a pass on the code and make sure all useless code is protected by STRIP_ALL #ifdef's
    - [ ] analyze the #include and check if some standard header inclusion could be removed (<algorithm>, etc.)
    - [ ] see if all usage of std structs, container, etc. are appropriate:
           == is this std::map<> needed?
           == could we remove this std::set<>?
           == Can this std::vector<T> be replaced by a simple C-like "const T*" array?
           == are these std::string needed or can they be replaced by some 'const char*' ?
           == do we need these std::cout, std::cerr, etc. instead of printf()'s?
           == etc.
    - [ ] the inclusion of gpu.h (either "gpu.h" or <webgpu/gpu.h>) seems to be a recurring compilation and portability issue. Can we have a single inclusion of gpu.h in some platform header instead of scattered inclusion in .cc files? This would reduce the single-point-of-compilation failures during compilation and portability checks.

-   ** Task #?: platform-specific code hygiene
    There's several platform-specific code scattered over several source files (.cc and .h)
    For instance:
```cpp
#if defined(DEMO_CROSS_COMPILE_WIN32)
#include <webgpu/webgpu.h>
#else
#include <webgpu.h>
#endif /* defined(DEMO_CROSS_COMPILE_WIN32) */
```
    This sort of code should be gathered at once single place (platform.h?) once for all.
    - [ ] => Make all cross-compile and platform-specific conditional code sit in one single header file.

-   ** Task #?: platform_init() should return a PlatformState directly instead of taking a PlatformState& parameter to write into
    - [ ] maybe incorporate the platform time (platform_get_time()) into the PlatformState directly during platform_poll() call?
    - [ ] same with aspect_ratio (platform_get_aspect_ratio()) unless it's not an invariant and the function needs to be called each time

-   ** Task #?: shader code factorization with macros
    The shader code is rapidly growing big and hairy. We can probably use macros to factorize most common code (normal calc? bump mapping? sampling?) to reduce the code boilerplate.

-   ** Task #?: the SDF calculation should be passed min-distance and max-distance parameters derived from the bounding box hit. This is to narrow the ray-marching and reduce the number of iterations if possible.


## Future Goals

-   **Task #5: Implement Spectrogram Editor**
    - [ ] Develop a web-based tool (`tools/editor`) for creating and editing `.spec` files visually.
    - [ ] The tool should support generating `.spec` files from elementary shapes (lines, curves) for extreme compression.
-   **Phase 2: Advanced Size Optimization**
    - [ ] Replace GLFW with a minimal native Windows API layer.
    - [ ] Investigate and implement advanced asset compression techniques (e.g., logarithmic frequency, quantization).
    - [ ] Explore replacing the standard C/C++ runtime with a more lightweight alternative.

## Past Tasks

-   Centralize generated files into `src/generated`.
-   Vertically compact C++ source code.
-   Create top-level `README.md`.
-   Move non-essential documentation to `doc/`.
-   **Bug Fixes:** 
    - Resolved high-DPI "squished" rendering by implementing dynamic resolution uniforms and explicit viewport settings.
    - Fixed missing 3D shadows by unifying all objects (including the floor) under the SDF raymarching path, using 'inv_model' for accurate world-to-local transformations, and implementing robust instance-based self-shadowing prevention.
-   **Code Hygiene:** Completed a project-wide code formatting pass with `clang-format`.
-   **Task #4b:** Create `scripts/check_all.sh` to build and test all platform targets (macOS, Windows, Linux) to ensure stability before commits.
-   **Task #10:** Modify `spectool` to trim leading and trailing silent frames from `.spec` files to reduce asset size.