Test FragmentShader.setImageSampler
memory leaks (Linux and Android simulator)
By running this app, memory leaks start to be noticed after 40~60 seconds on the Operating System Monitor. Memory tab of DevTools doesn't report leaks.
- This sample uses 2 shaders:
shader_a.frag
andshader_b.frag
. - The shaders are drawn using
PictureRecorder()
and the output is stored into 2 differentui.Image
s. - When pressing the button, the
Ticker
starts updating shader outputs. shader_a
uses the lastest output ofshader_b
as sampler2D uniform andshader_b
uses the latest output of itself.
The leak doesn't occurs when:
- Removing the sampler2D uniform from
shader_b.frag
(and of course thesetImageSampler
fromcomputeShader2()
) - in
computeShader2()
replacesetImageSampler(0, sampler1 ?? blankImage!);
withsetImageSampler(0, blankImage!);
whereblankImage
is the image loaded at start
Here a screenshot of the System Operating System memory monitor. After about 40 seconds memory leaks start growing till 100% is reached.