示例#1
0
 public static string GetStringFromBlob(D3DCompiler.IDxcBlob blob)
 {
     unsafe
     {
         return(Marshal.PtrToStringAnsi((IntPtr)blob.GetBufferPointer()));
     }
 }
示例#2
0
        public static byte[] GetBytesFromBlob(D3DCompiler.IDxcBlob blob)
        {
            unsafe
            {
                byte * pMem   = (byte *)blob.GetBufferPointer();
                uint   size   = blob.GetBufferSize();
                byte[] result = new byte[size];
                fixed(byte *pTarget = result)
                {
                    for (uint i = 0; i < size; ++i)
                    {
                        pTarget[i] = pMem[i];
                    }
                }

                return(result);
            }
        }