Skip to content

Commit 3f28d55

Browse files
Fix rendergraph on consoles when motion vectors are enabled (#2076)
* Fix * reput the branch * changelog * Revert history change
1 parent f588667 commit 3f28d55

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
117117
- Fixed issue with box light not visible if range is below one and range attenuation is off.
118118
- Fixed alpha not having TAA applied to it.
119119
- Fixed issue with bloom showing a thin black line after rescaling window.
120+
- Fixed rendergraph motion vector resolve.
120121

121122
### Changed
122123
- Preparation pass for RTSSShadows to be supported by render graph.

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,8 @@ void ResolvePrepassBuffers(RenderGraph renderGraph, HDCamera hdCamera, ref Prepa
610610
passData.normalBuffer = builder.UseColorBuffer(CreateNormalBuffer(renderGraph, false), 1);
611611
if (passData.needMotionVectors)
612612
passData.motionVectorsBuffer = builder.UseColorBuffer(CreateMotionVectorBuffer(renderGraph, false, false), 2);
613+
else
614+
passData.motionVectorsBuffer = TextureHandle.nullHandle;
613615

614616
passData.normalBufferMSAA = builder.ReadTexture(output.normalBuffer);
615617
passData.depthAsColorBufferMSAA = builder.ReadTexture(output.depthAsColor);
@@ -626,8 +628,12 @@ void ResolvePrepassBuffers(RenderGraph renderGraph, HDCamera hdCamera, ref Prepa
626628
{
627629
data.depthResolveMaterial.SetTexture(HDShaderIDs._NormalTextureMS, data.normalBufferMSAA);
628630
data.depthResolveMaterial.SetTexture(HDShaderIDs._DepthTextureMS, data.depthAsColorBufferMSAA);
629-
if (data.needMotionVectors)
631+
if (passData.needMotionVectors)
632+
{
630633
data.depthResolveMaterial.SetTexture(HDShaderIDs._MotionVectorTextureMS, data.motionVectorBufferMSAA);
634+
}
635+
636+
CoreUtils.SetKeyword(context.cmd, "_HAS_MOTION_VECTORS", data.needMotionVectors);
631637

632638
context.cmd.DrawProcedural(Matrix4x4.identity, data.depthResolveMaterial, data.depthResolvePassIndex, MeshTopology.Triangles, 3, 1);
633639
});

0 commit comments

Comments
 (0)