GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 错误

发布于 2024-07-04 06:24:49 字数 214 浏览 6 评论 0原文

我在 OpenGL 代码中使用 FBO,并且在 GL\_FRAMEBUFFER\_INCOMPLETE\_DUPLICATE\_ATTACHMENT\_EXT。 这是什么原因以及如何解决?

I'm using FBOs in my OpenGL code and I'm seeing compilation errors on GL\_FRAMEBUFFER\_INCOMPLETE\_DUPLICATE\_ATTACHMENT\_EXT. What's the cause of this and how do I fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

箜明 2024-07-11 06:24:49

造成这个错误的原因是NVIDIA的glext.h的旧版本,它仍然有这个定义。 而最新版本的 GLEW 则不然。 这会导致您之前编写的或从网上获取的代码出现编译错误。

FBO 的 GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 定义曾经出现在规范中(因此也出现在头文件中)。 但是,后来它被删除了。 其原因可以在 FBO 扩展规范(查找问题 87):

(87) What happens if a single image is attached more than once to a
     framebuffer object?

     RESOLVED: The value written to the pixel is undefined.

     There used to be a rule in section 4.4.4.2 that resulted in
     FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT if a single
     image was attached more than once to a framebuffer object.

         FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT   0x8CD8

         * A single image is not attached more than once to the
           framebuffer object.

           { FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT }

     This rule was removed in version #117 of the
     EXT_framebuffer_object specification after discussion at the
     September 2005 ARB meeting.  The rule essentially required an
     O(n*lg(n)) search.  Some implementations would not need to do that
     search if the completeness rules did not require it.  Instead,
     language was added to section 4.10 which says the values
     written to the framebuffer are undefined when this rule is
     violated.

要修复此错误,请从代码中删除所有 GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 的使用。

如果您的设置无法做到这一点,请向您的 glext.hglew.h 文件添加一个虚拟定义,如下所示:

#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8

The cause of this error is an older version of NVIDIA's glext.h, which still has this definition. Whereas the most recent versions of GLEW don't. This leads to compilation errors in code that you had written previously or got from the web.

The GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT definition for FBO used to be present in the specification (and hence in header files). But, it was later removed. The reason for this can be found in the FBO extension specification (look for Issue 87):

(87) What happens if a single image is attached more than once to a
     framebuffer object?

     RESOLVED: The value written to the pixel is undefined.

     There used to be a rule in section 4.4.4.2 that resulted in
     FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT if a single
     image was attached more than once to a framebuffer object.

         FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT   0x8CD8

         * A single image is not attached more than once to the
           framebuffer object.

           { FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT }

     This rule was removed in version #117 of the
     EXT_framebuffer_object specification after discussion at the
     September 2005 ARB meeting.  The rule essentially required an
     O(n*lg(n)) search.  Some implementations would not need to do that
     search if the completeness rules did not require it.  Instead,
     language was added to section 4.10 which says the values
     written to the framebuffer are undefined when this rule is
     violated.

To fix this error, remove all usage of GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT from your code.

If this isn't possible in your setup, then add a dummy definition to your glext.h or glew.h file like this:

#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文