PPet icon indicating copy to clipboard operation
PPet copied to clipboard

开启gpu支持

Open Moe-hacker opened this issue 1 year ago • 4 comments

cpu渲染风扇声太大,尝试开启gpu渲染有所好转。 系统:Kali GNU/Linux Rolling 源码为最新版本。 由于本人没学过相关内容,部分改动无法保证正确性:

diff --git a/src/main/index.ts b/src/main/index.ts
index 4089d20..ec172df 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -10,9 +10,11 @@ import { createWindow, winPagePathMap } from './window'
 
 remoteMain.initialize()
 
+app.disableDomainBlockingFor3DAPIs()
+/*
 const isWin7 = os.release().startsWith('6.1')
 if (isWin7) app.disableHardwareAcceleration()
-
+*/
 if (app.isPackaged) {
   if (!app.requestSingleInstanceLock()) {
     app.quit()
@@ -22,11 +24,11 @@ if (app.isPackaged) {
     app.dock.hide()
   }
 }
-
+/*
 app.commandLine.appendSwitch('disable-renderer-backgrounding')
 app.commandLine.appendSwitch('disable-background-timer-throttling')
 app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required')
-
+*/
 let mainWindowState: windowStateKeeper.State
 
 app

修改后正常运行,cpu占用明显减少。

Moe-hacker avatar May 20 '23 06:05 Moe-hacker

这个好

jmjoy avatar Dec 11 '23 10:12 jmjoy

我在master分支上也没看见这个 文件的代码呀?你用的那个分支呀?

crownclownwl avatar Jun 16 '24 11:06 crownclownwl

大佬你能帮我打包一个 deb 吗?我这运行不起来代码

crownclownwl avatar Jun 16 '24 11:06 crownclownwl

好了 多打包几次就好了

crownclownwl avatar Jun 17 '24 17:06 crownclownwl