In my tool, I generate many RenderTextures.
I facing a probrem at runtime program built by Unity 2019.1.5f1.
Some of textures seems to be not usable. I did a lot of researches, I found Texture.GetNativeTexturePtr() returns 0 about unusable texture when only runtime.
I check with following
var texture = new RenderTexture(width, height, depth, format);
texture.enableRandomWrite = true;
// log to external file
AddLog($"New RenderTexture Create ({texture.GetNativeTexturePtr()});");
AddLog($"Is Created: {texture.Create()}");
AddLog($"New RenderTexture Created ({texture.GetNativeTexturePtr()});");
The some result is seems good like that:
New RenderTexture Create (0);
Is Created: True
New RenderTexture Created (2679896030752);
But some result remains 0:
New RenderTexture Create (0);
Is Created: True
New RenderTexture Created (0);
This problem is not occurred in unity editor. By runtime, some environments occur and some do not. Each machines are windows10.
Please help me if you know anything about it.