public uint GetCode(out IntPtr nativeBuf) { uint size = (uint)ShadercNative.shaderc_result_get_length(_handle); nativeBuf = ShadercNative.shaderc_result_get_bytes(_handle); return(size); }
/// <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); }