GL_INVALID_ENUM occurs in glGetFramebufferAttachme

This topic contains 2 replies, has 2 voices, and was last updated by  PenCyot3 6 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30573

    PenCyot3
    Member

    A GL_INVALID_ENUM error occurred when I acquired an object type for the attachment point that an object was not installed.

    It occurs in the following source codes.

      GLuint renderbuffer = 0;
      glGenRenderbuffers( 1, &renderbuffer );
      glBindRenderbuffer( GL_RENDERBUFFER, renderbuffer );
      glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, 256, 256 );

      GLuint framebuffer;
      glGenFramebuffers( 1, &framebuffer );
      glBindFramebuffer( GL_FRAMEBUFFER, framebuffer );
      glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, renderbuffer );

      if ( glCheckFramebufferStatus( GL_FRAMEBUFFER ) == GL_FRAMEBUFFER_COMPLETE ) {
          GLint type = 0;
          glGetFramebufferAttachmentParameteriv( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
                                                 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
                                                 &type );
          GLenum error = glGetError();
          if ( error != GL_NO_ERROR ) {
              LOGE( “glGetError() == 0x%04xn”, error );
          }
      }

    When I ran this, “glGetError() == 0x0500” was output. (GL_INVALID_ENUM)

    GL_NONE should be returned to type without an error occurring.

    I tested it in Galaxy S (SC-02B Android 2.3.3 GINGERBREAD.OMKE3).

    #34976

    Hi PenCyot3,

    Is the error definitely generated at this point? Have you tried putting earlier error checks to see if it’s another call that might be doing this?

    Thanks,

    Tobias

    #34977

    PenCyot3
    Member

    The error was generated only at a place of glGetFramebufferAttachmentParameteriv().

    I did the error check of all the GL commands in early stage, but erased other glGetError() to do a code clearly.

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.