Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Test for support for glCreateShader ?

  1. #1
    Intern Newbie
    Join Date
    Apr 2011
    Posts
    37

    Test for support for glCreateShader ?

    I've wrote a small program and have been testing it on older machines to see where it breaks to try to increase the compatibility.
    Currently I'm running into a problem with a Geforce 3 card and glCreateShader. If I check for GL_ARB_shading_language_100 it comes back ok, however calling glCreateShader crashes the program.
    I know the card only has limited shader support, however what is the best way to check for this support? All examples I have found only check for GL_ARB_shading_language_100 and then set all the extentions for shaders, however this is not enough as even though GL_ARB_shading_language_100 comes back, glCreateShader will just crash.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,732

    Re: Test for support for glCreateShader ?

    You should be using an extension loading library.

    Also, glCreateShader is not an extension function. It is a core function in OpenGL version 2.0 and above. So check the version number if you want that particular function.

    Furthermore, GL_ARB_shading_language_100 means very little. All it means is that the implementation supports GLSL version 1.00. It says nothing about how to use it.

    In general, you should first check for GL version 2.0 and above. If that is available, then you can use the regular core shader API. If it is not, then you should check for ARB_shader_objects. That is the extension that has the shader and program functions in it, which are different from the GL 2.0 core functionality. The core shader objects are GLuint's; the extension-based shader objects are GLhandleARB's.

    ARB_shader_objects defines glCreateShaderARB and similar functions. But that only defines the API; it doesn't define any of the shader stages. The shader stages are defined by the extensions ARB_vertex_shader and ARB_fragment_shader. It is possible for a driver to only expose one of these stages. For example, your GeForce 3 card can't even begin to handle ARB_fragment_shader, so if you get shader objects at all, it will only be ARB_vertex_shader.

    Note that 2.0 and above (which your GeForce 3 card doesn't support) doesn't care about any of the above. All GL 2.0 and above implementations will have both vertex and fragment shaders available.

  3. #3
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: Test for support for glCreateShader ?

    Geforce 3 should support GL 1.5
    If they added ARB_shader_objects and such, I would be surprised. Perhaps it supports ARB_vertex_shader but it would fail for most vertex shaders due to its hw limits.

    Suggest that you buy a new computer.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  4. #4
    Junior Member Regular Contributor
    Join Date
    Dec 2009
    Posts
    178

    Re: Test for support for glCreateShader ?

    http://feedback.wildfiregames.com/re...evice/GeForce3:

    Vertex shaders are supported, but no Fragment shaders (even on GeForce2 MX). They may be emulated in software though.

  5. #5
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,171

    Re: Test for support for glCreateShader ?

    I remember my GeForce 4200Ti did not support Fragment shaders but did support Vertex Shaders. That was one of the reasons why I binned the card in the end.

  6. #6
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Test for support for glCreateShader ?

    Please note that the OP specifically asked for help to "increase the compatibility" of a working program on older machines, no need to suggest to buy new hardware...

  7. #7
    Intern Newbie
    Join Date
    Apr 2011
    Posts
    37

    Re: Test for support for glCreateShader ?

    @Alfonse Reinheart
    Thanks for the information, this is very helpful stuff!

    Yea, I know I should be using an extension loading library, but right now I'm learning and would like to see how this all works.

  8. #8
    Advanced Member Frequent Contributor
    Join Date
    Jan 2007
    Posts
    965

    Re: Test for support for glCreateShader ?

    I'm wondering if it's worth worrying about compatibility with something as ancient as a GF3 - are there even any of those still in active usage out there in the wild? And if so, would someone who has one be included in the potential target audience for your program? And if so, is it worth the investment of your time and effort to get your program working for someone who might still have one?

    Anyway, if you do want to support something that old maybe you should be looking at ARB_vertex_program and ARB_fragment_program instead?

  9. #9
    Intern Newbie
    Join Date
    Apr 2011
    Posts
    37

    Re: Test for support for glCreateShader ?

    I don't really have a huge test bed of computers here. I have a modern Geforce, a mid range ATI, and a box of old computer parts from years ago. The Geforce 3 was found in the box.
    What I'm aiming for is to make sure it works on laptops with integrated graphics that don't have shader support. I figured if I make sure it works on some ancient computer, the chances of it working on a laptop with integrated graphics are better.
    I also would rather people booting it up with machines that can't run don't just get an unknown windows crash error, so I'm working on better error reporting as well. This is my first openGL program so it's worth it to me to have a solid base to use in all my future projects.

  10. #10
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,732

    Re: Test for support for glCreateShader ?

    This is my first openGL program so it's worth it to me to have a solid base to use in all my future projects.
    Your first OpenGL program should not be trying to target a huge range of hardware with multiple rendering backends.

Posting Permissions

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