Skip to content

Image fetch with level #360

@caibear

Description

@caibear

When porting my WGSL shader to RustGPU I tried finding the equivalent of WGSL's textureLoad.
The closest thing I could find was spirv_std::image::Image::fetch, which does not have a mipmap level argument.

I tried using Image::fetch since I was using textureLoad with level = 0 and figured it might work.
I translated the SPIR-V to WGSL with naga, but it generated an invalid call to textureFetch, missing the required level argument.

I'm not sure if it makes sense to add level: u32 parameter to Image::fetch or provide a new Image::fetch_with_level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions