Reorganize layout, pass a new buffer
This commit is contained in:
@ -63,10 +63,21 @@ pub(crate) fn image_index(pixel_x: usize, pixel_y: usize, image_width: u32) -> u
|
||||
pixel_x + pixel_y * image_width as usize
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
|
||||
#[repr(C)]
|
||||
pub struct Transform {
|
||||
variation_offset: u32,
|
||||
variation_count: u32,
|
||||
weight: f32,
|
||||
color: f32,
|
||||
color_speed: f32,
|
||||
}
|
||||
|
||||
#[spirv(compute(threads(1)))]
|
||||
pub fn main_cs(
|
||||
#[spirv(push_constant)] constants: &IfsConstants,
|
||||
#[spirv(storage_buffer, descriptor_set = 0, binding = 0)] accum_image: &mut [Vec4],
|
||||
#[spirv(storage_buffer, descriptor_set = 0, binding = 0)] transforms: &[Transform],
|
||||
#[spirv(storage_buffer, descriptor_set = 0, binding = 1)] accum_image: &mut [Vec4],
|
||||
) {
|
||||
let block_size = 64;
|
||||
for i_width in 0..constants.accum_width as usize {
|
||||
|
Reference in New Issue
Block a user