浏览代码

HDRenderPipeline: Move htile for material classification before async compute.

/main
sebastienlagarde 7 年前
当前提交
8c774475
共有 1 个文件被更改,包括 16 次插入14 次删除
  1. 30
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs

30
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


RenderSSAO(cmd, hdCamera, renderContext, postProcessLayer);
}
// Clear and copy the stencil texture needs to be moved to before we invoke the async light list build,
// otherwise the async compute queue can end up using that texture before the graphics queue is done with it.
// TODO: Move this code inside LightLoop
if (m_LightLoop.GetFeatureVariantsEnabled())
{
// For material classification we use compute shader and so can't read into the stencil, so prepare it.
using (new ProfilingSample(cmd, "Clear and copy stencil texture", CustomSamplerId.ClearAndCopyStencilTexture.GetSampler()))
{
HDUtils.SetRenderTarget(cmd, hdCamera, m_CameraStencilBufferCopy, ClearFlag.Color, CoreUtils.clearColorAllBlack);
// In the material classification shader we will simply test is we are no lighting
// Use ShaderPassID 1 => "Pass 1 - Write 1 if value different from stencilRef to output"
HDUtils.DrawFullScreen(cmd, hdCamera, m_CopyStencilForNoLighting, m_CameraStencilBufferCopy, m_CameraDepthStencilBuffer, null, 1);
}
}
GPUFence buildGPULightListsCompleteFence = new GPUFence();
if (m_FrameSettings.enableAsyncCompute)
{

m_LightLoop.RenderDeferredDirectionalShadow(hdCamera, m_DeferredShadowBuffer, GetDepthTexture(), cmd);
PushFullScreenDebugTexture(cmd, m_DeferredShadowBuffer, hdCamera, FullScreenDebugMode.DeferredShadows);
}
// TODO: Move this code inside LightLoop
if (m_LightLoop.GetFeatureVariantsEnabled())
{
// For material classification we use compute shader and so can't read into the stencil, so prepare it.
using (new ProfilingSample(cmd, "Clear and copy stencil texture", CustomSamplerId.ClearAndCopyStencilTexture.GetSampler()))
{
HDUtils.SetRenderTarget(cmd, hdCamera, m_CameraStencilBufferCopy, ClearFlag.Color, CoreUtils.clearColorAllBlack);
// In the material classification shader we will simply test is we are no lighting
// Use ShaderPassID 1 => "Pass 1 - Write 1 if value different from stencilRef to output"
HDUtils.DrawFullScreen(cmd, hdCamera, m_CopyStencilForNoLighting, m_CameraStencilBufferCopy, m_CameraDepthStencilBuffer, null, 1);
}
}
if (m_FrameSettings.enableAsyncCompute)

正在加载...
取消
保存