-
Notifications
You must be signed in to change notification settings - Fork 363
Open
Labels
copyeditingPure editorial stuff (copyediting, *.bs file syntax, etc.)Pure editorial stuff (copyediting, *.bs file syntax, etc.)wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues
Milestone
Description
I don't understand what is the difference here. Why doesn't the spec allow for 8 bytes alignment for struct?
Consider these 2 samples:
Case 1
struct fp64 {
high: f32,
low: f32
}
struct TestStruct {
logical_offset: fp64,
coord_offset: fp64,
base_value: fp64,
}
@group(1) @binding(1) var<uniform> testStructUniform: TestStruct;Case 2
alias fv64 = vec2<f32>;
struct TestStruct2 {
logical_offset: fv64,
coord_offset: fv64,
base_value: fv64,
}
@group(1) @binding(2) var<uniform> testStructUniform2: TestStruct2;Case 2 compiles fine without any issues, while case 1 fails with an error saying that the alignment of fp64 must be 16 bytes.
I checked the spec and it is indeed as per spec.
Are vec2<f32> and fp64 basically the same thing in hardware. Just out of curiosity why is it restrictive?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
copyeditingPure editorial stuff (copyediting, *.bs file syntax, etc.)Pure editorial stuff (copyediting, *.bs file syntax, etc.)wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues