-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Freezes on Metal #89
Comments
More info:
This might be the metal shader that is created:
|
I think it's saying that the shader expects a uniform struct of size 144, but your buffer binding only has space for 136. This means that accessing |
I think this is possibly related to gfx-rs/wgpu#185 |
Can't you easily test if that's the case (by providing more space to the buffers), or you have no platform to reproduce this? |
I don't actually have access to a mac with xcode on it to really test thoroughly, though my friend does, so when I put some effort into solving it, I can bug them. I am probably also running afowl of alignment requirements that 0.5 didn't test for, and I've yet to update this codebase fully to master. |
I found out what the issue was on metal, and thought I should document it here. In froxels.cs.glsl: layout(set = 0, binding = 0) uniform Uniforms {
mat4 inv_proj;
Frustum frustum;
uvec2 froxel_count;
}; gets turned into: struct _78
{
float4x4 _m0;
_77 _m1;
uint2 _m2;
}; Metal expects that the alignment matches perfectly even for uniforms and not just buffers because uniforms and buffers are treated the same. If you use a |
Metal validation catches that, we saw similar errors reported. Make sure to run with it from time to time, until wgpu's own validation is getting there! |
Ooo thank you for documenting this! So the solution is to use uvec4 for the froxel count? Is there anything I could do on my end to keep the shader the same? I guess the fundamental issue is that I'm uploading the padding bytes after the struct... |
Reports of the current builds freezing up Macs. The entire machine freezes, likely due to a graphics issue.
The text was updated successfully, but these errors were encountered: