public static string GetStringFromBlob(D3DCompiler.IDxcBlob blob) { unsafe { return(Marshal.PtrToStringAnsi((IntPtr)blob.GetBufferPointer())); } }
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); } }