The spec at https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-setindexbuffer says, for setIndexBuffer and setVertexBuffer, "If size is zero, the remaining size (after offset) of the GPUBuffer is used."
However, this seems to be currently unsupported in wgpu, and using 0 will cause draw commands to fail because indices are compared against the literal 0 value instead of the size of the buffer.
The spec at https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-setindexbuffer says, for setIndexBuffer and setVertexBuffer, "If size is zero, the remaining size (after offset) of the GPUBuffer is used."
However, this seems to be currently unsupported in wgpu, and using 0 will cause draw commands to fail because indices are compared against the literal 0 value instead of the size of the buffer.