cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

mighttower
Adept I

CodeXl reports API Errors when deleting a shader program

Hello,

I have the following scenario:

I run a program in CodeXL everything works fine, just when I close the program CodeXL reports several API Errors which are all thrown from "glDeleteProgram(id)".

It is correct that at the end of my application all shader programs are deleted but I dont understand why there is are API Errors like:

OpenGL Debug Output: API Error, glGetProgramiv parameter <program> has an invalid value '3': must be a valid program object name (GL_INVALID_VALUE)

OpenGL Debug Output: API Error, glGetProgramiv parameter <program> has an invalid value '3': must be a valid program object name (GL_INVALID_VALUE)

OpenGL Debug Output: API Error, glGetShaderiv parameter <shader> has an invalid value '1': must be a valid shader object name (GL_INVALID_VALUE)

OpenGL Debug Output: API Error, glGetShaderiv parameter <shader> has an invalid value '1': must be a valid shader object name (GL_INVALID_VALUE)

OpenGL Debug Output: API Error, glGetShaderiv parameter <shader> has an invalid value '2': must be a valid shader object name (GL_INVALID_VALUE)

OpenGL Debug Output: API Error, glGetShaderiv parameter <shader> has an invalid value '2': must be a valid shader object name (GL_INVALID_VALUE)

Program 3 was used in the shader and worked correctly, ids 1 and 2 are the shaders for that program which I marked for deletion (glDeleteShader and that the shader id to 0 afterwards) after glLinkProgram.

Since I can not look into glDeleteProgram, I can not say what is going wrong, I hope/think that I am doing everything right.

Maybe somebody has a hint or can Report the same behaviour?
Thank you

Marc


0 Likes
1 Solution

Hi Marc,

Those errors might be generated by CodeXL's internal mechanisms trying to update the status of the shader and programs. This is a known issue and will be fixed in a future release of CodeXL.

1. To make sure this is the case, you can set breakpoints on glDeleteProgram and glDeleteShader and observe that the messages only appear after the respective delete for each object.

2. To make sure your code is not actually generating errors of its own (e.g. by keeping the to-be-deleted object in a member somewhere and performing queries), you can either:

A. Set a breakpoint on glGetProgramiv and glGetShaderiv as well as glDeleteProgram and glDeleteShader, and see if your application performs any queries after deletion

B. Set a breakpoint on "Break on OpenGL Errors" and see if any of your OpenGL calls are generating errors (this is useful otherwise as well 😃 ).

C. Set a breakpoint on OpenGL debug output, by opening the OpenGL debug output extension settings dialog under CodeXL's breakpoints menu; checking both boxes in the "general settings" pane; and checking "API Error" in the categories pane.

3. If the errors are indeed being generated by CodeXL and you do not wish to see them, you can stop them from appearing by opening the OpenGL debug output extension settings dialog under CodeXL's breakpoints menu; checking only the "enable" box in the "general settings" pane, and clearing all the checkboxes in the categories pane. This essentially tells CodeXL to set the debug output settings to an empty reporting mask, which means no messages will be shown.

Hope this helps,

View solution in original post

0 Likes
1 Reply

Hi Marc,

Those errors might be generated by CodeXL's internal mechanisms trying to update the status of the shader and programs. This is a known issue and will be fixed in a future release of CodeXL.

1. To make sure this is the case, you can set breakpoints on glDeleteProgram and glDeleteShader and observe that the messages only appear after the respective delete for each object.

2. To make sure your code is not actually generating errors of its own (e.g. by keeping the to-be-deleted object in a member somewhere and performing queries), you can either:

A. Set a breakpoint on glGetProgramiv and glGetShaderiv as well as glDeleteProgram and glDeleteShader, and see if your application performs any queries after deletion

B. Set a breakpoint on "Break on OpenGL Errors" and see if any of your OpenGL calls are generating errors (this is useful otherwise as well 😃 ).

C. Set a breakpoint on OpenGL debug output, by opening the OpenGL debug output extension settings dialog under CodeXL's breakpoints menu; checking both boxes in the "general settings" pane; and checking "API Error" in the categories pane.

3. If the errors are indeed being generated by CodeXL and you do not wish to see them, you can stop them from appearing by opening the OpenGL debug output extension settings dialog under CodeXL's breakpoints menu; checking only the "enable" box in the "general settings" pane, and clearing all the checkboxes in the categories pane. This essentially tells CodeXL to set the debug output settings to an empty reporting mask, which means no messages will be shown.

Hope this helps,

0 Likes