Skip to content

Commit 127fa66

Browse files
YohannVaastUnityEvergreen
authored andcommitted
Fix Wireframe not rendering when using Vulkan API.
Jira ticket: https://jira.unity3d.com/browse/UUM-36914 Initial context + initial fix + explanation: https://github.cds.internal.unity3d.com/unity/unity/pull/25910 More context for the Vulkan Terrain edge case: https://ono.unity3d.com/unity/unity/pull-request/111240/_/graphics/vulkan/case-1205332 Following this PR, the problem is also in latest Trunk for the non-RG path. We have to fix it too, which is the goal of this PR. I simply used the same strategy than the other PR.
1 parent 5b3a0ac commit 127fa66

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Packages/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,19 @@ internal static void FinalBlit(
252252
cmd.SetRenderTarget(BuiltinRenderTextureType.CameraTarget,
253253
loadAction, storeAction, // color
254254
RenderBufferLoadAction.DontCare, RenderBufferStoreAction.DontCare); // depth
255-
cmd.Blit(source.nameID, destination.nameID);
255+
256+
// Necessary to disable the wireframe here, since Vulkan is handling the wireframe differently
257+
// to handle the Terrain "Draw Instanced" scenario (Ono: case-1205332).
258+
if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Vulkan)
259+
{
260+
cmd.SetWireframe(false);
261+
cmd.Blit(source, destination);
262+
cmd.SetWireframe(true);
263+
}
264+
else
265+
{
266+
cmd.Blit(source, destination);
267+
}
256268
}
257269
else if (source.rt == null)
258270
Blitter.BlitTexture(cmd, source.nameID, scaleBias, material, passIndex); // Obsolete usage of RTHandle aliasing a RenderTargetIdentifier

0 commit comments

Comments
 (0)