mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
SOURCE DUMP v1
This commit is contained in:
parent
bd62d51ec9
commit
fb20299e9d
1 changed files with 768360 additions and 0 deletions
44
brutal.vulkan/Brutal.Vulkan.Abstractions/ImageViewEx.cs
Normal file
44
brutal.vulkan/Brutal.Vulkan.Abstractions/ImageViewEx.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
namespace Brutal.VulkanApi.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper struct for a Vulkan image view
|
||||
/// </summary>
|
||||
public readonly struct ImageViewEx(
|
||||
Device device,
|
||||
ImageEx image,
|
||||
VkImageView imageView,
|
||||
VkImageViewType imageViewType,
|
||||
VkImageSubresourceRange subresourceRange,
|
||||
VkAllocator? allocator
|
||||
) : IDisposable, INullable
|
||||
{
|
||||
public readonly ImageEx Image = image;
|
||||
public readonly VkImageView VkImageView = imageView;
|
||||
public readonly VkImageViewType Type = imageViewType;
|
||||
public readonly VkImageSubresourceRange SubresourceRange = subresourceRange;
|
||||
|
||||
public bool IsNull() => VkImageView.IsNull();
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
device.DestroyImageView(VkImageView, allocator);
|
||||
}
|
||||
|
||||
public ImageViewPartitionInfo AsPartition()
|
||||
{
|
||||
if (IsNull())
|
||||
throw new NullReferenceException(nameof(VkImageView));
|
||||
|
||||
return new ImageViewPartitionInfo(
|
||||
this,
|
||||
Image.AllocationInfo.ArrayLayers,
|
||||
0,
|
||||
Image.Extent,
|
||||
new VkOffset3D(),
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public static implicit operator ImageViewPartitionInfo(ImageViewEx inValue) => inValue.AsPartition();
|
||||
}
|
||||
Loading…
Reference in a new issue