Ejemplo n.º 1
0
        public VkShaderModule CreateShaderModule(byte[] code)
        {
            GCHandle handle = GCHandle.Alloc(code, GCHandleType.Pinned);

            var info = new VkShaderModuleCreateInfo();

            info.sType    = CSGL.Vulkan.VkStructureType.ShaderModuleCreateInfo;
            info.codeSize = (IntPtr)code.LongLength;
            info.pCode    = handle.AddrOfPinnedObject();

            VkShaderModule temp;

            var result = VK.CreateShaderModule(device, ref info, alloc, out temp);

            handle.Free();

            return(temp);
        }