diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-13 08:34:24 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-13 08:34:24 +0100 |
| commit | a109983c194c45ad85f0e481232bc605c7cfd85b (patch) | |
| tree | 2b2fadb054fb8ea52d3e31fefdc4678d5a3ed7dc /workspaces/main/shaders/ray_box.wgsl | |
| parent | 3ce45fcf073047d71ed0b2c88f4d6c5362f6b620 (diff) | |
Remediation: Implement shared common/shaders/ directory
Eliminates 36 duplicate shader files across workspaces.
Structure:
- common/shaders/{math,render,compute}/ - Shared utilities (20 files)
- workspaces/*/shaders/ - Workspace-specific only
Changes:
- Created common/shaders/ with math, render, compute subdirectories
- Moved 20 common shaders from workspaces to common/
- Removed duplicates from test workspace
- Updated assets.txt: ../../common/shaders/ references
- Enhanced asset_packer.cc: filesystem path normalization for ../ resolution
Implementation: Option 1 from SHADER_REUSE_INVESTIGATION.md
- Single source of truth for common code
- Workspace references via relative paths
- Path normalization in asset packer
handoff(Claude): Common shader directory implemented
Diffstat (limited to 'workspaces/main/shaders/ray_box.wgsl')
| -rw-r--r-- | workspaces/main/shaders/ray_box.wgsl | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/workspaces/main/shaders/ray_box.wgsl b/workspaces/main/shaders/ray_box.wgsl deleted file mode 100644 index d56ea1b..0000000 --- a/workspaces/main/shaders/ray_box.wgsl +++ /dev/null @@ -1,16 +0,0 @@ -struct RayBounds { - t_entry: f32, - t_exit: f32, - hit: bool, -}; - -fn ray_box_intersection(ro: vec3<f32>, rd: vec3<f32>, extent: vec3<f32>) -> RayBounds { - let inv_rd = 1.0 / rd; - let t0 = (-extent - ro) * inv_rd; - let t1 = (extent - ro) * inv_rd; - let tmin_vec = min(t0, t1); - let tmax_vec = max(t0, t1); - let t_entry = max(0.0, max(tmin_vec.x, max(tmin_vec.y, tmin_vec.z))); - let t_exit = min(tmax_vec.x, min(tmax_vec.y, tmax_vec.z)); - return RayBounds(t_entry, t_exit, t_entry <= t_exit); -} |
