Skip to content

feat: add Dawn device toggles via dawnToggles#374

Open
pepperoni505 wants to merge 1 commit into
wcandillon:mainfrom
pepperoni505:feat/dawn-device-toggles
Open

feat: add Dawn device toggles via dawnToggles#374
pepperoni505 wants to merge 1 commit into
wcandillon:mainfrom
pepperoni505:feat/dawn-device-toggles

Conversation

@pepperoni505
Copy link
Copy Markdown

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.

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.

1 participant