Skip to content

Commit

Permalink
Fixed code, not sure what I was doing earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
cmhhelgeson committed Dec 7, 2023
1 parent b7503c7 commit 0006bb2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/sample/animometer/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,8 @@ const init: SampleInit = async ({ canvas, pageState, gui }) => {
const numTriangles = settings.numTriangles;
const uniformBytes = 5 * Float32Array.BYTES_PER_ELEMENT;
const minBufferAllignment = device.limits.minUniformBufferOffsetAlignment;
let alignedUniformBytes = 0;
const blocks = Math.ceil(uniformBytes / minBufferAllignment);
if (uniformBytes < minBufferAllignment) {
alignedUniformBytes = blocks * minBufferAllignment;
} else {
// Number of minBufferAllignment Blocks occupied by our data
alignedUniformBytes = blocks * blocks * minBufferAllignment;
}
const alignedUniformBytes =
Math.ceil(uniformBytes / minBufferAllignment) * minBufferAllignment;

const alignedUniformFloats =
alignedUniformBytes / Float32Array.BYTES_PER_ELEMENT;
Expand Down

0 comments on commit 0006bb2

Please sign in to comment.