Skip to content

The utils.wgsl shader has an implicit dependency to another shader #7353

@torsteingrindvik

Description

@torsteingrindvik

Bevy version

a3baf2a (very recent main)

What you did

I did #import bevy_pbr::utils in my own plugin's shader.
I want to use that for things such as PI, random1D, and coords_to_viewport_uv, which can be useful to anyone.

What went wrong

error: no definition in scope for identifier: 'normal_prepass_texture'
   ┌─ wgsl:44:37
   │
44 │     let normal_sample = textureLoad(normal_prepass_texture, vec2<i32>(frag_coord.xy), 0);
   │                                     ^^^^^^^^^^^^^^^^^^^^^^ unknown identifier

Additional information

theories about what might be going wrong

It's assumed that mesh_view_bindings.wgsl is imported.

That file defines normal_prepass_texture. But I can't just import that shader because it defines lots of bindings which I'm not using.

workarounds that you used

I can just copy-paste the stuff in utils.wgsl into my own shaders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions