Esempio n. 1
0
        public void BindMemory(VkDeviceMemory memory, UInt64 offset)
        {
            VkResult result = _Parent.vkBindImageMemory(_Parent._Handle, _Handle, memory._Handle, offset);

            if (result != VkResult.VK_SUCCESS)
            {
                throw new Exception(result.ToString());
            }
        }
Esempio n. 2
0
        public void BindMemory(VkDeviceMemory memory, UInt64 offset)
        {
            bool validMemory = false;

            for (int n = 0; n < MemoryRequirements.memoryTypes.Length; n++)
            {
                if (MemoryRequirements.memoryTypes[n].index == memory.MemoryType.index)
                {
                    validMemory = true; break;
                }
            }
            if (!validMemory)
            {
                throw new Exception("The memory block provided for the binding doesn't match the memory requirement");
            }
            VkResult result = _Parent.vkBindBufferMemory(_Parent._Handle, _Handle, memory._Handle, offset);

            if (result != VkResult.VK_SUCCESS)
            {
                throw new Exception(result.ToString());
            }
        }