ITADN

Allow `ptr<storage, T>` as function parameter

#128Openhukasu 创建于 2025-09-03
H
hukasucommented
It seems that the implementation of `wgsl` for `ptr<storage, T>` as function parameters has already been merged, but i don't know much more than that. ``` 2025-09-03T13:51:01.400135Z ERROR bevy_render::render_resource::pipeline_cache: failed to process shader: error: naga_oil bug, please file a report: composer failed to build a valid header: Function [0] 'psycho_materials::color_ramp::color_ramp_constant' is invalid ┌─ crates/psycho_materials/src/shaders/color_ramp.wgsl:8:1 │ 8 │ ╭ fn color_ramp_constant(color_ramp: ptr<storage, array<ColorStop>, read>, factor: f32) -> vec4<f32> { 9 │ │ if arrayLength(color_ramp) == 0 { 10 │ │ return vec4(0.); 11 │ │ } 12 │ │ 13 │ │ return vec4(1.); │ ╰────────────────────^ naga::Function [0] │ = Argument 'color_ramp' at index 0 is a pointer of space Storage { access: StorageAccess(LOAD) }, which can't be passed into functions. ```
4 条评论