Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1#define_import_path bevy_gaussian_splatting::bindings
3#import bevy_pbr::prepass_bindings::PreviousViewUniforms
4#import bevy_render::globals::Globals
5#import bevy_render::view::View
8@group(0) @binding(0) var<uniform> view: View;
9@group(0) @binding(1) var<uniform> globals: Globals;
10@group(0) @binding(2) var<uniform> previous_view_uniforms: PreviousViewUniforms;
12@group(0) @binding(14) var<storage> visibility_ranges: array<vec4<f32>>;
14struct GaussianUniforms {
15 transform: mat4x4<f32>,
16 global_opacity: f32,
17 global_scale: f32,
18 count: u32,
19 count_root_ceil: u32,
20 time: f32,
21 time_start: f32,
22 time_stop: f32,
23 num_classes: u32,
24 min: vec4<f32>,
25 max: vec4<f32>,
26};
27@group(1) @binding(0) var<uniform> gaussian_uniforms: GaussianUniforms;
30#ifdef GAUSSIAN_3D_STRUCTURE
31 #ifdef PACKED_F32
32 struct Gaussian {
33 @location(0) rotation: vec4<f32>,
34 @location(1) position_visibility: vec4<f32>,
35 @location(2) scale_opacity: vec4<f32>,
36 sh: array<f32, #{SH_COEFF_COUNT}>,
37 };
39 #ifdef READ_WRITE_POINTS
40 @group(2) @binding(0) var<storage, read_write> points: array<Gaussian>;
41 #else
42 @group(2) @binding(0) var<storage, read> points: array<Gaussian>;
43 #endif
44 #endif
47 #ifdef PLANAR_F32
48 #ifdef READ_WRITE_POINTS
49 @group(2) @binding(0) var<storage, read_write> position_visibility: array<vec4<f32>>;
50 #else
51 @group(2) @binding(0) var<storage, read> position_visibility: array<vec4<f32>>;
52 #endif
54 @group(2) @binding(1) var<storage, read> spherical_harmonics: array<array<f32, #{SH_COEFF_COUNT}>>;
56 #ifdef PRECOMPUTE_COVARIANCE_3D
57 @group(2) @binding(2) var<storage, read> covariance_3d_opacity: array<array<f32, 8>>;
58 #else
59 @group(2) @binding(2) var<storage, read> rotation: array<vec4<f32>>;
60 @group(2) @binding(3) var<storage, read> scale_opacity: array<vec4<f32>>;
61 #endif
62 #endif
65 #ifdef PLANAR_F16
66 #ifdef READ_WRITE_POINTS
67 @group(2) @binding(0) var<storage, read_write> position_visibility: array<vec4<f32>>;
68 #else
69 @group(2) @binding(0) var<storage, read> position_visibility: array<vec4<f32>>;
70 #endif
72 @group(2) @binding(1) var<storage, read> spherical_harmonics: array<array<u32, #{HALF_SH_COEFF_COUNT}>>;
74 #ifdef PRECOMPUTE_COVARIANCE_3D
75 @group(2) @binding(2) var<storage, read> covariance_3d_opacity: array<vec4<u32>>;
76 #else
77 @group(2) @binding(2) var<storage, read> rotation_scale_opacity: array<vec4<u32>>;
78 #endif
79 #endif
82 #ifdef PLANAR_TEXTURE_F16
83 @group(2) @binding(0) var position_visibility: texture_2d<f32>;
85 #if SH_VEC4_PLANES == 1
86 @group(2) @binding(1) var spherical_harmonics: texture_2d<u32>;
87 #else
88 @group(2) @binding(1) var spherical_harmonics: texture_2d_array<u32>;
89 #endif
91 #ifdef PRECOMPUTE_COVARIANCE_3D
92 @group(2) @binding(2) var covariance_3d_opacity: texture_2d<u32>;
93 #else
94 @group(2) @binding(2) var rotation_scale_opacity: texture_2d<u32>;
95 #endif
96 #endif
99 #ifdef PLANAR_TEXTURE_F32
100 @group(2) @binding(0) var position_visibility: texture_2d<f32>;
102 #if SH_VEC4_PLANES == 1
103 @group(2) @binding(1) var spherical_harmonics: texture_2d<f32>;
104 #else
105 @group(2) @binding(1) var spherical_harmonics: texture_2d_array<f32>;
106 #endif
108 // TODO: support f32_cov3d_opacity texture
110 @group(2) @binding(2) var rotation_scale_opacity: texture_2d<f32>;
111 #endif
112#else ifdef GAUSSIAN_4D
113 #ifdef PLANAR_F32
114 #ifdef READ_WRITE_POINTS
115 @group(2) @binding(0) var<storage, read_write> position_visibility: array<vec4<f32>>;
116 #else
117 @group(2) @binding(0) var<storage, read> position_visibility: array<vec4<f32>>;
118 #endif
120 @group(2) @binding(1) var<storage, read> spherindrical_harmonics: array<array<f32, #{SH_4D_COEFF_COUNT}>>;
122 @group(2) @binding(2) var<storage, read> isotropic_rotations: array<array<f32, 8>>;
123 @group(2) @binding(3) var<storage, read> scale_opacity: array<vec4<f32>>;
124 @group(2) @binding(4) var<storage, read> timestamp_timescale: array<vec4<f32>>;
125 #endif
126#endif
129struct DrawIndirect {
130 vertex_count: u32,
131 instance_count: atomic<u32>,
132 base_vertex: u32,
133 base_instance: u32,
136struct Entry {
137 key: u32,
138 value: u32,
Contents