@@ -92,6 +92,7 @@ public static TextureDimension dimension
9292 /// <returns>The default magenta texture.</returns>
9393 public static RTHandle GetMagentaTexture ( ) { return useTexArray ? m_MagentaTexture2DArrayRTH : m_MagentaTextureRTH ; }
9494
95+ static Texture2D m_BlackTexture ;
9596 static Texture3D m_BlackTexture3D ;
9697 static Texture2DArray m_BlackTexture2DArray ;
9798 static RTHandle m_BlackTexture2DArrayRTH ;
@@ -161,9 +162,12 @@ public static void Initialize(CommandBuffer cmd, ComputeShader clearR32_UIntShad
161162
162163 // Black
163164 RTHandles . Release ( m_BlackTextureRTH ) ;
164- m_BlackTextureRTH = RTHandles . Alloc ( Texture2D . blackTexture ) ;
165+ m_BlackTexture = new Texture2D ( 1 , 1 , GraphicsFormat . R8G8B8A8_SRGB , TextureCreationFlags . None ) { name = "Black Texture" } ;
166+ m_BlackTexture . SetPixel ( 0 , 0 , Color . black ) ;
167+ m_BlackTexture . Apply ( ) ;
168+ m_BlackTextureRTH = RTHandles . Alloc ( m_BlackTexture ) ;
165169 RTHandles . Release ( m_BlackTexture2DArrayRTH ) ;
166- m_BlackTexture2DArray = CreateTexture2DArrayFromTexture2D ( Texture2D . blackTexture , "Black Texture2DArray" ) ;
170+ m_BlackTexture2DArray = CreateTexture2DArrayFromTexture2D ( m_BlackTexture , "Black Texture2DArray" ) ;
167171 m_BlackTexture2DArrayRTH = RTHandles . Alloc ( m_BlackTexture2DArray ) ;
168172 RTHandles . Release ( m_BlackTexture3DRTH ) ;
169173 m_BlackTexture3D = CreateBlackTexture3D ( "Black Texture3D" ) ;
0 commit comments