shame icon indicating copy to clipboard operation
shame copied to clipboard

add explicit `#[gpu_repr(storage)]` attribute to `#[derive(GpuLayout)]`

Open RayMarch opened this issue 5 months ago • 0 comments

Right now, the WGSL storage layout is the default layout applied to structs when #[derive(GpuLayout)] is used. For consistency, and to allow maybe adding a #[gpu_repr(uniform)] in the future, the following changes need to be made:

  • rename TypeLayoutRules::Wgsl to TypeLayoutRules::Storage
  • rename TypeLayoutRules to shame::mem::Repr
  • add a shame::mem::Repr argument to conversions from the ir::Type family to TypeLayout
  • add a #[gpu_repr(storage)] attribute similar to the existing #[gpu_repr(packed)] to #[derive(GpuLayout)]

RayMarch avatar May 17 '25 06:05 RayMarch