(framebuffer, mipmapData, mipLevel, width, height)
| 4090 | * Copy framebuffer content directly to WebGPU texture mip level |
| 4091 | */ |
| 4092 | _accumulateMipLevel(framebuffer, mipmapData, mipLevel, width, height) { |
| 4093 | this.flushDraw(); |
| 4094 | // Copy from framebuffer texture to the mip level |
| 4095 | const commandEncoder = this.device.createCommandEncoder(); |
| 4096 | |
| 4097 | // Get the underlying WebGPU texture from the framebuffer |
| 4098 | const sourceTexture = framebuffer.color.rawTexture().texture; |
| 4099 | |
| 4100 | commandEncoder.copyTextureToTexture( |
| 4101 | { |
| 4102 | texture: sourceTexture, |
| 4103 | origin: { x: 0, y: 0, z: 0 }, |
| 4104 | }, |
| 4105 | { |
| 4106 | texture: mipmapData.gpuTexture, |
| 4107 | mipLevel: mipLevel, |
| 4108 | origin: { x: 0, y: 0, z: 0 }, |
| 4109 | }, |
| 4110 | { |
| 4111 | width: width, |
| 4112 | height: height, |
| 4113 | depthOrArrayLayers: 1, |
| 4114 | } |
| 4115 | ); |
| 4116 | |
| 4117 | this.device.queue.submit([commandEncoder.finish()]); |
| 4118 | } |
| 4119 | |
| 4120 | /* |
| 4121 | * Create final MipmapTexture from WebGPU texture |
nothing calls this directly
no test coverage detected