Skip to content

Commit

Permalink
Added powerPreference argument to detectGPUDevice() while keeping old…
Browse files Browse the repository at this point in the history
… behaviour as default.
  • Loading branch information
marschr authored Nov 27, 2024
1 parent 7ae7ea8 commit 2805c13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/webgpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface GPUDeviceDetectOutput {
/**
* DetectGPU device in the environment.
*/
export async function detectGPUDevice(): Promise<GPUDeviceDetectOutput | undefined> {
export async function detectGPUDevice(powerPreference: "low-power" | "high-performance" = "high-performance"): Promise<GPUDeviceDetectOutput | undefined> {
if (typeof navigator !== "undefined" && navigator.gpu !== undefined) {
const adapter = await navigator.gpu.requestAdapter({ "powerPreference": "high-performance" });
if (adapter == null) {
Expand Down

0 comments on commit 2805c13

Please sign in to comment.