List of all wgpu compatible texture formats?

I am getting this error:

[2023-04-11T20:37:57Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
    error matching FRAGMENT shader requirements against the pipeline
    shader global ResourceBinding { group: 0, binding: 2 } is not available in the layout pipeline layout
    texture class Sampled { kind: Uint, multi: false } doesn't match the shader Sampled { kind: Float, multi: false }

I am having difficulty figuring out (1) why one of them is Float, (2) what the valid pairings are, and (3) what the values are on the two sides.

Any advice on wgpu texture format debugging issues ?

In particular, I am confused about:

    texture class Sampled { kind: Uint, multi: false } doesn't match the shader Sampled { kind: Float, multi: false }

I am confused where the rhs kind: Float comes from. I have grepped the codebase for ::default() and Float to no avail.

My read of the error text is that the shader itself is asking for a float sampled texture while the wgpu code is attempting to provide an integer sampled texture. I've never gotten too far into texture sampling though so I'm not sure how you'd fix it off the top of my head.

glsl frag:

layout(set = 0, binding = 1) uniform sampler u_sampler;
layout(set = 0, binding = 2) uniform texture2D u_texture_atlas;

converted via naga to wgsl:

@group(0) @binding(1) 
var u_sampler: sampler;
@group(0) @binding(2) 
var u_texture_atlas: texture_2d<f32>;

You are saying hmm, the texture_2d<f32> is causing the rhs doesn't match the shader Sampled { kind: Float, multi: false } ?

This is plausible and makes sense. I am just surprised wgpu is parsing the shaders.

Hmm, I'm getting a different (further progress) runtime error now -- so you must be right. :slight_smile: Thanks!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.