From 47b736374803c43f26e55ad4154fde1a331409c7 Mon Sep 17 00:00:00 2001 From: pastasfuture Date: Fri, 28 Aug 2020 02:04:27 -0700 Subject: [PATCH] Bugfix for HDRenderPipelineAsset getting set to null when running unity in batchmode, resulting in broken builds. --- .../Editor/Lighting/Reflection/HDCubemapInspector.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs index e65b65b5eb0..b64bd07e79e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDCubemapInspector.cs @@ -204,6 +204,13 @@ static void InitIcons() } public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height) { + // If we attempted to render hdr cubemap previews in batchmode, + // we will error out with Texture creation failed. 'R16G16B16A16_SFloat' is not supported for Render usage on this platform. + // This would then trigger us to eject out of this function, without restoring the render pipeline asset. + // This causes GraphicsSettings to lose the reference to the HDRenderPipelineAsset, which causes all sorts of graphics build issues. + if (Application.isBatchMode) + return null; + m_CameraDistance = 1.25f; m_CameraPhi = Mathf.PI * 0.33f; m_CameraTheta = Mathf.PI;