Search Issue Tracker
By Design
Votes
12
Found in
2018.4
2020.2
2020.2.0b2
Issue ID
1277169
Regression
No
Render Texture will not be rendered in Build if the Graphics.Blit method is called on a Addressables Asset
How to reproduce:
1. Open the user's attached "RenderTextureAddressableIssue.zip"
2. Open the "SampleScene" Scene
3. Select the "Spawn" GameObject in the Hierarchy window
4. Enable the "Blit Test (Script)" Component in the Inspector
5. Open the "Canvas" Prefab in Prefab Mode (Assets/Prefab)
6. Select the "RawImage" GameObject in the Hierarchy
7. Disable the "Blit Test (Script)" Component in the Inspector
8. Go to File -> Build And Run
9. Observe the application
Expected result: Render Texture is rendered in the Build
Actual result: No Render Texture is rendered in the Build
Reproducible with: 2018.4.27f1, 2019.4.11f1, 2020.1.6f1, 2020.2.0b3
Notes:
- The issue is reproducible on both Windows and Mac Builds
- The issue is not reproducible in the Unity Editor
- The issue is not reproducible if the script with Graphics.Blit method is a part of the Addressables Asset
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Memory leak when a lot of UI elements are spawned and despawned
- Warnings are not logged in the Console window when using external code analyzers
- Errors “TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations, size 288“ appear constantly when Prefab is open
- Crash on PPtr<Shader>::operator or NullException errors spammed in console when calling Dispose() on null GraphicsBuffer with baked Reflection Probes
- “EndRenderPass: Not inside a Renderpass” and other Render Graph errors in the Player when Render Graph is enabled and Overlay UI is used
Resolution Note:
The script in the Hierarchy is running Blit on a copy of the Assets that live in player data, however, the Canvas that is being loaded into memory and instantiated comes from Addressables with its own copy of Render Texture and Source Texture. Marking both the Render Texture and the Source Texture as Addressables and using the AssetReference type in the script fixes the issue