Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vulkan] Updated Vortice.Vulkan package to the latest version #2497

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions sources/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="8.0.0" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="Vortice.Vulkan" Version="1.2.167" />
<PackageVersion Include="Vortice.Vulkan" Version="1.9.8" />
</ItemGroup>
<!-- Other dependencies -->
<ItemGroup>
Expand Down Expand Up @@ -138,4 +138,4 @@
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" PrivateAssets="all" />
</ItemGroup>
</Project>
</Project>
28 changes: 14 additions & 14 deletions sources/engine/Stride.Graphics/Vulkan/CommandList.Vulkan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private unsafe void SetViewportImpl()
var viewportCopy = Viewport;
if (viewportDirty)
{
vkCmdSetViewport(currentCommandList.NativeCommandBuffer, firstViewport: 0, viewportCount: 1, (Vortice.Mathematics.Viewport*) &viewportCopy);
vkCmdSetViewport(currentCommandList.NativeCommandBuffer, firstViewport: 0, viewportCount: 1, (VkViewport*) &viewportCopy);
viewportDirty = false;
}

Expand All @@ -211,15 +211,15 @@ private unsafe void SetViewportImpl()
{
// Use manual scissor
var scissor = scissors[0];
var nativeScissor = new Vortice.Mathematics.Rectangle(scissor.Left, scissor.Top, scissor.Width, scissor.Height);
var nativeScissor = new VkRect2D(scissor.Left, scissor.Top, (uint)scissor.Width, (uint)scissor.Height);
vkCmdSetScissor(currentCommandList.NativeCommandBuffer, firstScissor: 0, scissorCount: 1, &nativeScissor);
}
}
else
{
// Use viewport
// Always update, because either scissor or viewport was dirty and we use viewport size
var scissor = new Vortice.Mathematics.Rectangle((int) viewportCopy.X, (int) viewportCopy.Y, (int) viewportCopy.Width, (int) viewportCopy.Height);
var scissor = new VkRect2D((int) viewportCopy.X, (int) viewportCopy.Y, (uint) viewportCopy.Width, (uint) viewportCopy.Height);
vkCmdSetScissor(currentCommandList.NativeCommandBuffer, firstScissor: 0, scissorCount: 1, &scissor);
}

Expand Down Expand Up @@ -889,7 +889,7 @@ public unsafe void Copy(GraphicsResource source, GraphicsResource destination)
var copy = new VkBufferImageCopy
{
imageSubresource = new VkImageSubresourceLayers(sourceParent.NativeImageAspect, (uint) mipLevel, (uint) arraySlice, layerCount: 1),
imageExtent = new Vortice.Mathematics.Size3(width, height, depth),
imageExtent = new VkExtent3D(width, height, depth),
bufferOffset = (ulong) destinationOffset
};
vkCmdCopyImageToBuffer(currentCommandList.NativeCommandBuffer, sourceParent.NativeImage, VkImageLayout.TransferSrcOptimal, destinationParent.NativeBuffer, regionCount: 1, &copy);
Expand All @@ -909,7 +909,7 @@ public unsafe void Copy(GraphicsResource source, GraphicsResource destination)
var copy = new VkBufferImageCopy
{
imageSubresource = destinationSubresource,
imageExtent = new Vortice.Mathematics.Size3(width, height, depth),
imageExtent = new VkExtent3D(width, height, depth),
bufferOffset = (ulong) sourceOffset
};
vkCmdCopyBufferToImage(currentCommandList.NativeCommandBuffer, sourceParent.NativeBuffer, destinationParent.NativeImage, VkImageLayout.TransferDstOptimal, regionCount: 1, &copy);
Expand All @@ -920,7 +920,7 @@ public unsafe void Copy(GraphicsResource source, GraphicsResource destination)
{
srcSubresource = new VkImageSubresourceLayers(sourceParent.NativeImageAspect, (uint) mipLevel, (uint) arraySlice, (uint) sourceTexture.ArraySize),
dstSubresource = destinationSubresource,
extent = new Vortice.Mathematics.Size3(width, height, depth)
extent = new VkExtent3D(width, height, depth)
};
vkCmdCopyImage(currentCommandList.NativeCommandBuffer, sourceParent.NativeImage, VkImageLayout.TransferSrcOptimal, destinationParent.NativeImage, VkImageLayout.TransferDstOptimal, regionCount: 1, &copy);
}
Expand Down Expand Up @@ -1080,8 +1080,8 @@ public unsafe void CopyRegion(GraphicsResource source, int sourceSubresource, Re
bufferOffset = (ulong) sourceTexture.ComputeBufferOffset(sourceSubresource, 0),
bufferImageHeight = (uint) sourceTexture.Height,
bufferRowLength = (uint) sourceTexture.Width,
imageOffset = new Vortice.Mathematics.Point3(dstX, dstY, dstZ),
imageExtent = new Vortice.Mathematics.Size3(region.Right - region.Left, region.Bottom - region.Top, region.Back - region.Front)
imageOffset = new VkOffset3D(dstX, dstY, dstZ),
imageExtent = new VkExtent3D(region.Right - region.Left, region.Bottom - region.Top, region.Back - region.Front)
};
vkCmdCopyBufferToImage(currentCommandList.NativeCommandBuffer, sourceParent.NativeBuffer, destinationParent.NativeImage, VkImageLayout.TransferDstOptimal, regionCount: 1, &copy);
}
Expand All @@ -1090,10 +1090,10 @@ public unsafe void CopyRegion(GraphicsResource source, int sourceSubresource, Re
var copy = new VkImageCopy
{
srcSubresource = new VkImageSubresourceLayers(sourceParent.NativeImageAspect, (uint) sourceTexture.MipLevel, (uint) sourceTexture.ArraySlice, (uint) sourceTexture.ArraySize),
srcOffset = new Vortice.Mathematics.Point3(region.Left, region.Top, region.Front),
srcOffset = new VkOffset3D(region.Left, region.Top, region.Front),
dstSubresource = destinationSubresource,
dstOffset = new Vortice.Mathematics.Point3(dstX, dstY, dstZ),
extent = new Vortice.Mathematics.Size3(region.Right - region.Left, region.Bottom - region.Top, region.Back - region.Front)
dstOffset = new VkOffset3D(dstX, dstY, dstZ),
extent = new VkExtent3D(region.Right - region.Left, region.Bottom - region.Top, region.Back - region.Front)
};
vkCmdCopyImage(currentCommandList.NativeCommandBuffer, sourceParent.NativeImage, VkImageLayout.TransferSrcOptimal, destinationParent.NativeImage, VkImageLayout.TransferDstOptimal, regionCount: 1, &copy);
}
Expand Down Expand Up @@ -1219,8 +1219,8 @@ internal unsafe void UpdateSubresource(GraphicsResource resource, int subResourc
imageSubresource = new VkImageSubresourceLayers { aspectMask = VkImageAspectFlags.Color, baseArrayLayer = (uint) arraySlice, layerCount = 1, mipLevel = (uint) mipSlice },
bufferRowLength = (uint) (databox.RowPitch * texture.Format.BlockWidth() / texture.Format.BlockSize()),
bufferImageHeight = (uint) (databox.SlicePitch * texture.Format.BlockHeight() / databox.RowPitch),
imageOffset = new Vortice.Mathematics.Point3(region.Left, region.Top, region.Front),
imageExtent = new Vortice.Mathematics.Size3(region.Right - region.Left, region.Bottom - region.Top, region.Back - region.Front)
imageOffset = new VkOffset3D(region.Left, region.Top, region.Front),
imageExtent = new VkExtent3D(region.Right - region.Left, region.Bottom - region.Top, region.Back - region.Front)
};
vkCmdCopyBufferToImage(currentCommandList.NativeCommandBuffer, uploadResource, texture.NativeImage, VkImageLayout.TransferDstOptimal, 1, &bufferCopy);

Expand Down Expand Up @@ -1435,7 +1435,7 @@ private unsafe void EnsureRenderPass()
sType = VkStructureType.RenderPassBeginInfo,
renderPass = pipelineRenderPass,
framebuffer = activeFramebuffer,
renderArea = new Vortice.Mathematics.Rectangle(0, 0, renderTarget.ViewWidth, renderTarget.ViewHeight)
renderArea = new VkRect2D(0, 0, (uint)renderTarget.ViewWidth, (uint)renderTarget.ViewHeight)
};
vkCmdBeginRenderPass(currentCommandList.NativeCommandBuffer, &renderPassBegin, VkSubpassContents.Inline);

Expand Down
Loading