jit.change in opengl? (only pass unique textures)
I think the answer is no, but I have a patch where it's beneficial to pass only unique texture frames in an opengl pipeline. I can do frame-subtraction on the GPU to show the inter-frame changes, but I have no way to use that data to either pass each frame or discard it. Any ideas?
I realize that shaders can't do overall analysis (as seen here https://cycling74.com/forums/shaders-for-analysis) but I wonder if there's a workaround since in this case any non-zero pixel in the difference image should cause the current texture not to pass. (We don't need jit.3m style knowledge of the whole frame.)
PS - If you're wondering why I need this, it's for de-duplicating frames from a camera that are being captured over HDMI. The camera can be set to 24p or 30p, but it pads the HDMI out with duplicate frames to match the 60Hz standard. (So jit.grab @unique 1 won't help) These duplicate frames are bogging down my downstream processing so I'm trying to recover the "native" rate of the camera instead. I can use a counter to throw out every other frame, but that doesn't cover 24p mode.
It's not an ideal solution, but I think it would help in your case...
The idea is to pass a downsampled version of each texture back to the CPU, analyze it with jit.change and let the texture output if it's different.
I don't know if it can help in your case (it may create frame sync issues), but you can disable the @automatic attribute of jit.grab and update it at the desired pace.