Converts a Schema to a WebGPU GPUVertexBufferLayout descriptor
Schema defining the vertex structure
Configuration options for layout generation
GPUVertexBufferLayout descriptor ready for WebGPU pipeline creation
const vertexLayout = schemaToVertexBufferLayout(positionColorNormalVertexSchema, { shaderLocations: { position: 0, color: 8, normal: 9 }});const pipeline = device.createRenderPipeline({ vertex: { module: shaderModule, entryPoint: 'vs_main', buffers: [{ ...vertexLayout }] }, // ...}); Copy
const vertexLayout = schemaToVertexBufferLayout(positionColorNormalVertexSchema, { shaderLocations: { position: 0, color: 8, normal: 9 }});const pipeline = device.createRenderPipeline({ vertex: { module: shaderModule, entryPoint: 'vs_main', buffers: [{ ...vertexLayout }] }, // ...});
Converts a Schema to a WebGPU GPUVertexBufferLayout descriptor