Jump to content
  • Advertisement
Sign in to follow this  
Raycast

glDispatchCompute fails after calling glClear

This topic is 627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

I'm experiencing a weird error and I have absolutely no idea what could possibly cause it.

When calling glDispatchCompute I get the following error message: GL_INVALID_OPERATION error generated. State(s) are invalid: program pipeline config.

The code looks like this:

glClear(GL_COLOR_BUFFER_BIT);
glUseProgramStages(ProgramPipeline, GL_COMPUTE_SHADER_BIT, ComputeShader);
glDispatchCompute(1, 1, 1);

The specification states that GL_INVALID_OPERATION is generated by glDispatchCompute when there is no valid compute program bound. The thing is that there is no error when i create my compute program.

Actually just swapping the first two calls "solves" the problem:

glUseProgramStages(ProgramPipeline, GL_COMPUTE_SHADER_BIT, ComputeShader);
glClear(GL_COLOR_BUFFER_BIT);
glDispatchCompute(1, 1, 1);

Now the error message is gone everything works as intended. Am I missing something? I really don't see why the first code would cause this error. There also shouldn't be any hidden state or something like that because I just load the shader, create the program and the pipeline, bind everything and that's it.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!