Skip to content

Non-uniform Indexing (Bindless) Textures Validation Failure #6952

@cryscan

Description

@cryscan

Bevy version

0.9

AdapterInfo { name: "NVIDIA GeForce MX150", vendor: 4318, device: 7442, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "470.161.03", backend: Vulkan }

What went wrong

When using non-uniform indexing (bindless) textures in debug mode, shader validation fails and output

2022-12-06T20:06:19.458496Z ERROR bevy_render::render_resource::pipeline_cache: failed to process shader: 
error: Function [68] 'retreive_surface' is invalid
     ┌─ wgsl:1333:1
     │  
1333 │ ╭ fn retreive_surface(material_index: u32, uv: vec2<f32>) -> Surface {
1334 │ │     var surface: Surface;
1335 │ │     let material = material_buffer[material_index];
1336 │ │ 
     · │
1340 │ │         surface.base_color *= textureSampleLevel(textures[id], samplers[id], uv, 0.0);
     │ │                                                  ^^^^^^^^^^^^ naga::Expression [74]
     · │
1363 │ │ 
1364 │ │     return surface;
     │ ╰───────────────────^ naga::Function [68]
     │  
     = Expression [74] is invalid
     = Shader requires capability SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING

This error does not happen in release mode.

Additional information

According to this issue and code here, bevy seems to validate the shader with a limited set of constant capabilities. Maybe add the SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING capability here could solve the problem?

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