@@ -65,7 +65,7 @@ const response = await fetch('../../assets/img/Di-3d.png');
65
65
const imageBitmap = await createImageBitmap ( await response . blob ( ) ) ;
66
66
67
67
const [ srcWidth , srcHeight ] = [ imageBitmap . width , imageBitmap . height ] ;
68
- const cubeTexture = device . createTexture ( {
68
+ const imageTexture = device . createTexture ( {
69
69
size : [ srcWidth , srcHeight , 1 ] ,
70
70
format : 'rgba8unorm' ,
71
71
usage :
@@ -75,7 +75,7 @@ const cubeTexture = device.createTexture({
75
75
} ) ;
76
76
device . queue . copyExternalImageToTexture (
77
77
{ source : imageBitmap } ,
78
- { texture : cubeTexture } ,
78
+ { texture : imageTexture } ,
79
79
[ imageBitmap . width , imageBitmap . height ]
80
80
) ;
81
81
@@ -93,6 +93,7 @@ const textures = [0, 1].map(() => {
93
93
} ) ;
94
94
} ) ;
95
95
96
+ // A buffer with 0 in it. Binding this buffer is used to set `flip` to 0
96
97
const buffer0 = ( ( ) => {
97
98
const buffer = device . createBuffer ( {
98
99
size : 4 ,
@@ -104,6 +105,7 @@ const buffer0 = (() => {
104
105
return buffer ;
105
106
} ) ( ) ;
106
107
108
+ // A buffer with 1 in it. Binding this buffer is used to set `flip` to 1
107
109
const buffer1 = ( ( ) => {
108
110
const buffer = device . createBuffer ( {
109
111
size : 4 ,
@@ -141,7 +143,7 @@ const computeBindGroup0 = device.createBindGroup({
141
143
entries : [
142
144
{
143
145
binding : 1 ,
144
- resource : cubeTexture . createView ( ) ,
146
+ resource : imageTexture . createView ( ) ,
145
147
} ,
146
148
{
147
149
binding : 2 ,
0 commit comments