Skip to content

Commit

Permalink
BinaryStream: Use little endian for f64
Browse files Browse the repository at this point in the history
To match all the other data types
  • Loading branch information
ben-clayton committed Oct 27, 2023
1 parent 36a23bf commit 2ef3f32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/webgpu/util/binary_stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ export default class BinaryStream {

/** writeF64() writes a float64 to the buffer at the next 64-bit aligned offset */
writeF64(value: number) {
this.view.setFloat64(this.alignedOffset(8), value);
this.view.setFloat64(this.alignedOffset(8), value, /* littleEndian */ true);
}

/** readF64() reads a float64 from the buffer at the next 64-bit aligned offset */
readF64(): number {
return this.view.getFloat64(this.alignedOffset(8));
return this.view.getFloat64(this.alignedOffset(8), /* littleEndian */ true);
}

/**
Expand Down

0 comments on commit 2ef3f32

Please sign in to comment.