MCPcopy Index your code
hub / github.com/processing/p5.js / _getWebGPUColorFormat

Method _getWebGPUColorFormat

src/webgpu/p5.RendererWebGPU.js:3704–3717  ·  view source on GitHub ↗
(framebuffer)

Source from the content-addressed store, hash-verified

3702 }
3703
3704 _getWebGPUColorFormat(framebuffer) {
3705 if (framebuffer.format === constants.FLOAT) {
3706 return framebuffer.channels === RGBA ? 'rgba32float' : 'rgba32float';
3707 } else if (framebuffer.format === constants.HALF_FLOAT) {
3708 return framebuffer.channels === RGBA ? 'rgba16float' : 'rgba16float';
3709 } else {
3710 // Framebuffer with _useCanvasFormat should match canvas presentation format
3711 if (framebuffer._useCanvasFormat) {
3712 return this.presentationFormat;
3713 }
3714 // Other framebuffers use standard RGBA format
3715 return framebuffer.channels === RGBA ? 'rgba8unorm' : 'rgba8unorm';
3716 }
3717 }
3718
3719 _getWebGPUDepthFormat(framebuffer) {
3720 if (framebuffer._useCanvasFormat) {

Callers 2

_shaderOptionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected