Пример #1
0
        public uint GetCode(out IntPtr nativeBuf)
        {
            uint size = (uint)ShadercNative.shaderc_result_get_length(_handle);

            nativeBuf = ShadercNative.shaderc_result_get_bytes(_handle);
            return(size);
        }
Пример #2
0
        /// <summary>
        /// Get the produced SpirV bytecode
        /// </summary>
        /// <returns></returns>
        public byte[] GetBytes()
        {
            int    size      = (int)ShadercNative.shaderc_result_get_length(_handle);
            IntPtr nativeBuf = ShadercNative.shaderc_result_get_bytes(_handle);

            byte[] result = new byte[size];
            Marshal.Copy(nativeBuf, result, 0, size);

            return(result);
        }