The Wayback Machine - https://webcf.waybackmachine.org/web/20220402130050/https://github.com/mrdoob/three.js/commit/66b9fa344ce01581033d171e1de09dd86bd5a3d7
Skip to content
Permalink
Browse files
WebGPUTextures: Prepare 2DArray and 3D texture support.
  • Loading branch information
Mugen87 committed on Sep 29, 2020
1 parent d85592a commit 66b9fa344ce01581033d171e1de09dd86bd5a3d7
Showing with 30 additions and 2 deletions.
  1. +29 −1 examples/jsm/renderers/webgpu/WebGPUSampledTexture.js
  2. +1 −1 examples/jsm/renderers/webgpu/WebGPUTextures.js
@@ -21,6 +21,34 @@ class WebGPUSampledTexture extends WebGPUBinding {

}

class WebGPUSampledArrayTexture extends WebGPUSampledTexture {

constructor( name ) {

super( name );

this.dimension = GPUTextureViewDimension.TwoDArray;

Object.defineProperty( this, 'isSampledArrayTexture', { value: true } );

}

}

class WebGPUSampled3DTexture extends WebGPUSampledTexture {

constructor( name ) {

super( name );

this.dimension = GPUTextureViewDimension.ThreeD;

Object.defineProperty( this, 'isSampled3DTexture', { value: true } );

}

}

class WebGPUSampledCubeTexture extends WebGPUSampledTexture {

constructor( name ) {
@@ -35,4 +63,4 @@ class WebGPUSampledCubeTexture extends WebGPUSampledTexture {

}

export { WebGPUSampledTexture, WebGPUSampledCubeTexture };
export { WebGPUSampledTexture, WebGPUSampledArrayTexture, WebGPUSampled3DTexture, WebGPUSampledCubeTexture };
@@ -344,7 +344,7 @@ class WebGPUTextures {

// transfer texture data

if ( texture.isDataTexture ) {
if ( texture.isDataTexture || texture.isDataTexture2DArray || texture.isDataTexture3D ) {

this._copyBufferToTexture( image, format, textureGPU );

0 comments on commit 66b9fa3

Please sign in to comment.