Пример #1
0
        public VkSparseBufferMemoryBindInfo(VkBuffer buffer, Span <VkSparseMemoryBind> binds)
        {
            this.buffer    = buffer;
            this.bindCount = (uint)binds.Length;

            fixed(VkSparseMemoryBind *pBinds = binds)
            this.pBinds = pBinds;
        }
Пример #2
0
        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));
        }
Пример #3
0
 public static void BindBufferMemory(VkBuffer buffer, VkDeviceMemory memory, ulong memoryOffset)
 {
     VulkanUtil.CheckResult(vkBindBufferMemory(device, buffer, memory, memoryOffset));
 }
Пример #4
0
 public static void GetBufferMemoryRequirements(VkBuffer buffer, out VkMemoryRequirements pMemoryRequirements)
 {
     vkGetBufferMemoryRequirements(device, buffer, out pMemoryRequirements);
 }
Пример #5
0
 public static void vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint firstBinding, VkBuffer buffer, ulong offset = 0)
 {
     vkCmdBindVertexBuffers(commandBuffer, firstBinding, 1, &buffer, &offset);
 }