From e0abfce358303bee5721cf45b357c13db9ac21d0 Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Tue, 9 Jun 2020 18:12:27 +0200 Subject: [PATCH 1/2] Fixed an issue where rendering preview with MSAA might generate render graph errors. --- .../Runtime/RenderGraph/RenderGraph.cs | 6 ++++-- .../Runtime/RenderGraph/RenderGraphResourceRegistry.cs | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) 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); } } } From 737f461be70542f69a0d913d03e1736693ae2dca Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Tue, 9 Jun 2020 18:12:58 +0200 Subject: [PATCH 2/2] Update changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 6228fc388ff..48f9476bdca 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -654,6 +654,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Workaround an issue caused by GetKernelThreadGroupSizes failing to retrieve correct group size. - Fix issue with fast memory and rendergraph. - Fixed transparent motion vector framesetting not sanitized. +- Fixed an issue where rendering preview with MSAA might generate render graph errors. ### Changed - Improve MIP selection for decals on Transparents