Skip to content

feat: add Dawn device toggles via dawnToggles#374

Merged
wcandillon merged 2 commits into
wcandillon:mainfrom
pepperoni505:feat/dawn-device-toggles
Jun 2, 2026
Merged

feat: add Dawn device toggles via dawnToggles#374
wcandillon merged 2 commits into
wcandillon:mainfrom
pepperoni505:feat/dawn-device-toggles

Conversation

@pepperoni505
Copy link
Copy Markdown
Contributor

This PR adds the ability to set Dawn device (instance and adapter toggles aren't supported by this PR) toggles (full list here).

Our use case is the ignore_imported_ahardwarebuffer_vulkan_image_size toggle: we hit validation errors in some Android emulator environments due to the driver issue documented in the file linked above. Rather than patch this repo to hardcode that one toggle, exposing the ability to set any toggle is the cleaner, more general solution.

const device = await adapter.requestDevice({
	dawnToggles: {
		enabledToggles: ["ignore_imported_ahardwarebuffer_vulkan_image_size"],
		// disabledToggles: [...],
	},
});

On the API shape: this adds a non-standard field to GPUDeviceDescriptor rather than touching the requestDevice signature. It's the most logical home, but I'm open to alternatives if you'd prefer it elsewhere.

@wcandillon wcandillon self-requested a review June 2, 2026 04:29
@wcandillon
Copy link
Copy Markdown
Owner

looks good!

@wcandillon wcandillon merged commit 730010c into wcandillon:main Jun 2, 2026
2 checks passed
@pepperoni505 pepperoni505 deleted the feat/dawn-device-toggles branch June 2, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants