File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
sample/volumeRenderingTexture3D Expand file tree Collapse file tree 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) {
150150 status . textContent = '' ;
151151 }
152152
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-
160153 const response = await fetch ( dataPath ) ;
161154
162155 // Decompress the data using DecompressionStream for gzip format
@@ -165,10 +158,17 @@ async function createVolumeTexture(format: GPUTextureFormat) {
165158 const decompressedArrayBuffer = await new Response (
166159 decompressedStream
167160 ) . 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+
169169 device . queue . writeTexture (
170170 { texture : volumeTexture } ,
171- byteArray ,
171+ decompressedArrayBuffer ,
172172 { bytesPerRow : bytesPerRow , rowsPerImage : blocksHigh } ,
173173 [ width , height , depth ]
174174 ) ;
You can’t perform that action at this time.
0 commit comments