URP throws errors on Android / Vulkan: RenderTexture.Create failed: format unsupported for random wr

I get millions of these errors :

07-31 21:59:00.553 4122 4249 E Unity : RenderTexture.Create failed: format unsupported for random writes - RG8 UNorm (6).
07-31 21:59:00.553 4122 4249 E Unity : UnityEngine.Rendering.ScriptableRenderContext:InitializeSortSettings(Camera, SortingSettings&)
07-31 21:59:00.553 4122 4249 E Unity : UnityEngine.Rendering.ScriptableRenderContext:InvokeOnRenderObjectCallback_Internal_Injected(ScriptableRenderContext&)
07-31 21:59:00.553 4122 4249 E Unity : UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera(ScriptableRenderContext, CameraData, Boolean, Boolean)
07-31 21:59:00.553 4122 4249 E Unity : UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderCameraStack(ScriptableRenderContext, Camera)
07-31 21:59:00.553 4122 4249 E Unity : UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render(ScriptableRenderContext, Camera[ ])
07-31 21:59:00.553 4122 4249 E Unity : UnityEngine.Rendering.RenderPipeline:InternalRender(ScriptableRenderContext, Camera[ ])
07-31 21:59:00.553 4122 4249 E Unity : UnityEngine.Rendering.RenderPipelineManager:smile:oRenderLoop_Internal(RenderPipelineAsset, IntPtr)
07-31 21:59:00.553 4122 4249 E Unity :
07-31 21:59:00.553 4122 4249 E Unity : [./Runtime/Graphics/RenderTexture.cpp line 444]
07-31 21:59:00.553 4122 4249 E Unity : (Filename: ./Runtime/Graphics/RenderTexture.cpp Line: 444)


and none of these other textures can be created as well
RG16 SFloat (46).
R8 UNorm (5).
RG8 UNorm (6).

I am using the crest ocean renderer and the developers have no idea, why this is not working.
Crest is using compute shaders. But that error comes from SRP. I did not write the code - I bought the asset.
I am ready to ship and now the whole thing is not working!

Afaik URP does not use any RenderTexture with enableRandomWrite internally, so this is probably from Crest Ocean Renderer.

The formats listed are typically not supported for random-write in OpenGL ES and Vulkan by mobile GPU drivers.

You can try to check format support for random-write using SystemInfo.IsFormatSupported and then fall back to a different format such as R16G16B16A16_SFloat and/or R8G8B8A8_UNorm

that´s what I told them (crest) - it´s working when I turn of crest. I will give it a last try as you suggest.

the weird thing is, that I cannot find any code that is creating these textures.
where do I find
UnityEngine.Rendering.ScriptableRenderContext:InitializeSortSettings
?
this is the method, where the texture is created. So that looks like unity code, right?

I cannot find R16G16B16A16_SFloat or R8G8B8A8_UNorm. Can you give me a complete list for android that supports random writes, PLEASE!

so, it seems Rfloat RGFloat instead of *half seems to work. But doesn´t that use more gpu cycles or is this nothing to worry about?

solution is to use SystemInfo.GetCompatibleFormat. this spits out a format for the platform.

1 Like