|
@@ -344,8 +344,9 @@ class WebGPUTextureUtils {
|
|
|
* Generates mipmaps for the given texture.
|
|
* Generates mipmaps for the given texture.
|
|
|
*
|
|
*
|
|
|
* @param {Texture} texture - The texture.
|
|
* @param {Texture} texture - The texture.
|
|
|
|
|
+ * @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps.
|
|
|
*/
|
|
*/
|
|
|
- generateMipmaps( texture ) {
|
|
|
|
|
|
|
+ generateMipmaps( texture, encoder = null ) {
|
|
|
|
|
|
|
|
const textureData = this.backend.get( texture );
|
|
const textureData = this.backend.get( texture );
|
|
|
|
|
|
|
@@ -353,7 +354,7 @@ class WebGPUTextureUtils {
|
|
|
|
|
|
|
|
for ( let i = 0; i < 6; i ++ ) {
|
|
for ( let i = 0; i < 6; i ++ ) {
|
|
|
|
|
|
|
|
- this._generateMipmaps( textureData.texture, textureData.textureDescriptorGPU, i );
|
|
|
|
|
|
|
+ this._generateMipmaps( textureData.texture, textureData.textureDescriptorGPU, i, encoder );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -363,7 +364,7 @@ class WebGPUTextureUtils {
|
|
|
|
|
|
|
|
for ( let i = 0; i < depth; i ++ ) {
|
|
for ( let i = 0; i < depth; i ++ ) {
|
|
|
|
|
|
|
|
- this._generateMipmaps( textureData.texture, textureData.textureDescriptorGPU, i );
|
|
|
|
|
|
|
+ this._generateMipmaps( textureData.texture, textureData.textureDescriptorGPU, i, encoder );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -814,10 +815,11 @@ class WebGPUTextureUtils {
|
|
|
* @param {GPUTexture} textureGPU - The GPU texture object.
|
|
* @param {GPUTexture} textureGPU - The GPU texture object.
|
|
|
* @param {Object} textureDescriptorGPU - The texture descriptor.
|
|
* @param {Object} textureDescriptorGPU - The texture descriptor.
|
|
|
* @param {number} [baseArrayLayer=0] - The index of the first array layer accessible to the texture view.
|
|
* @param {number} [baseArrayLayer=0] - The index of the first array layer accessible to the texture view.
|
|
|
|
|
+ * @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps.
|
|
|
*/
|
|
*/
|
|
|
- _generateMipmaps( textureGPU, textureDescriptorGPU, baseArrayLayer = 0 ) {
|
|
|
|
|
|
|
+ _generateMipmaps( textureGPU, textureDescriptorGPU, baseArrayLayer = 0, encoder = null ) {
|
|
|
|
|
|
|
|
- this._getPassUtils().generateMipmaps( textureGPU, textureDescriptorGPU, baseArrayLayer );
|
|
|
|
|
|
|
+ this._getPassUtils().generateMipmaps( textureGPU, textureDescriptorGPU, baseArrayLayer, encoder );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|