-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
textureLoad does not allows texture_multisampled_2d #9
Comments
Just installed the extension from market place, |
What's strange is that the error reports a |
Looks like the order is incorrect here https://github.com/wgsl-analyzer/wgsl-analyzer/blob/main/crates/hir_def/src/type_ref.rs#L179-L190 |
The order is incorrect as you pointed out, and the issue with I pushed fixes for the formatting and the incorrect array texture, a new version 0.1.4 should be released once the CI finishes running. |
The new version should be released now, can you check if the issue is fixed? Edit: nevermind, I think it's still incorrect |
thanks, the issue seems to be fixed for
|
Fixed it: e3cd69a. Is the shader you are using open source so I can try it locally or are are there other errors I should fix before releasing 0.1.6? |
yes, please, take a look here: https://github.com/IcanDivideBy0/calva/blob/master/calva-renderer/src/shaders/light.shadow.wgsl
|
I found the issue, |
thanks, this shader is fine now, i still have other issues tho, you can check other shaders in the same directory: https://github.com/IcanDivideBy0/calva/blob/master/calva-renderer/src/shaders/ most notabely: let frag_pos_view = camera.inv_proj * vec4<f32>(in.ndc, z, 1.0);
let frag_pos_view = frag_pos_view.xyz / frag_pos_view.w;
let L = normalize(in.l_position - frag_pos_view); // frag_pos_view is considered a vec4 by wgsl-analyzer and: fn get_skinning_matrix(frame: u32, in: VertexInput) -> mat4x4<f32> {
let joints = vec4<u32>(
in.joints >> 0u & 0xFFu,
in.joints >> 8u & 0xFFu,
in.joints >> 16u & 0xFFu,
in.joints >> 24u & 0xFFu,
);
let m1 = get_joint_matrix(frame, joints.x) * in.weights.x; // multiply matrix by a scalar is reported as an error
let m2 = get_joint_matrix(frame, joints.y) * in.weights.y;
let m3 = get_joint_matrix(frame, joints.z) * in.weights.z;
let m4 = get_joint_matrix(frame, joints.w) * in.weights.w;
return mat4x4<f32>(
m1.x + m2.x + m3.x + m4.x, // accessing matrix rows with .x, .y, etc is reported as an error
m1.y + m2.y + m3.y + m4.y,
m1.z + m2.z + m3.z + m4.z,
m1.w + m2.w + m3.w + m4.w,
);
} |
The first example isn't valid wgsl, you can't shadow variables in the same scope. It seems to be accepted in naga right now but it shouldn't be: https://gpuweb.github.io/gpuweb/wgsl/#declaration-and-scope |
Oh, ok, thanks for pointing it out 👍 |
Accessing matrix rows by let view3 = mat3x3<f32>(
camera.view.x.xyz,
camera.view.y.xyz,
camera.view.z.xyz,
); You should use |
Ok, those have been fixed, only thing left is the matrix multiplication by a scalar which is allowed by the spec |
Those were missing but are added now, 0.2.0 is on its way to be released. |
Works like a charm 💯 thanks for your responsiveness! |
The text was updated successfully, but these errors were encountered: