Home > Net >  Is it possible to terminate (compute) shader execution in OpenGL?
Is it possible to terminate (compute) shader execution in OpenGL?

Time:11-29

I have a compute shader that computes the Mandelbrot set. For deeper zooms this can take minutes. Is it possible to terminate the compute shader (for example if I pan or change zoom while it computes)? I'm using C .

I guess I could let the shader do its computation in stages and check on the CPU-side if parameters have changed. But I think this would cost performance and would make the code a little messy...

Does anybody know a clean, fast and easy way to do this?

CodePudding user response:

There is no valid way to affect the execution of any OpenGL operation after it has already been told to execute. If you dispatch the work, you dispatched the work. You can't take it back later.

  • Related