Skip to content

Commit

Permalink
Fix colorAttachment cleaning in the GpuInterop Vulkan demo (AvaloniaU…
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirDrobyshev authored Dec 12, 2023
1 parent 1a2e586 commit d44bd39
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions samples/GpuInterop/VulkanDemo/VulkanContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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
};

Expand Down

0 comments on commit d44bd39

Please sign in to comment.