Skip to content

[p5.js 2.0 Bug Report]: [WebGPU] RangeError creating some p5.Geometry #8339

@davepagurek

Description

@davepagurek

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.2-rc2

Web browser and version

Chrome 143

Operating system

MacOS 15.2

Steps to reproduce this

Steps:

Create a p5.Geometry via textToModel. At some sample factors, I get this error:

RangeError: Failed to execute 'createBuffer' on 'GPUDevice': createBuffer failed, size (7938) is not a multiple of 4 when mappedAtCreation == true

At e.g. sampleFactor: 0.4, this doesn't happen.

Snippet:

let geom
let font

async function setup() {
	await createCanvas(windowWidth, windowHeight, WEBGPU)
	// Dela Gothic One
	font = await loadFont('https://fonts.gstatic.com/s/delagothicone/v19/hESp6XxvMDRA-2eD0lXpDa6QkBAGRUsJQAlbUA.ttf')
	textAlign(CENTER, CENTER)
	textSize(100)
	geom = font.textToModel('WEBGPU', 0, 0, {
		sampleFactor: 0.5
	})
}

function draw() {
	background(200)
	orbitControl()
	model(geom)
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions