简体   繁体   中英

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM