Add documentation for recent functions
CI / cargo fmt (push) Successful in 28s
CI / cargo test (push) Successful in 14m23s
CI / cargo test (GPU) (push) Successful in 13m26s

This commit is contained in:
2026-06-28 15:03:52 -04:00
parent c3224fadd8
commit 3c5563c940
6 changed files with 61 additions and 12 deletions
+6 -8
View File
@@ -107,23 +107,21 @@ impl<'a, R: Rng> Iterator for ChaosGame<'a, R> {
}
}
/// Shader entry point for running the chaos game to produce new IFS coordinates
pub mod entry {
use crate::chaos_game::ChaosGame;
use crate::rng::xoshiro_from_state;
use crate::transform::Transform;
use crate::variation::Variation;
use glam::Vec2;
use rand_xoshiro::Xoshiro256StarStar;
use spirv_std::spirv;
fn xoshiro_from_state(rng_state: [u8; 32]) -> Xoshiro256StarStar {
let mut rng_state_actual = [1u64, 2u64, 3u64, 4u64];
unsafe { core::mem::transmute(rng_state_actual) }
}
/// Given a set of fractal flame parameters, generate new IFS coordinates
/// and store them in the output array.
#[spirv(compute(entry_point_name = "main_chaos_game", threads(1)))]
pub extern "C" fn main_chaos_game(
pub fn main_chaos_game(
#[spirv(spec_constant(id = 1, default = 20))] iteration_discard: u32,
#[spirv(storage_buffer, descriptor_set = 0, binding = 0)] rng_seed: &[u8],
#[spirv(storage_buffer, descriptor_set = 0, binding = 0)] _rng_seed: &[u8],
#[spirv(storage_buffer, descriptor_set = 0, binding = 1)] transforms: &[Transform],
#[spirv(storage_buffer, descriptor_set = 0, binding = 2)] weights: &[f32],
#[spirv(storage_buffer, descriptor_set = 0, binding = 3)] variations: &[Variation],