Search Issue Tracker
By Design
Votes
0
Found in [Package]
7.5.2
Issue ID
1285618
Regression
No
[XR SDK] [URP] Temporary render texture does not bind to shader when set as global texture when using Single Pass Instanced
Reproduction steps:
1. Open the attached project ("Single Pass Instanced Temporary RT binding.zip")
2. Open SampleScene scene
3. Make sure Oculus rendering mode is set to Single Pass Instanced
4. Open Frame Debug window
5. Enter Play mode
6. In Frame Debug window select ToGreen
7. In Frame Debug window right panel select ShaderProperties
Expected result: _CopySource texture is _CopySource
Actual result: _CopySource texture is UnityDefault2D
Reproducible with: URP 7.5.2, .8.2.0, 10.2.1 (2019.4.16f1, 2020.1.16f1, 2020.2.0b17, 2021.1.0a9)
Not reproducible with: 2018.4.30f1 (XR SDK not available)
Tested:
- Oculus Rift
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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
The reason for the binding issue is that the project was using shader graph and declared CopySource as Sample Texture2D. In XR single pass instanced, the screen space textures are Texture2DArray type with array size 2. This type mismatch causes the binding to fail and unity binds UnityDefault2D as the default texture.
Usually when writing XR shaders in unity, user should use XR macros Texture2D_X for screen space textures, the macro will handle the texture type based on the selected stereo mode(SPI, multiview or multipass). ShaderGraph however does not support this XR macro yet.