gpt4 book ai didi

javascript - 是否可以在Electron中禁用failIfMajorPerformanceCaveat安全措施?

转载 作者:行者123 更新时间:2023-12-03 12:35:32 25 4
gpt4 key购买 nike

获取WebGL上下文时,可以指定failIfMajorPerformanceCaveat属性:

var context = canvas.getContext('webgl', {'failIfMajorPerformanceCaveat': true});

引用 this page关于该属性的信息:

Because of the direct access to the GPU allowed by WebGL, browsers must ensure that running your code will not cause a major security issue. For some specific drivers that are not perfectly secure, the browser can prevent hardware acceleration in order to prevent security issues. [...] On these devices, WebGL will software rendering instead, resulting in a slower but safer experience.



如果我在应用程序中未使用任何外部,远程,第三方代码,是否可以在Electron中轻松禁用安全措施?

最佳答案

实际上,有关failIfMajorPerformanceCaveat的正确报价是:

Context creation will fail if the implementation determines that the performance of the created WebGL context would be dramatically lower than that of a native application making equivalent OpenGL calls.



您引用的内容下面的段落指出:

To enforce this, IE has a block-list of drivers that are not safe for use with hardware acceleration. On these devices, WebGL will software rendering instead, resulting in a slower but safer experience.



Chrome (因此 Electron )具有相同的功能,可以通过设置#ignore-gpu-blacklist标志来禁用它:

Overrides the built-in software rendering list and enables GPU-acceleration on unsupported system configurations.



请注意,尽管这些已被列入 reasons的黑名单

关于javascript - 是否可以在Electron中禁用failIfMajorPerformanceCaveat安全措施?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49321559/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com