OpenGL 着色器是在 GPU 还是 CPU 上编译的? GPU 制造商的二进制输出有何不同?
第一的; OpenGL 着色器是如何编译的?它们是在 CPU 还是 GPU 上编译的,还是因实现而异?不同的供应商有不同的二进制输出吗?如果是这样,是否可以在另一种 GPU 上交叉编译一种 GPU 类型的二进制文件?我正在开发一款游戏,计划在 Intel GFX 芯片、ATI 卡和 NVidia 卡上运行。我更愿意只提供着色器的二进制部分,而不必在客户端计算机上编译源代码。这可能吗?着色器编译过程是如何进行的?
First; how are OpenGL shaders compiled? Are they compiled on the CPU, or the GPU, or does it vary by implementation? Do different vendors have different binary outputs; if so, is it possible to cross-compile a binary for one GPU type on another GPU? I'm developing a game that I am planning on running on Intel GFX chips, ATI cards, and NVidia cards. I would prefer to ship only the binary parts of the shaders, without having to compile the source on the client computers. Is this possible? How does the process of shader compilation work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,编译过程是在CPU上执行的。然而,输出不仅因供应商而异,而且因型号而异。因此,必须在用户的计算机上重新编译着色器,以便与用户可能使用的任何 GPU 型号保持兼容(包括在编写游戏时可能不存在的 GPU 型号!)
The compilation process is, generally speaking, performed on the CPU. However, the output differs not just by vendor, but also by model. As such, the shaders must be recompiled on the user's machine in order to remain compatible with any model of GPU the user may be using (including models of GPU that may not exist when you're writing your game!)