MCPcopy Create free account
hub / github.com/processing/p5.js / _prepareMipmapData

Method _prepareMipmapData

src/webgpu/p5.RendererWebGPU.js:4066–4087  ·  view source on GitHub ↗
(size, mipLevels)

Source from the content-addressed store, hash-verified

4064 * Prepare WebGPU texture to accumulate mip levels directly
4065 */
4066 _prepareMipmapData(size, mipLevels) {
4067 // Create WebGPU texture with mipmaps upfront
4068 const textureDescriptor = {
4069 size: {
4070 width: size,
4071 height: size,
4072 depthOrArrayLayers: 1,
4073 },
4074 mipLevelCount: mipLevels,
4075 format: 'rgba8unorm',
4076 usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT,
4077 };
4078
4079 const gpuTexture = this.device.createTexture(textureDescriptor);
4080
4081 return {
4082 gpuTexture,
4083 size,
4084 mipLevels,
4085 format: 'rgba8unorm'
4086 };
4087 }
4088
4089 /*
4090 * Copy framebuffer content directly to WebGPU texture mip level

Callers

nothing calls this directly

Calls 1

createTextureMethod · 0.45

Tested by

no test coverage detected