diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs index 35eda53f4a8..d6a8e05d272 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs @@ -372,9 +372,10 @@ public void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, in } catch (Exception e) { - m_ExecutionExceptionWasRaised = true; Debug.LogError("Render Graph Execution error"); - Debug.LogException(e); + if (!m_ExecutionExceptionWasRaised) // Already logged. TODO: There is probably a better way in C# to handle that. + Debug.LogException(e); + m_ExecutionExceptionWasRaised = true; } finally { @@ -836,6 +837,7 @@ void ExecuteRenderGraph(ScriptableRenderContext renderContext, CommandBuffer cmd m_ExecutionExceptionWasRaised = true; Debug.LogError($"Render Graph Execution error at pass {passInfo.pass.name} ({passIndex})"); Debug.LogException(e); + throw; } } } diff --git a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs index 7de11bc5a74..1af426e2518 100644 --- a/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs +++ b/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs @@ -632,11 +632,10 @@ void SetGlobalTextures(RenderGraphContext rgContext, List texture var resourceDesc = GetTextureResource(resource); if (resourceDesc.shaderProperty != 0) { - if (resourceDesc.rt == null) + if (resourceDesc.rt != null) { - throw new InvalidOperationException(string.Format("Trying to set Global Texture parameter for \"{0}\" which was never created.\nCheck that at least one write operation happens before reading it.", resourceDesc.desc.name)); + rgContext.cmd.SetGlobalTexture(resourceDesc.shaderProperty, bindDummyTexture ? TextureXR.GetMagentaTexture() : resourceDesc.rt); } - rgContext.cmd.SetGlobalTexture(resourceDesc.shaderProperty, bindDummyTexture ? TextureXR.GetMagentaTexture() : resourceDesc.rt); } } } diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 5b62e75de5b..96657574758 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -668,6 +668,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix issue causing blocky artifacts when decals affect metallic and are applied on material with specular color workflow. - Fixed issue with depth pyramid generation and dynamic resolution. - Fixed an issue where decals were duplicated in prefab isolation mode. +- Fixed an issue where rendering preview with MSAA might generate render graph errors. ### Changed - Improve MIP selection for decals on Transparents