File tree 1 file changed +9
-9
lines changed
sample/volumeRenderingTexture3D
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -150,13 +150,6 @@ async function createVolumeTexture(format: GPUTextureFormat) {
150
150
status . textContent = '' ;
151
151
}
152
152
153
- volumeTexture = device . createTexture ( {
154
- dimension : '3d' ,
155
- size : [ width , height , depth ] ,
156
- format : format ,
157
- usage : GPUTextureUsage . TEXTURE_BINDING | GPUTextureUsage . COPY_DST ,
158
- } ) ;
159
-
160
153
const response = await fetch ( dataPath ) ;
161
154
162
155
// Decompress the data using DecompressionStream for gzip format
@@ -165,10 +158,17 @@ async function createVolumeTexture(format: GPUTextureFormat) {
165
158
const decompressedArrayBuffer = await new Response (
166
159
decompressedStream
167
160
) . arrayBuffer ( ) ;
168
- const byteArray = new Uint8Array ( decompressedArrayBuffer ) ;
161
+
162
+ volumeTexture = device . createTexture ( {
163
+ dimension : '3d' ,
164
+ size : [ width , height , depth ] ,
165
+ format : format ,
166
+ usage : GPUTextureUsage . TEXTURE_BINDING | GPUTextureUsage . COPY_DST ,
167
+ } ) ;
168
+
169
169
device . queue . writeTexture (
170
170
{ texture : volumeTexture } ,
171
- byteArray ,
171
+ decompressedArrayBuffer ,
172
172
{ bytesPerRow : bytesPerRow , rowsPerImage : blocksHigh } ,
173
173
[ width , height , depth ]
174
174
) ;
You can’t perform that action at this time.
0 commit comments