Skip to content

Commit 85e141c

Browse files
authored
Add in viewDimension for cube-array fallback (#499)
If we're in compatbility mode we use a cube instead of cube-array for the 4th cube. I forgot to pass in the viewDimesion to both the texture creation and generateMips. Added.
1 parent 571e130 commit 85e141c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sample/generateMipmap/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,14 @@ if (
120120
size: [256, 256, 6],
121121
mipLevelCount: 9,
122122
format: 'rgba8unorm',
123+
textureBindingViewDimension: 'cube',
123124
usage:
124125
GPUTextureUsage.TEXTURE_BINDING |
125126
GPUTextureUsage.COPY_DST |
126127
GPUTextureUsage.RENDER_ATTACHMENT,
127128
});
128129
putDataInTextureCubeFallback(device, texture);
129-
generateMips(device, texture);
130+
generateMips(device, texture, 'cube');
130131
textures.push({ texture, viewDimension: 'cube' });
131132
document.querySelector('#cube-array').textContent = 'cube(fallback)';
132133
}

0 commit comments

Comments
 (0)