public VkSparseBufferMemoryBindInfo(VkBuffer buffer, Span <VkSparseMemoryBind> binds) { this.buffer = buffer; this.bindCount = (uint)binds.Length; fixed(VkSparseMemoryBind *pBinds = binds) this.pBinds = pBinds; }
public static Span <T> vkMapMemory <T>(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, ulong offset = 0, ulong size = WholeSize, VkMemoryMapFlags flags = VkMemoryMapFlags.None) where T : unmanaged { void *pData; vkMapMemory(device, memory, offset, size, flags, &pData).CheckResult(); if (size == WholeSize) { vkGetBufferMemoryRequirements(device, buffer, out var memoryRequirements); return(new Span <T>(pData, (int)memoryRequirements.size)); } return(new Span <T>(pData, (int)size)); }
public static void BindBufferMemory(VkBuffer buffer, VkDeviceMemory memory, ulong memoryOffset) { VulkanUtil.CheckResult(vkBindBufferMemory(device, buffer, memory, memoryOffset)); }
public static void GetBufferMemoryRequirements(VkBuffer buffer, out VkMemoryRequirements pMemoryRequirements) { vkGetBufferMemoryRequirements(device, buffer, out pMemoryRequirements); }
public static void vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint firstBinding, VkBuffer buffer, ulong offset = 0) { vkCmdBindVertexBuffers(commandBuffer, firstBinding, 1, &buffer, &offset); }