Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ void ExecuteWithRenderGraph( RenderRequest renderRequest,

if (m_CurrentDebugDisplaySettings.IsDebugMaterialDisplayEnabled() || m_CurrentDebugDisplaySettings.IsMaterialValidationEnabled() || CoreUtils.IsSceneLightingDisabled(hdCamera.camera))
{
using (new XRSinglePassScope(m_RenderGraph, hdCamera))
{
colorBuffer = RenderDebugViewMaterial(m_RenderGraph, cullingResults, hdCamera);
colorBuffer = ResolveMSAAColor(m_RenderGraph, hdCamera, colorBuffer);
}
// Stop Single Pass is after post process.
StartXRSinglePass(m_RenderGraph, hdCamera);

colorBuffer = RenderDebugViewMaterial(m_RenderGraph, cullingResults, hdCamera);
colorBuffer = ResolveMSAAColor(m_RenderGraph, hdCamera, colorBuffer);
}
else if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.RayTracing) &&
hdCamera.volumeStack.GetComponent<PathTracing>().enable.value)
Expand Down Expand Up @@ -270,11 +270,16 @@ void ExecuteWithRenderGraph( RenderRequest renderRequest,
shadowResult,
cullingResults);

BlitFinalCameraTexture(m_RenderGraph, hdCamera, postProcessDest, backBuffer, prepassOutput.resolvedMotionVectorsBuffer, prepassOutput.resolvedNormalBuffer);
StopXRSinglePass(m_RenderGraph, hdCamera);

if (target.targetDepth != null)
for (int viewIndex = 0; viewIndex < hdCamera.viewCount; ++viewIndex)
{
BlitFinalCameraTexture(m_RenderGraph, hdCamera, prepassOutput.resolvedDepthBuffer, m_RenderGraph.ImportTexture(target.targetDepth), prepassOutput.resolvedMotionVectorsBuffer, prepassOutput.resolvedNormalBuffer);
BlitFinalCameraTexture(m_RenderGraph, hdCamera, postProcessDest, backBuffer, prepassOutput.resolvedMotionVectorsBuffer, prepassOutput.resolvedNormalBuffer, viewIndex);

if (target.targetDepth != null)
{
BlitFinalCameraTexture(m_RenderGraph, hdCamera, prepassOutput.resolvedDepthBuffer, m_RenderGraph.ImportTexture(target.targetDepth), prepassOutput.resolvedMotionVectorsBuffer, prepassOutput.resolvedNormalBuffer, viewIndex);
}
}

aovRequest.PushCameraTexture(m_RenderGraph, AOVBuffers.Output, hdCamera, postProcessDest, aovBuffers);
Expand Down Expand Up @@ -316,11 +321,11 @@ class FinalBlitPassData
public TextureHandle destination;
}

void BlitFinalCameraTexture(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle source, TextureHandle destination, TextureHandle motionVectors, TextureHandle normalBuffer)
void BlitFinalCameraTexture(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle source, TextureHandle destination, TextureHandle motionVectors, TextureHandle normalBuffer, int viewIndex)
{
using (var builder = renderGraph.AddRenderPass<FinalBlitPassData>("Final Blit (Dev Build Only)", out var passData))
{
passData.parameters = PrepareFinalBlitParameters(hdCamera, 0); // todo viewIndex
passData.parameters = PrepareFinalBlitParameters(hdCamera, viewIndex); // todo viewIndex
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the comment on this line now :)

passData.source = builder.ReadTexture(source);
passData.destination = builder.WriteTexture(destination);

Expand Down