Skip to content

Commit

Permalink
Use getPreferredCanvasFormat()
Browse files Browse the repository at this point in the history
Hardcoding `bgr8unorm` does not work on all platforms.
  • Loading branch information
jrprice authored Mar 20, 2023
1 parent 384bdae commit a2f4d2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nbody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const updateRenderParams = async () => {
canvas.height = window.innerHeight;
canvasContext.configure({
device: device,
format: 'bgra8unorm',
format: navigator.gpu.getPreferredCanvasFormat(),
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC,
});

Expand Down

0 comments on commit a2f4d2f

Please sign in to comment.