#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct ColormapId(pub usize);
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct VolumeId(pub(crate) usize);
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AttributeKind {
Vertex,
Cell,
}
#[derive(Debug, Clone)]
pub struct AttributeRef {
pub name: String,
pub kind: AttributeKind,
}
#[derive(Debug, Clone)]
pub enum AttributeData {
Vertex(Vec<f32>),
Cell(Vec<f32>),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BuiltinColormap {
Viridis = 0,
Plasma = 1,
Greyscale = 2,
Coolwarm = 3,
Rainbow = 4,
}
#[non_exhaustive]
pub struct MeshData {
pub positions: Vec<[f32; 3]>,
pub normals: Vec<[f32; 3]>,
pub indices: Vec<u32>,
pub uvs: Option<Vec<[f32; 2]>>,
pub tangents: Option<Vec<[f32; 4]>>,
pub attributes: std::collections::HashMap<String, AttributeData>,
}
impl Default for MeshData {
fn default() -> Self {
Self {
positions: Vec::new(),
normals: Vec::new(),
indices: Vec::new(),
uvs: None,
tangents: None,
attributes: std::collections::HashMap::new(),
}
}
}
impl MeshData {
pub fn compute_aabb(&self) -> crate::scene::aabb::Aabb {
crate::scene::aabb::Aabb::from_positions(&self.positions)
}
}
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub struct Vertex {
pub position: [f32; 3],
pub normal: [f32; 3],
pub color: [f32; 4],
pub uv: [f32; 2],
pub tangent: [f32; 4],
}
impl Vertex {
pub fn buffer_layout() -> wgpu::VertexBufferLayout<'static> {
wgpu::VertexBufferLayout {
array_stride: std::mem::size_of::<Vertex>() as wgpu::BufferAddress,
step_mode: wgpu::VertexStepMode::Vertex,
attributes: &[
wgpu::VertexAttribute {
offset: 0,
shader_location: 0,
format: wgpu::VertexFormat::Float32x3,
},
wgpu::VertexAttribute {
offset: 12,
shader_location: 1,
format: wgpu::VertexFormat::Float32x3,
},
wgpu::VertexAttribute {
offset: 24,
shader_location: 2,
format: wgpu::VertexFormat::Float32x4,
},
wgpu::VertexAttribute {
offset: 40,
shader_location: 3,
format: wgpu::VertexFormat::Float32x2,
},
wgpu::VertexAttribute {
offset: 48,
shader_location: 4,
format: wgpu::VertexFormat::Float32x4,
},
],
}
}
}
pub(crate) const SHADOW_ATLAS_SIZE: u32 = 4096;
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub struct CameraUniform {
pub view_proj: [[f32; 4]; 4],
pub eye_pos: [f32; 3],
pub _pad: f32,
pub forward: [f32; 3],
pub _pad1: f32,
}
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub struct SingleLightUniform {
pub light_view_proj: [[f32; 4]; 4], pub pos_or_dir: [f32; 3], pub light_type: u32, pub color: [f32; 3], pub intensity: f32, pub range: f32, pub inner_angle: f32, pub outer_angle: f32, pub _pad_align: u32, pub spot_direction: [f32; 3], pub _pad: [f32; 5], }
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub struct LightsUniform {
pub count: u32, pub shadow_bias: f32, pub shadows_enabled: u32, pub _pad: u32, pub sky_color: [f32; 3], pub hemisphere_intensity: f32, pub ground_color: [f32; 3], pub _pad2: f32, pub lights: [SingleLightUniform; 8], }
pub type LightUniform = LightsUniform;
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct ObjectUniform {
pub(crate) model: [[f32; 4]; 4], pub(crate) color: [f32; 4], pub(crate) selected: u32, pub(crate) wireframe: u32, pub(crate) ambient: f32, pub(crate) diffuse: f32, pub(crate) specular: f32, pub(crate) shininess: f32, pub(crate) has_texture: u32, pub(crate) use_pbr: u32, pub(crate) metallic: f32, pub(crate) roughness: f32, pub(crate) has_normal_map: u32, pub(crate) has_ao_map: u32, pub(crate) has_attribute: u32, pub(crate) scalar_min: f32, pub(crate) scalar_max: f32, pub(crate) _pad_scalar: u32, pub(crate) nan_color: [f32; 4], pub(crate) use_nan_color: u32, pub(crate) _pad_nan: [u32; 3], }
const _: () = assert!(std::mem::size_of::<ObjectUniform>() == 176);
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct InstanceData {
pub(crate) model: [[f32; 4]; 4], pub(crate) color: [f32; 4], pub(crate) selected: u32, pub(crate) wireframe: u32, pub(crate) ambient: f32, pub(crate) diffuse: f32, pub(crate) specular: f32, pub(crate) shininess: f32, pub(crate) has_texture: u32, pub(crate) use_pbr: u32, pub(crate) metallic: f32, pub(crate) roughness: f32, pub(crate) has_normal_map: u32, pub(crate) has_ao_map: u32, }
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct PickInstance {
pub(crate) model_c0: [f32; 4],
pub(crate) model_c1: [f32; 4],
pub(crate) model_c2: [f32; 4],
pub(crate) model_c3: [f32; 4],
pub(crate) object_id: u32,
pub(crate) _pad: [u32; 3],
}
const _: () = assert!(std::mem::size_of::<PickInstance>() == 80);
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct ClipPlanesUniform {
pub(crate) planes: [[f32; 4]; 6], pub(crate) count: u32, pub(crate) _pad0: u32, pub(crate) viewport_width: f32, pub(crate) viewport_height: f32, }
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub struct ClipVolumeUniform {
pub volume_type: u32,
pub _pad0: [u32; 3],
pub plane_normal: [f32; 3],
pub plane_dist: f32,
pub box_center: [f32; 3],
pub _pad1: f32,
pub box_half_extents: [f32; 3],
pub _pad2: f32,
pub box_col0: [f32; 3],
pub _pad3: f32,
pub box_col1: [f32; 3],
pub _pad4: f32,
pub box_col2: [f32; 3],
pub _pad5: f32,
pub sphere_center: [f32; 3],
pub sphere_radius: f32,
}
impl ClipVolumeUniform {
pub fn from_clip_volume(v: &crate::renderer::ClipVolume) -> Self {
let mut u: Self = bytemuck::Zeroable::zeroed();
match v {
crate::renderer::ClipVolume::None => {
u.volume_type = 0;
}
crate::renderer::ClipVolume::Plane { normal, distance } => {
u.volume_type = 1;
u.plane_normal = *normal;
u.plane_dist = *distance;
}
crate::renderer::ClipVolume::Box {
center,
half_extents,
orientation,
} => {
u.volume_type = 2;
u.box_center = *center;
u.box_half_extents = *half_extents;
u.box_col0 = orientation[0];
u.box_col1 = orientation[1];
u.box_col2 = orientation[2];
}
crate::renderer::ClipVolume::Sphere { center, radius } => {
u.volume_type = 3;
u.sphere_center = *center;
u.sphere_radius = *radius;
}
}
u
}
}
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct OutlineUniform {
pub(crate) model: [[f32; 4]; 4], pub(crate) color: [f32; 4], pub(crate) pixel_offset: f32, pub(crate) _pad: [f32; 3], }
pub(crate) struct OutlineObjectBuffers {
pub mesh_index: usize,
pub _stencil_uniform_buf: wgpu::Buffer,
pub stencil_bind_group: wgpu::BindGroup,
pub _outline_uniform_buf: wgpu::Buffer,
pub outline_bind_group: wgpu::BindGroup,
}
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct ToneMapUniform {
pub(crate) exposure: f32,
pub(crate) mode: u32, pub(crate) bloom_enabled: u32,
pub(crate) ssao_enabled: u32,
pub(crate) contact_shadows_enabled: u32,
pub(crate) _pad_tm: [u32; 3],
}
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct BloomUniform {
pub(crate) threshold: f32,
pub(crate) intensity: f32,
pub(crate) horizontal: u32, pub(crate) _pad: u32,
}
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct SsaoUniform {
pub(crate) inv_proj: [[f32; 4]; 4], pub(crate) proj: [[f32; 4]; 4], pub(crate) radius: f32,
pub(crate) bias: f32,
pub(crate) _pad: [f32; 2],
}
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct ShadowAtlasUniform {
pub(crate) cascade_view_proj: [[f32; 4]; 16], pub(crate) cascade_splits: [f32; 4], pub(crate) cascade_count: u32, pub(crate) atlas_size: f32, pub(crate) shadow_filter: u32, pub(crate) pcss_light_radius: f32, pub(crate) atlas_rects: [[f32; 4]; 8], }
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct ContactShadowUniform {
pub(crate) inv_proj: [[f32; 4]; 4], pub(crate) proj: [[f32; 4]; 4], pub(crate) light_dir_view: [f32; 4], pub(crate) world_up_view: [f32; 4], pub(crate) params: [f32; 4], }
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub struct OverlayVertex {
pub position: [f32; 3],
}
impl OverlayVertex {
pub fn buffer_layout() -> wgpu::VertexBufferLayout<'static> {
wgpu::VertexBufferLayout {
array_stride: std::mem::size_of::<OverlayVertex>() as wgpu::BufferAddress,
step_mode: wgpu::VertexStepMode::Vertex,
attributes: &[wgpu::VertexAttribute {
offset: 0,
shader_location: 0,
format: wgpu::VertexFormat::Float32x3,
}],
}
}
}
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct OverlayUniform {
pub(crate) model: [[f32; 4]; 4],
pub(crate) color: [f32; 4], }
#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub(crate) struct GridUniform {
pub view_proj: [[f32; 4]; 4], pub cam_to_world: [[f32; 4]; 3], pub tan_half_fov: f32, pub aspect: f32, pub _pad_ivp: [f32; 2], pub eye_pos: [f32; 3], pub grid_y: f32, pub spacing_minor: f32, pub spacing_major: f32, pub snap_origin: [f32; 2], pub color_minor: [f32; 4], pub color_major: [f32; 4], }
pub struct GpuTexture {
pub texture: wgpu::Texture,
pub view: wgpu::TextureView,
pub sampler: wgpu::Sampler,
pub bind_group: wgpu::BindGroup,
}
pub struct GpuMesh {
pub vertex_buffer: wgpu::Buffer,
pub index_buffer: wgpu::Buffer,
pub index_count: u32,
pub edge_index_buffer: wgpu::Buffer,
pub edge_index_count: u32,
pub normal_line_buffer: Option<wgpu::Buffer>,
pub normal_line_count: u32,
pub object_uniform_buf: wgpu::Buffer,
pub object_bind_group: wgpu::BindGroup,
pub(crate) last_tex_key: (u64, u64, u64, u64, u64),
pub attribute_buffers: std::collections::HashMap<String, wgpu::Buffer>,
pub attribute_ranges: std::collections::HashMap<String, (f32, f32)>,
pub normal_uniform_buf: wgpu::Buffer,
pub normal_bind_group: wgpu::BindGroup,
pub aabb: crate::scene::aabb::Aabb,
pub(crate) cpu_positions: Option<Vec<[f32; 3]>>,
pub(crate) cpu_indices: Option<Vec<u32>>,
}
pub(crate) struct GlyphBaseMesh {
pub vertex_buffer: wgpu::Buffer,
pub index_buffer: wgpu::Buffer,
pub index_count: u32,
}
pub struct PointCloudGpuData {
pub(crate) vertex_buffer: wgpu::Buffer,
pub(crate) point_count: u32,
pub(crate) bind_group: wgpu::BindGroup,
pub(crate) _uniform_buf: wgpu::Buffer,
pub(crate) _scalar_buf: wgpu::Buffer,
pub(crate) _color_buf: wgpu::Buffer,
}
pub struct PolylineGpuData {
pub(crate) vertex_buffer: wgpu::Buffer,
#[allow(dead_code)]
pub(crate) vertex_count: u32,
pub(crate) strip_ranges: Vec<std::ops::Range<u32>>,
pub(crate) bind_group: wgpu::BindGroup,
pub(crate) _uniform_buf: wgpu::Buffer,
}
pub struct GlyphGpuData {
pub(crate) mesh_vertex_buffer: &'static wgpu::Buffer,
pub(crate) mesh_index_buffer: &'static wgpu::Buffer,
pub(crate) mesh_index_count: u32,
pub(crate) instance_count: u32,
pub(crate) uniform_bind_group: wgpu::BindGroup,
pub(crate) instance_bind_group: wgpu::BindGroup,
pub(crate) _uniform_buf: wgpu::Buffer,
pub(crate) _instance_buf: wgpu::Buffer,
}
pub struct StreamtubeGpuData {
pub(crate) mesh_vertex_buffer: &'static wgpu::Buffer,
pub(crate) mesh_index_buffer: &'static wgpu::Buffer,
pub(crate) mesh_index_count: u32,
pub(crate) instance_count: u32,
pub(crate) uniform_bind_group: wgpu::BindGroup,
pub(crate) instance_bind_group: wgpu::BindGroup,
pub(crate) _uniform_buf: wgpu::Buffer,
pub(crate) _instance_buf: wgpu::Buffer,
}
pub struct VolumeGpuData {
pub(crate) bind_group: wgpu::BindGroup,
pub(crate) vertex_buffer: wgpu::Buffer,
pub(crate) index_buffer: wgpu::Buffer,
pub(crate) _dims: [u32; 3],
pub(crate) _uniform_buf: wgpu::Buffer,
}
pub struct ViewportGpuResources {
pub target_format: wgpu::TextureFormat,
pub sample_count: u32,
pub solid_pipeline: wgpu::RenderPipeline,
pub solid_two_sided_pipeline: wgpu::RenderPipeline,
pub transparent_pipeline: wgpu::RenderPipeline,
pub wireframe_pipeline: wgpu::RenderPipeline,
pub camera_uniform_buf: wgpu::Buffer,
pub light_uniform_buf: wgpu::Buffer,
pub camera_bind_group: wgpu::BindGroup,
pub camera_bind_group_layout: wgpu::BindGroupLayout,
pub object_bind_group_layout: wgpu::BindGroupLayout,
pub(crate) mesh_store: crate::resources::mesh_store::MeshStore,
pub shadow_map_texture: wgpu::Texture,
pub shadow_map_view: wgpu::TextureView,
pub shadow_sampler: wgpu::Sampler,
pub shadow_pipeline: wgpu::RenderPipeline,
pub shadow_uniform_buf: wgpu::Buffer,
pub shadow_bind_group: wgpu::BindGroup,
pub shadow_info_buf: wgpu::Buffer,
#[allow(dead_code)]
pub(crate) shadow_atlas_size: u32,
pub gizmo_pipeline: wgpu::RenderPipeline,
pub gizmo_vertex_buffer: wgpu::Buffer,
pub gizmo_index_buffer: wgpu::Buffer,
pub gizmo_index_count: u32,
pub gizmo_uniform_buf: wgpu::Buffer,
pub gizmo_bind_group: wgpu::BindGroup,
pub overlay_pipeline: wgpu::RenderPipeline,
pub overlay_line_pipeline: wgpu::RenderPipeline,
pub grid_pipeline: wgpu::RenderPipeline,
pub grid_uniform_buf: wgpu::Buffer,
pub grid_bind_group: wgpu::BindGroup,
pub overlay_bind_group_layout: wgpu::BindGroupLayout,
pub bc_quad_buffers: Vec<(wgpu::Buffer, wgpu::Buffer, wgpu::Buffer, wgpu::BindGroup)>,
pub constraint_line_buffers: Vec<(
wgpu::Buffer,
wgpu::Buffer,
u32,
wgpu::Buffer,
wgpu::BindGroup,
)>,
pub(crate) cap_buffers: Vec<(
wgpu::Buffer,
wgpu::Buffer,
u32,
wgpu::Buffer,
wgpu::BindGroup,
)>,
pub axes_pipeline: wgpu::RenderPipeline,
pub axes_vertex_buffer: wgpu::Buffer,
pub axes_vertex_count: u32,
pub texture_bind_group_layout: wgpu::BindGroupLayout,
pub fallback_texture: GpuTexture,
pub(crate) fallback_normal_map: wgpu::Texture,
pub(crate) fallback_normal_map_view: wgpu::TextureView,
pub(crate) fallback_ao_map: wgpu::Texture,
pub(crate) fallback_ao_map_view: wgpu::TextureView,
pub(crate) material_sampler: wgpu::Sampler,
#[allow(dead_code)]
pub(crate) material_bind_groups: std::collections::HashMap<(u64, u64, u64), wgpu::BindGroup>,
pub textures: Vec<GpuTexture>,
pub(crate) fallback_textures_uploaded: bool,
pub(crate) fxaa_texture: Option<wgpu::Texture>,
pub(crate) fxaa_view: Option<wgpu::TextureView>,
pub(crate) fxaa_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) fxaa_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) fxaa_bind_group: Option<wgpu::BindGroup>,
pub(crate) clip_planes_uniform_buf: wgpu::Buffer,
pub(crate) clip_volume_uniform_buf: wgpu::Buffer,
pub(crate) outline_bind_group_layout: wgpu::BindGroupLayout,
pub(crate) stencil_write_pipeline: wgpu::RenderPipeline,
pub(crate) outline_pipeline: wgpu::RenderPipeline,
pub(crate) xray_pipeline: wgpu::RenderPipeline,
pub(crate) outline_object_buffers: Vec<OutlineObjectBuffers>,
pub(crate) xray_object_buffers: Vec<(usize, wgpu::Buffer, wgpu::BindGroup)>,
pub(crate) outline_color_texture: Option<wgpu::Texture>,
pub(crate) outline_color_view: Option<wgpu::TextureView>,
pub(crate) outline_depth_texture: Option<wgpu::Texture>,
pub(crate) outline_depth_view: Option<wgpu::TextureView>,
pub(crate) outline_target_size: [u32; 2],
pub(crate) outline_composite_pipeline_single: Option<wgpu::RenderPipeline>,
pub(crate) outline_composite_pipeline_msaa: Option<wgpu::RenderPipeline>,
pub(crate) outline_composite_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) outline_composite_bind_group: Option<wgpu::BindGroup>,
pub(crate) outline_composite_sampler: Option<wgpu::Sampler>,
pub(crate) instance_bind_group_layout: Option<wgpu::BindGroupLayout>,
pub(crate) instance_storage_buf: Option<wgpu::Buffer>,
pub(crate) instance_storage_capacity: usize,
pub(crate) instance_bind_groups: std::collections::HashMap<(u64, u64, u64), wgpu::BindGroup>,
pub(crate) solid_instanced_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) transparent_instanced_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) shadow_instanced_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) shadow_instanced_cascade_bufs: [Option<wgpu::Buffer>; 4],
pub(crate) shadow_instanced_cascade_bgs: [Option<wgpu::BindGroup>; 4],
pub(crate) hdr_texture: Option<wgpu::Texture>,
pub(crate) hdr_view: Option<wgpu::TextureView>,
pub(crate) hdr_depth_texture: Option<wgpu::Texture>,
pub(crate) hdr_depth_view: Option<wgpu::TextureView>,
pub(crate) hdr_depth_only_view: Option<wgpu::TextureView>,
pub(crate) hdr_size: [u32; 2],
pub(crate) tone_map_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) tone_map_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) tone_map_bind_group: Option<wgpu::BindGroup>,
pub(crate) tone_map_uniform_buf: Option<wgpu::Buffer>,
pub(crate) bloom_threshold_texture: Option<wgpu::Texture>,
pub(crate) bloom_threshold_view: Option<wgpu::TextureView>,
pub(crate) bloom_ping_texture: Option<wgpu::Texture>,
pub(crate) bloom_ping_view: Option<wgpu::TextureView>,
pub(crate) bloom_pong_texture: Option<wgpu::Texture>,
pub(crate) bloom_pong_view: Option<wgpu::TextureView>,
pub(crate) bloom_threshold_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) bloom_blur_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) bloom_threshold_bg: Option<wgpu::BindGroup>,
pub(crate) bloom_blur_h_bg: Option<wgpu::BindGroup>,
pub(crate) bloom_blur_v_bg: Option<wgpu::BindGroup>,
pub(crate) bloom_blur_h_pong_bg: Option<wgpu::BindGroup>,
pub(crate) bloom_uniform_buf: Option<wgpu::Buffer>,
pub(crate) bloom_h_uniform_buf: Option<wgpu::Buffer>,
pub(crate) bloom_v_uniform_buf: Option<wgpu::Buffer>,
pub(crate) ssao_texture: Option<wgpu::Texture>,
pub(crate) ssao_view: Option<wgpu::TextureView>,
pub(crate) ssao_blur_texture: Option<wgpu::Texture>,
pub(crate) ssao_blur_view: Option<wgpu::TextureView>,
pub(crate) ssao_noise_texture: Option<wgpu::Texture>,
pub(crate) ssao_noise_view: Option<wgpu::TextureView>,
pub(crate) ssao_kernel_buf: Option<wgpu::Buffer>,
pub(crate) ssao_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) ssao_blur_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) ssao_bg: Option<wgpu::BindGroup>,
pub(crate) ssao_blur_bg: Option<wgpu::BindGroup>,
pub(crate) ssao_uniform_buf: Option<wgpu::Buffer>,
pub(crate) contact_shadow_texture: Option<wgpu::Texture>,
pub(crate) contact_shadow_view: Option<wgpu::TextureView>,
pub(crate) contact_shadow_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) contact_shadow_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) contact_shadow_bg: Option<wgpu::BindGroup>,
pub(crate) contact_shadow_uniform_buf: Option<wgpu::Buffer>,
pub(crate) bloom_placeholder_view: Option<wgpu::TextureView>,
pub(crate) ao_placeholder_view: Option<wgpu::TextureView>,
pub(crate) cs_placeholder_view: Option<wgpu::TextureView>,
pub(crate) pp_linear_sampler: Option<wgpu::Sampler>,
pub(crate) pp_nearest_sampler: Option<wgpu::Sampler>,
pub(crate) hdr_solid_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) hdr_solid_two_sided_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) hdr_transparent_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) hdr_wireframe_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) hdr_solid_instanced_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) hdr_transparent_instanced_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) hdr_overlay_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) colormap_textures: Vec<wgpu::Texture>,
pub(crate) colormap_views: Vec<wgpu::TextureView>,
pub(crate) colormaps_cpu: Vec<[[u8; 4]; 256]>,
#[allow(dead_code)]
pub(crate) fallback_lut_texture: wgpu::Texture,
pub(crate) fallback_lut_view: wgpu::TextureView,
pub(crate) fallback_scalar_buf: wgpu::Buffer,
pub(crate) builtin_colormap_ids: Option<[ColormapId; 5]>,
pub(crate) colormaps_initialized: bool,
pub(crate) point_cloud_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) glyph_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) point_cloud_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) glyph_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) glyph_instance_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) glyph_arrow_mesh: Option<GlyphBaseMesh>,
pub(crate) glyph_sphere_mesh: Option<GlyphBaseMesh>,
pub(crate) glyph_cube_mesh: Option<GlyphBaseMesh>,
pub(crate) polyline_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) polyline_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) streamtube_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) streamtube_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) streamtube_instance_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) streamtube_cylinder_mesh: Option<GlyphBaseMesh>,
pub(crate) volume_textures: Vec<(wgpu::Texture, wgpu::TextureView)>,
pub(crate) volume_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) volume_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) volume_cube_vb: Option<wgpu::Buffer>,
pub(crate) volume_cube_ib: Option<wgpu::Buffer>,
pub(crate) volume_default_opacity_lut: Option<wgpu::Texture>,
pub(crate) volume_default_opacity_lut_view: Option<wgpu::TextureView>,
pub(crate) compute_filter_pipeline: Option<wgpu::ComputePipeline>,
pub(crate) compute_filter_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) oit_accum_texture: Option<wgpu::Texture>,
pub(crate) oit_accum_view: Option<wgpu::TextureView>,
pub(crate) oit_reveal_texture: Option<wgpu::Texture>,
pub(crate) oit_reveal_view: Option<wgpu::TextureView>,
pub(crate) oit_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) oit_instanced_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) oit_composite_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) oit_composite_bgl: Option<wgpu::BindGroupLayout>,
pub(crate) oit_composite_bind_group: Option<wgpu::BindGroup>,
pub(crate) oit_composite_sampler: Option<wgpu::Sampler>,
pub(crate) oit_size: [u32; 2],
pub(crate) pick_pipeline: Option<wgpu::RenderPipeline>,
pub(crate) pick_bind_group_layout_1: Option<wgpu::BindGroupLayout>,
pub(crate) pick_camera_bgl: Option<wgpu::BindGroupLayout>,
}