Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions sample/imageBlur/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const response = await fetch('../../assets/img/Di-3d.png');
const imageBitmap = await createImageBitmap(await response.blob());

const [srcWidth, srcHeight] = [imageBitmap.width, imageBitmap.height];
const cubeTexture = device.createTexture({
const imageTexture = device.createTexture({
size: [srcWidth, srcHeight, 1],
format: 'rgba8unorm',
usage:
Expand All @@ -75,7 +75,7 @@ const cubeTexture = device.createTexture({
});
device.queue.copyExternalImageToTexture(
{ source: imageBitmap },
{ texture: cubeTexture },
{ texture: imageTexture },
[imageBitmap.width, imageBitmap.height]
);

Expand All @@ -93,6 +93,7 @@ const textures = [0, 1].map(() => {
});
});

// A buffer with 0 in it. Binding this buffer is used to set `flip` to 0
const buffer0 = (() => {
const buffer = device.createBuffer({
size: 4,
Expand All @@ -104,6 +105,7 @@ const buffer0 = (() => {
return buffer;
})();

// A buffer with 1 in it. Binding this buffer is used to set `flip` to 1
const buffer1 = (() => {
const buffer = device.createBuffer({
size: 4,
Expand Down Expand Up @@ -141,7 +143,7 @@ const computeBindGroup0 = device.createBindGroup({
entries: [
{
binding: 1,
resource: cubeTexture.createView(),
resource: imageTexture.createView(),
},
{
binding: 2,
Expand Down
Loading