gpt4 book ai didi

android - 确定 Android 中 GPU 存在的最简单方法是什么?

转载 作者:行者123 更新时间:2023-11-30 04:11:01 24 4
gpt4 key购买 nike

在我的应用程序中,我根据 GPU 的存在以不同方式渲染图像(在有 GPU 时使用 OpenGL)。

目前我有一个配置选项。

但我希望我的应用程序通过某种方法自动检测 GPU 是否存在,一些快速测试。我认为没有允许这样做的直接 API。但是,那应该测试什么呢?

最佳答案

它不像 bool 值那么简单,但你可以尝试类似的东西

glGetString(GL_VENDOR);
glGetString(GL_RENDERER);

并尝试根据已知的 GPU 供应商列表来确定它。这是 OpenGL 手册页必须说明的内容:

Because the GL does not include queries for the performance characteristics of an implementation, some applications are written to recognize known platforms and modify their GL usage based on known performance characteristics of these platforms. Strings GL_VENDOR and GL_RENDERER together uniquely specify a platform. They do not change from release to release and should be used by platform-recognition algorithms.

举个例子,我的设备返回:

Vendor:   NVIDIA Corporation
Renderer: NVIDIA Tegra

关于android - 确定 Android 中 GPU 存在的最简单方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10862782/

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