Reading vertex buffer in metal can generate 2 integer ops per byte loaded #7027
Labels
area: naga back-end
Outputs of naga shader conversion
area: performance
How fast things go
backend: metal
Issues with Metal
lang: Metal
Metal Shading Language
It seems that for some reason that the naga generated shader for reading a vertex buffer in metal involves interpreting the input as bytes, then taking each byte one at a time, expanding it to u32 and shift/adding to unpack it into its final value. For vertices with a lot of attributes, this really starts to rack up.
Is this expected behavior? It seems like it would either be able to read the attributes by interpreting the buffer as structs or by casting each of the attributes. Am I misunderstanding something? When rendering a lot of vertices this seems to be adding billions of operations to my VS.
macos, wgpu version 24.0.0
The text was updated successfully, but these errors were encountered: