openGL扩展的可用性和不同的GPU品牌
我在 Windows 上使用 openFrameworks,它使用 GLFW 和 GLEW,我在不同 GPU 品牌上的扩展可用性方面遇到问题。
基本上,如果我在 openGL 2 上运行我的程序,扩展是可用的。但是,如果我更改为 openGL 3.2 或更高版本,则所有扩展在 Nvida(在 * GTX1080 上测试)和 Intel (*UHD) 上都不可用,但在 AMD(*Vega Mobile GL/GH 和 RX 5700)上不可用。
这意味着无法使用 GL_ARB_texture_float,因此我的计算着色器无法按预期工作。
我正在使用 openGL 4.3,用于计算着色器支持和英特尔 GPU 支持。所有驱动程序都是最新的,所有 GPU 都支持 GL_ARB_texture_float。
此外,在 GLSL 上启用扩展没有任何作用。
这就是 openFrameworks 制作上下文的方式:
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, settings.glVersionMajor);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, settings.glVersionMinor);
if((settings.glVersionMajor==3 && settings.glVersionMinor>=2) || settings.glVersionMajor>=4)
{
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
}
if(settings.glVersionMajor>=3)
{
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
}
不确定发生了什么,也不知道如何搜索这样的问题。欢迎任何指点!
回答
ARB_texture_float 是一个古老的扩展,它在 3.0 中被合并到 OpenGL 中。也就是说,如果您要求 3.2,您可以只对纹理使用浮点格式。它们随时可用。
此外,后来的 GL 版本添加了更多的浮点格式。
由于没有低于 3.2 版的 OpenGL 核心配置文件,我怀疑这些实现根本不是广告扩展,如果您要求核心配置文件,它们早已成为核心 OpenGL 的一部分。
- @Hubris: Then this is an [XY Problem](https://xyproblem.info/)
- @Hubris: "*but isn't core issue is still the same?*" No. You asked about what extensions are deemed to be available or not. What you're looking for is why your compute shaders aren't writing to images correctly. That's an XY problem: you *think* the solution is extensions and formats, while the fact that you mentioned "compute shaders", "textures", and "nothing is written" tells me that your actual problem has nothing to do with the GPU or extensions. So post a new question about your actual problem *including* an [mcve]
- @Hubris: How do you know that it "doesn't work"?