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?
我使用的FBO在我的OpenGL代码和我看到的GL \ _FRAMEBUFFER \ _INCOMPLETE \ _DUPLICATE \ _ATTACHMENT \ _ext编译错误。造成这种情况的原因是什么?如何解决?
1 个解决方案
#1
4
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.
造成此错误的原因是NVIDIA的旧版本glext.h,它仍然具有此定义。而最新版本的GLEW却没有。这会导致您之前编写或从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):
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.
To fix this error, remove all usage of GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT from your code.
要修复此错误,请从代码中删除GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT的所有用法。
If this isn't possible in your setup, then add a dummy definition to your glext.h or glew.h file like this:
如果在您的设置中无法做到这一点,那么在glext.h或glew.h文件中添加一个虚拟定义,如下所示:
#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
#1
4
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.
造成此错误的原因是NVIDIA的旧版本glext.h,它仍然具有此定义。而最新版本的GLEW却没有。这会导致您之前编写或从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):
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.
To fix this error, remove all usage of GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT from your code.
要修复此错误,请从代码中删除GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT的所有用法。
If this isn't possible in your setup, then add a dummy definition to your glext.h or glew.h file like this:
如果在您的设置中无法做到这一点,那么在glext.h或glew.h文件中添加一个虚拟定义,如下所示:
#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8