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 3 of 3

Thread: Is there any chance to get only compiling or linking error message for shader program

  1. #1
    Intern Newbie
    Join Date
    May 2014
    Posts
    40

    Is there any chance to get only compiling or linking error message for shader program

    We can create a separable program for a single shader stage using glCreateShaderProgramv. But the output we get from this API is already a (separable) program object. So if there is any compiling or linking error, the only way I know of to get the compiling state and the info log is to call glGetProgramiv with GL_LINK_STATUS. My questions are:

    1) From what the pname GL_LINK_STATUS suggests, it seems that we can only get info log about linking. If it is the case, is there any way to get compiling error messages when using glCreateShaderProgramv?
    2) I tried with some syntactic errors in shaders for shader program. It seems that compiling errors can also be obtained with GL_LINK_STATUS. So, does GL_LINK_STATUS actually contain both compiling and linking info log when using glCreateShaderProgramv? If so, is there any chance to distinguish compiling messages from linking messages, that is, to retrieve ONLY compiling error messages when using glCreateShaderProgramv? PS: I know I can use traditional two-stage compilation process to separate compiling and linking error messages when using separate programs, but I just want to know how to do it with glCreateShaderProgramv API.

    I am using nVidia GeForce GTX 780Ti on Windows 10, with latest driver installed.

    Thanks.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,887
    Quote Originally Posted by zzzhhh View Post
    1) From what the pname GL_LINK_STATUS suggests, it seems that we can only get info log about linking. If it is the case, is there any way to get compiling error messages when using glCreateShaderProgramv?
    The specification says (§7.3):
    Because no shader is returned by CreateShaderProgramv and the shader that is created is deleted in the course of the command sequence, the info log of the shader object is copied to the program so the shader’s failed info log for the failed compilation is accessible to the application.
    Quote Originally Posted by zzzhhh View Post
    If so, is there any chance to distinguish compiling messages from linking messages, that is, to retrieve ONLY compiling error messages when using glCreateShaderProgramv? PS: I know I can use traditional two-stage compilation process to separate compiling and linking error messages when using separate programs, but I just want to know how to do it with glCreateShaderProgramv API.
    No.

    The nature of any given error message should be enough to determine whether it arose from compilation or linking, but there's no reliable way to make the distinction algorithmically.

  3. #3
    Intern Newbie
    Join Date
    May 2014
    Posts
    40
    I got it. Thank you.

Posting Permissions

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