Exemplo n.º 1
0
        public BufferView(Device device, BufferViewCreateInfo info)
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }
            if (info == null)
            {
                throw new ArgumentNullException(nameof(info));
            }

            Device = device;
        }
Exemplo n.º 2
0
        void CreateBufferView(BufferViewCreateInfo mInfo)
        {
            VkBufferViewCreateInfo info = new VkBufferViewCreateInfo();

            info.sType  = VkStructureType.BufferViewCreateInfo;
            info.buffer = mInfo.buffer.Native;
            info.format = mInfo.format;
            info.offset = mInfo.offset;
            info.range  = mInfo.range;

            var result = Device.Commands.createBufferView(Device.Native, ref info, Device.Instance.AllocationCallbacks, out bufferView);

            if (result != VkResult.Success)
            {
                throw new BufferViewException(string.Format("Error creating buffer view: {0}", result));
            }

            Offset = mInfo.offset;
            Range  = mInfo.range;
        }