OpenGL:如何检查用户 GFX 卡是否可以使用我的着色器渲染?
如果用户不支持我为更快地渲染某些内容而制作的着色器,我需要进行后备。
那么,我到底如何检查这些东西呢?我知道某些 GLSL 版本不支持某些着色器函数,但是,这些函数及其所需版本的完整列表在哪里?
但问题是,我不知道我到底需要知道什么才能知道谁可以渲染该着色器。是否只是检查哪个 GLSL 版本支持哪个功能?还是还有什么需要了解的?我想100%确定何时切换到回退渲染以及何时使用 GLSL 渲染。
我知道如何检索 GLSL 和 OpenGL 版本字符串。
I need to make a fallback if the user doesnt support the shader i have made to render some things faster.
So, how exactly do i check these things? I know some of the shader functions are not supported by some GLSL versions, but, where is the complete list of these functions vs versions they need?
But the problem is, i dont know what exactly i need to know in order to know who can render that shader. Is it only about checking which function is supported by which GLSL version? or is there something more to know? I want to be 100% sure when to switch to fallback render and when to use GLSL render.
I know how to retrieve the GLSL and OpenGL version strings.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果
glLinkProgram
设置 GL 错误状态,则着色器( s) 与该卡不兼容。If
glLinkProgram
sets the GL error state then the shader(s) are not compatible with the card.调用
glLinkProgram
后,建议检查链接状态,方法是:这将为您提供一个布尔值,指示程序是否链接良好。您还有一个可用的
GL_COMPILE_STATUS
。大多数时候,这将表明程序是否无法在您的平台上编译或链接。
但请注意,程序可能链接良好,但不适合在您的硬件上运行,在这种情况下,GL 渲染将回退到软件渲染,并且速度很慢。
在这种情况下,如果幸运的话,您将在此链接日志中收到一条消息,但该消息取决于平台。
After calling
glLinkProgram
, it is advised to check the link status, by using :This will give you a boolean value indicating if the program linked fine. You also have a
GL_COMPILE_STATUS
available.Most of the time, this will indicate if the program fails to compile or link on your platform.
Be advised, though, that a program may link fine but not be suitable to run on your hardware, in this case the GL rendering will fallback on software rendering, and be slow slow slow.
In this case, if you're lucky, you'll get a message in this link log, but this message is platform dependent.