You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generalizing #1165, it seems there are several items of OpenGL state that end up changed after halide_opengl_run() finishes, which leads to surprisingly wrong--and hard to debug--results when a halide filter is used as part of an existing OpenGL app.
Here are ones @shoaibkamil and I have come across (there may be others, but I haven't trolled through the source to find out):
Generalizing #1165, it seems there are several items of OpenGL state that end up changed after
halide_opengl_run()
finishes, which leads to surprisingly wrong--and hard to debug--results when a halide filter is used as part of an existing OpenGL app.Here are ones @shoaibkamil and I have come across (there may be others, but I haven't trolled through the source to find out):
glUseProgram()
as per OpenGL backend should call glUseProgram(0) #1165glViewport()
GL_CULL_FACE
stateGL_DEPTH_TEST
stateSo my current code wraps the halide filter with:
Of course it might be that there's a good reason not to restore some part of the state; in which case though WBN to document that clearly.
The text was updated successfully, but these errors were encountered: