mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 14:50:02 +00:00
fix(engine): scope WebGPU flag to hardware mode
This commit is contained in:
@@ -20,6 +20,7 @@ describe("buildChromeArgs browser GPU mode", () => {
|
|||||||
it("uses SwiftShader software GL by default for reproducible local renders", () => {
|
it("uses SwiftShader software GL by default for reproducible local renders", () => {
|
||||||
const args = buildChromeArgs(base);
|
const args = buildChromeArgs(base);
|
||||||
expect(args).toContain("--enable-features=CanvasDrawElement");
|
expect(args).toContain("--enable-features=CanvasDrawElement");
|
||||||
|
expect(args).not.toContain("--enable-unsafe-webgpu");
|
||||||
expect(args).toContain("--use-gl=angle");
|
expect(args).toContain("--use-gl=angle");
|
||||||
expect(args).toContain("--use-angle=swiftshader");
|
expect(args).toContain("--use-angle=swiftshader");
|
||||||
expect(args).toContain("--enable-unsafe-swiftshader");
|
expect(args).toContain("--enable-unsafe-swiftshader");
|
||||||
@@ -28,6 +29,7 @@ describe("buildChromeArgs browser GPU mode", () => {
|
|||||||
|
|
||||||
it("uses Metal-backed ANGLE for hardware browser GPU mode on macOS", () => {
|
it("uses Metal-backed ANGLE for hardware browser GPU mode on macOS", () => {
|
||||||
const args = buildChromeArgs({ ...base, platform: "darwin" }, { browserGpuMode: "hardware" });
|
const args = buildChromeArgs({ ...base, platform: "darwin" }, { browserGpuMode: "hardware" });
|
||||||
|
expect(args).toContain("--enable-unsafe-webgpu");
|
||||||
expect(args).toContain("--use-gl=angle");
|
expect(args).toContain("--use-gl=angle");
|
||||||
expect(args).toContain("--use-angle=metal");
|
expect(args).toContain("--use-angle=metal");
|
||||||
expect(args).toContain("--enable-gpu-rasterization");
|
expect(args).toContain("--enable-gpu-rasterization");
|
||||||
|
|||||||
@@ -504,7 +504,6 @@ export function buildChromeArgs(
|
|||||||
"--disable-setuid-sandbox",
|
"--disable-setuid-sandbox",
|
||||||
"--disable-dev-shm-usage",
|
"--disable-dev-shm-usage",
|
||||||
CANVAS_DRAW_ELEMENT_FEATURE_FLAG,
|
CANVAS_DRAW_ELEMENT_FEATURE_FLAG,
|
||||||
WEBGPU_FLAG,
|
|
||||||
"--enable-webgl",
|
"--enable-webgl",
|
||||||
"--ignore-gpu-blocklist",
|
"--ignore-gpu-blocklist",
|
||||||
...getBrowserGpuArgs(browserGpuMode, platform),
|
...getBrowserGpuArgs(browserGpuMode, platform),
|
||||||
@@ -538,6 +537,10 @@ export function buildChromeArgs(
|
|||||||
"--disable-features=AudioServiceOutOfProcess,IsolateOrigins,site-per-process,Translate,BackForwardCache,IntensiveWakeUpThrottling",
|
"--disable-features=AudioServiceOutOfProcess,IsolateOrigins,site-per-process,Translate,BackForwardCache,IntensiveWakeUpThrottling",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (browserGpuMode !== "software") {
|
||||||
|
chromeArgs.push(WEBGPU_FLAG);
|
||||||
|
}
|
||||||
|
|
||||||
// BeginFrame flags — only when using chrome-headless-shell on Linux
|
// BeginFrame flags — only when using chrome-headless-shell on Linux
|
||||||
if (options.captureMode !== "screenshot") {
|
if (options.captureMode !== "screenshot") {
|
||||||
chromeArgs.push(
|
chromeArgs.push(
|
||||||
|
|||||||
Reference in New Issue
Block a user