Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/renderers/common/Storage3DTexture.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,27 @@ class Storage3DTexture extends Texture {

}

/**
* Sets the size of the storage 3d texture.
*
* @param {number} width - The new width of the storage texture.
* @param {number} height - The new height of the storage texture.
* @param {number} depth - The new depth of the storage texture.
*/
setSize( width, height, depth ) {

if ( this.image.width !== width || this.image.height !== height || this.image.depth !== depth ) {

this.image.width = width;
this.image.height = height;
this.image.depth = depth;

this.dispose();

}

}

}

export default Storage3DTexture;
21 changes: 21 additions & 0 deletions src/renderers/common/StorageArrayTexture.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,27 @@ class StorageArrayTexture extends Texture {

}

/**
* Sets the size of the storage array texture.
*
* @param {number} width - The new width of the storage texture.
* @param {number} height - The new height of the storage texture.
* @param {number} depth - The new depth of the storage texture.
*/
setSize( width, height, depth ) {

if ( this.image.width !== width || this.image.height !== height || this.image.depth !== depth ) {

this.image.width = width;
this.image.height = height;
this.image.depth = depth;

this.dispose();

}

}

}

export default StorageArrayTexture;
19 changes: 19 additions & 0 deletions src/renderers/common/StorageTexture.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ class StorageTexture extends Texture {

}

/**
* Sets the size of the storage texture.
*
* @param {number} width - The new width of the storage texture.
* @param {number} height - The new height of the storage texture.
*/
setSize( width, height ) {

if ( this.image.width !== width || this.image.height !== height ) {

this.image.width = width;
this.image.height = height;

this.dispose();

}

}

}

export default StorageTexture;