浏览代码

For MSAA-enabled RTHandles, don't overwrite original enableRandomWrite

We need to retain the original value for enableRandomWrite instead of just overriding it if MSAA is enabled. 

Currently, we take different internal paths if MSAA is enabled. In the situations that MSAA is not enabled, but MSAA was originally requested, we want to make sure enableRandomWrite can be set on the non-MSAA RT. 

Before this change, if MSAA was supported via the RenderPipelineSettings, but not currently enabled by the FrameSettings, the non-MSAA RT was being created without enableRandomWrite, which lead to the RT not being compatible with the passes expecting a UAV.
/main
Robert Srinivasiah 7 年前
当前提交
695f1e55
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 8
      ScriptableRenderPipeline/Core/CoreRP/RTHandle.cs

8
ScriptableRenderPipeline/Core/CoreRP/RTHandle.cs


}
// MSAA Does not support random read/write.
if (allocForMSAA && enableRandomWrite == true)
bool UAV = enableRandomWrite;
if (allocForMSAA && (UAV == true))
Debug.LogWarning("RTHandle allocated with MSAA can't be enableRandomWrite.");
enableRandomWrite = false;
Debug.LogWarning("RTHandle that is MSAA-enabled cannot allocate MSAA RT with 'enableRandomWrite = true'.");
UAV = false;
bool UAV = enableRandomWrite;
RTCategory category = allocForMSAA ? RTCategory.MSAA : RTCategory.Regular;
var rt = new RenderTexture(width, height, (int)depthBufferBits, colorFormat, sRGB ? RenderTextureReadWrite.sRGB : RenderTextureReadWrite.Linear)

正在加载...
取消
保存