Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: glCompileShaderARB crashes

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2005
    Posts
    2

    glCompileShaderARB crashes

    Not sure if this is the right place to post this...

    I've got a program that crashes on glCompileShaderARB. The problem seems to be related to the use of gl_TexCoord in a GLSL fragment shader. I've reduced it to the following minimal example:
    Code :
    #include "SDL.h"
    #include "GL/glew.h"
     
    char const *shader_source =
      "uniform sampler2D texture;\n"
      "void main()\n"
      "{\n"
      "  gl_FragColor = texture2D(texture, gl_TexCoord[0].st);\n"
      "}\n";
     
    int main(int, char *[])
    {
      SDL_Init(SDL_INIT_VIDEO);
      SDL_SetVideoMode(640, 480, 32, SDL_OPENGL);
      glewInit();
      GLhandleARB shader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
      glShaderSourceARB(shader, 1, &shader_source, 0);
      glCompileShaderARB(shader);
      SDL_Quit();
      return 0;
    }
    This crashes on my Mac Mini. It does not crash on any other computer I've tried, but I've only tried one other computer. The Mac Mini has OS X 10.3.8 installed, and identifies its video card as ATY,RV280, vendor ATI. This looks like a driver bug to me, although I don't want to rule out other possibilities.

    Questions: Can anybody confirm this bug? How widespread is it? Are there any known workarounds?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Feb 2004
    Location
    Los Angeles, CA
    Posts
    154

    Re: glCompileShaderARB crashes

    RV280 (based on the dinosaur that is R200) doesn't support GLSL.
    Get yourself at least something based on the R300 or NV30 architecture.

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2005
    Posts
    2

    Re: glCompileShaderARB crashes

    Upgrading my hardware isn't really a solution, since other people will still be running on old hardware. BTW, my Mac Mini might be very low end crap, but it isn't actually more than a couple of months old.

    Actually my program runs fine on most OpenGL cards, including very old cards. I use GLEW_ARB_fragment_shader to detect if GLSL fragment shaders are supported, use a fragment shader if available, and use a workaround if not. My Mac Mini reports that GLSL fragment shaders are supported.

    If the RV280 erronously claims to support fragment shaders, then I have the following options:

    • Never use fragment shaders and always use the workaround.
    • Try to somehow detect if the hardware erronously claims to support GLSL fragment shaders.
    • Leave the decision up to the user.
    • Fail to run on hardware that erronously claims to support GLSL shaders.

    None of these options seem very attractive to me.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Jan 2001
    Location
    NVIDIA, Austin, TX
    Posts
    591

    Re: glCompileShaderARB crashes

    The current release of Mac OS X doesn't really support GLSL on any card (any your specifically will never run ARB_fragment_shader in hardware) but does advertise most of the GLSL extensions, which the exception of GL_ARB_shading_language_100.

    They support the GLSL API, but the actual shader compiler isn't in there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •