diff --git a/js/webgpu/utils.js b/js/webgpu/utils.js index 1f87d3a..884c0df 100644 --- a/js/webgpu/utils.js +++ b/js/webgpu/utils.js @@ -4,11 +4,9 @@ const getCanvasSize = (canvas) => { }; const loadTexture = async (device, url) => { - const image = new Image(); - image.crossOrigin = "anonymous"; - image.src = url; - await image.decode(); - const imageBitmap = await createImageBitmap(image); + const response = await fetch(url, { credentials: "include" }); + const data = await response.blob(); + const imageBitmap = await createImageBitmap(data); const texture = device.createTexture({ size: [imageBitmap.width, imageBitmap.height, 1],