forked from 1b-agent/opencadstudio-upstream
refactor: remove the legacy full view_proj (CPU cull now relative-to-eye)
The GPU draws exclusively via the rotation-only `view_rot` + eye double- single; the full view-projection survived only to project AABBs in the CPU frustum-cull / scissor / LOD passes. Migrate those to the same relative-to-eye math (project `point - eye` through `view_rot`) — pixel- equivalent but precise at UTM scale — then drop the dead uniform: - pipeline cull/scissor/LOD helpers take (view_rot, eye) instead of the full view_proj; render.rs reconstructs eye from the uniform's eye_high/eye_low and passes the cropped view_rot. - Remove the `view_proj` field from the shared Uniforms struct and all six shader structs that only declared it for layout (none read it), and delete Camera::view_proj(). The struct shrinks by one mat4 on both sides, keeping the Rust / WGSL layouts in lock-step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
5a8ec35f4f
commit
04c93df2c4
10 files changed
+57
-80
No files matched your search
@@ -4,11 +4,6 @@ use iced::Rectangle;
|
||||
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
|
||||
#[repr(C)]
|
||||
pub struct Uniforms {
|
||||
/// Full view-projection (with translation) — GPU rendering no longer uses
|
||||
/// this; it remains for the CPU-side frustum-cull / scissor / LOD passes
|
||||
/// that project offset-relative AABBs to screen. The GPU draws via the
|
||||
/// relative-to-eye `view_rot` + `eye_high`/`eye_low` below.
|
||||
pub view_proj: glam::Mat4,
|
||||
pub viewport_size: [f32; 2],
|
||||
/// World units per screen pixel at the current zoom. Used by the
|
||||
/// hatch shader to substitute solid fill when pattern line spacing
|
||||
@@ -54,7 +49,6 @@ impl Uniforms {
|
||||
};
|
||||
let (eye_high, eye_low) = camera.eye_high_low();
|
||||
Self {
|
||||
view_proj: camera.view_proj(bounds),
|
||||
viewport_size: [bounds.width, bounds.height],
|
||||
world_per_pixel,
|
||||
lwdisplay_enable: if lwdisplay_enable { 1.0 } else { 0.0 },
|
||||
|
||||
Reference in new issue
Block a user