Skip to content

Commit

Permalink
Deploying to gh-pages from @ de97ba4 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed Jun 18, 2024
1 parent 69209d3 commit b0cdaaa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions sample/multipleCanvases/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5862,7 +5862,6 @@ const modelData = {
rock: flattenNormals(createSphereTypedArrays(20, 32, 16, 0.1)),
};

/* eslint-disable prettier/prettier */
function createBufferWithData(device, data, usage) {
const buffer = device.createBuffer({
size: data.byteLength,
Expand All @@ -5883,7 +5882,7 @@ function createVertexAndIndexBuffer(device, { vertices, indices }) {
}
const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice();
const models = Object.values(modelData).map(data => createVertexAndIndexBuffer(device, data));
const models = Object.values(modelData).map((data) => createVertexAndIndexBuffer(device, data));
function rand(min, max) {
if (min === undefined) {
max = 1;
Expand Down
2 changes: 1 addition & 1 deletion sample/multipleCanvases/main.js.map

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions sample/multipleCanvases/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable prettier/prettier */
import { mat4, mat3 } from 'wgpu-matrix';
import { modelData } from './models';

Expand Down Expand Up @@ -26,7 +25,7 @@ type Model = {

function createVertexAndIndexBuffer(
device: GPUDevice,
{ vertices, indices }: { vertices: Float32Array, indices: Uint32Array },
{ vertices, indices }: { vertices: Float32Array; indices: Uint32Array }
): Model {
const vertexBuffer = createBufferWithData(
device,
Expand All @@ -49,7 +48,9 @@ function createVertexAndIndexBuffer(
const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice();

const models = Object.values(modelData).map(data => createVertexAndIndexBuffer(device, data));
const models = Object.values(modelData).map((data) =>
createVertexAndIndexBuffer(device, data)
);

function rand(min?: number, max?: number) {
if (min === undefined) {
Expand All @@ -70,7 +71,6 @@ function randColor() {
return [rand(), rand(), rand(), 1];
}


const presentationFormat = navigator.gpu.getPreferredCanvasFormat();
const depthFormat = 'depth24plus';

Expand Down Expand Up @@ -231,7 +231,8 @@ for (let i = 0; i < numProducts; ++i) {
const kColorOffset = 32;
const worldViewProjectionMatrixValue = uniformValues.subarray(
kWorldViewProjectionMatrixOffset,
kWorldViewProjectionMatrixOffset + 16);
kWorldViewProjectionMatrixOffset + 16
);
const worldMatrixValue = uniformValues.subarray(
kWorldMatrixOffset,
kWorldMatrixOffset + 15
Expand Down

0 comments on commit b0cdaaa

Please sign in to comment.