From d44bd39f07892aea4bb3a1b0c0aeb8fdd3a50f56 Mon Sep 17 00:00:00 2001 From: Vladimir Drobyshev <12460363+VladimirDrobyshev@users.noreply.github.com> Date: Wed, 13 Dec 2023 02:18:40 +0300 Subject: [PATCH] Fix colorAttachment cleaning in the GpuInterop Vulkan demo (#13923) --- samples/GpuInterop/VulkanDemo/VulkanContent.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/samples/GpuInterop/VulkanDemo/VulkanContent.cs b/samples/GpuInterop/VulkanDemo/VulkanContent.cs index a9a668d10bb..fe95db00f4a 100644 --- a/samples/GpuInterop/VulkanDemo/VulkanContent.cs +++ b/samples/GpuInterop/VulkanDemo/VulkanContent.cs @@ -182,10 +182,11 @@ public void Render(VulkanImage image, api.CmdSetScissor(commandBufferHandle, 0, 1, &scissor); - var clearColor = new ClearValue(new ClearColorValue(1, 0, 0, 0.1f), new ClearDepthStencilValue(1, 0)); - - var clearValues = new[] { clearColor, clearColor }; - + var clearValues = new ClearValue[] + { + new() { Color = new ClearColorValue { Float32_0 = 1, Float32_1 = 0, Float32_2 = 0, Float32_3 = 0.1f } }, + new() { DepthStencil = new ClearDepthStencilValue { Depth = 1, Stencil = 0 } } + }; fixed (ClearValue* clearValue = clearValues) { @@ -195,7 +196,7 @@ public void Render(VulkanImage image, RenderPass = _renderPass, Framebuffer = _framebuffer, RenderArea = new Rect2D(new Offset2D(0, 0), new Extent2D((uint?)image.Size.Width, (uint?)image.Size.Height)), - ClearValueCount = 2, + ClearValueCount = (uint)clearValues.Length, PClearValues = clearValue };