work around the texture parameter thing

This commit is contained in:
2026-10-25 22:58:04 +00:00
parent d18c28d05a
commit 68e57737c0
6 changed files with 23 additions and 22 deletions
@@ -0,0 +1,10 @@
import package::render::metadata_types::TapeMetadata;
// This is to work around that you can't pass textures as parameters, it seems.
@group(0) @binding(4) var spatial_textures: binding_array<texture_3d<f32>>;
@group(0) @binding(5) var spatial_texture_sampler: sampler;
fn spatial_scene(metadata: TapeMetadata, spatial_texture: u32, p: vec4<f32>) -> f32 {
let actual = (p.xyz - metadata.lowest_corner) / metadata.dimensions;
return textureSampleLevel(spatial_textures[spatial_texture], spatial_texture_sampler, actual, 0.0).x;
}