2 Replies Latest reply on Oct 18, 2010 4:06 AM by frali

    glGetIntegerv fails with valid enum values.

    nesister

      Hi,

      with latest amd drivers installed (catalyst 10.9) glGetIntegerv fails with the following enum values :

      • GL_FRAGMENT_SHADER_DERIVATIVE_HINT
      • GL_MAX_VERTEX_OUTPUT_COMPONENTS
      • GL_MAX_FRAGMENT_INPUT_COMPONENTS
      • GL_MAX_GEOMETRY_OUTPUT_COMPONENTS
      • GL_MAX_GEOMETRY_INPUT_COMPONENTS

      Using those values in glGetIntegerv generate a GL_INVALID_ENUM error in an OpenGL 4.0 compatibility profile context. Edit: Result is the same on windows and linux.

      I have a simple test case I can provide if you want.

        • glGetIntegerv fails with valid enum values.
          nesister

          Here's the test case :

           

          #include <GL/glut.h>

          #include <GL/glext.h>

          #include <cstdio>

          #include <sstream>

          #include <iostream>

           

          #define WIDTH 640

          #define HEIGHT 480

           

          std::string enum_name(GLenum value);

           

          int

          main(int argc, char **argv)

          {

          glutInit(&argc, argv);

          glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);

          glutInitWindowSize(WIDTH, HEIGHT);

           

          int window = glutCreateWindow(argv[0]);

           

          std::cout << "GL_VENDOR=" << glGetString(GL_VENDOR) << std::endl;

          std::cout << "GL_RENDERER=" << glGetString(GL_RENDERER) << std::endl;

          std::cout << "GL_VERSION=" << glGetString(GL_VERSION) << std::endl;

           

          #define TEST_ERROR(msg) \

          std::cout << msg << enum_name(glGetError()) << std::endl

          #define TEST(x) \

          { \

          TEST_ERROR("Error status before testing " #x "="); \

          GLint value; \

          glGetIntegerv(x, &value); \

          std::cout << #x "=" << value << std::endl; \

          TEST_ERROR("Error status after testing " #x "="); \

          }

           

          TEST(GL_MAX_GEOMETRY_INPUT_COMPONENTS);

          TEST(GL_MAX_GEOMETRY_OUTPUT_COMPONENTS);

          TEST(GL_MAX_FRAGMENT_INPUT_COMPONENTS);

          TEST(GL_FRAGMENT_SHADER_DERIVATIVE_HINT);

           

          glutDestroyWindow(window);

           

          return getchar();

          }

           

          std::string

          enum_name(GLenum value)

          {

          switch (value) {

          #define ENUM_NAME(x) case x: return #x;

          ENUM_NAME(GL_NO_ERROR);

          ENUM_NAME(GL_INVALID_ENUM);

          ENUM_NAME(GL_INVALID_VALUE);

          ENUM_NAME(GL_INVALID_OPERATION);

          ENUM_NAME(GL_STACK_OVERFLOW);

          ENUM_NAME(GL_STACK_UNDERFLOW);

          ENUM_NAME(GL_OUT_OF_MEMORY);

          ENUM_NAME(GL_TABLE_TOO_LARGE);

          ENUM_NAME(GL_INVALID_FRAMEBUFFER_OPERATION);

          #undef ENUM_NAME

          default:;

          }

           

          std::stringstream unknown;

              unknown << "unknown enum (0x" << std::hex << value << ')';

           

          return unknown.str();

          }



           

          And this is what it outputs:

           

          GL_VENDOR=ATI Technologies Inc.

          GL_RENDERER=ATI Radeon HD 5600 Series

          GL_VERSION=4.0.10188 Compatibility Profile Context

          Error status before testing GL_MAX_GEOMETRY_INPUT_COMPONENTS=GL_NO_ERROR

          GL_MAX_GEOMETRY_INPUT_COMPONENTS=-858993460

          Error status after testing GL_MAX_GEOMETRY_INPUT_COMPONENTS=GL_INVALID_ENUM

          Error status before testing GL_MAX_GEOMETRY_OUTPUT_COMPONENTS=GL_NO_ERROR

          GL_MAX_GEOMETRY_OUTPUT_COMPONENTS=-858993460

          Error status after testing GL_MAX_GEOMETRY_OUTPUT_COMPONENTS=GL_INVALID_ENUM

          Error status before testing GL_MAX_FRAGMENT_INPUT_COMPONENTS=GL_NO_ERROR

          GL_MAX_FRAGMENT_INPUT_COMPONENTS=-858993460

          Error status after testing GL_MAX_FRAGMENT_INPUT_COMPONENTS=GL_INVALID_ENUM

          Error status before testing GL_FRAGMENT_SHADER_DERIVATIVE_HINT=GL_NO_ERROR

          GL_FRAGMENT_SHADER_DERIVATIVE_HINT=-858993460

          Error status after testing GL_FRAGMENT_SHADER_DERIVATIVE_HINT=GL_INVALID_ENUM