Add documentation for recent functions
This commit is contained in:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user