public DebugMessage[] GetDebugMessages() { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = ReplayRenderer_GetDebugMessages(m_Real, mem); DebugMessage[] ret = null; if (success) { ret = (DebugMessage[])CustomMarshal.GetTemplatedArray(mem, typeof(DebugMessage), true); } CustomMarshal.Free(mem); return(ret); }
public PixelModification[] PixelHistory(ResourceId target, UInt32 x, UInt32 y, UInt32 slice, UInt32 mip, UInt32 sampleIdx, FormatComponentType typeHint) { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = ReplayRenderer_PixelHistory(m_Real, target, x, y, slice, mip, sampleIdx, typeHint, mem); PixelModification[] ret = null; if (success) { ret = (PixelModification[])CustomMarshal.GetTemplatedArray(mem, typeof(PixelModification), true); } CustomMarshal.Free(mem); return(ret); }
public UInt32[] EnumerateCounters() { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = ReplayRenderer_EnumerateCounters(m_Real, mem); UInt32[] ret = null; if (success) { ret = (UInt32[])CustomMarshal.GetTemplatedArray(mem, typeof(UInt32), true); } CustomMarshal.Free(mem); return(ret); }
public FetchBuffer[] GetBuffers() { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = ReplayRenderer_GetBuffers(m_Real, mem); FetchBuffer[] ret = null; if (success) { ret = (FetchBuffer[])CustomMarshal.GetTemplatedArray(mem, typeof(FetchBuffer), true); } CustomMarshal.Free(mem); return(ret); }
public byte[] GetTextureData(ResourceId tex, UInt32 arrayIdx, UInt32 mip) { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = ReplayRenderer_GetTextureData(m_Real, tex, arrayIdx, mip, mem); byte[] ret = null; if (success) { ret = (byte[])CustomMarshal.GetTemplatedArray(mem, typeof(byte), true); } CustomMarshal.Free(mem); return(ret); }
public byte[] GetBufferData(ResourceId buff, UInt64 offset, UInt64 len) { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = ReplayRenderer_GetBufferData(m_Real, buff, offset, len, mem); byte[] ret = null; if (success) { ret = (byte[])CustomMarshal.GetTemplatedArray(mem, typeof(byte), true); } CustomMarshal.Free(mem); return(ret); }
public EventUsage[] GetUsage(ResourceId id) { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = ReplayRenderer_GetUsage(m_Real, id, mem); EventUsage[] ret = null; if (success) { ret = (EventUsage[])CustomMarshal.GetTemplatedArray(mem, typeof(EventUsage), true); } CustomMarshal.Free(mem); return(ret); }
public ShaderVariable[] GetCBufferVariableContents(ResourceId shader, UInt32 cbufslot, ResourceId buffer, UInt32 offs) { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = ReplayRenderer_GetCBufferVariableContents(m_Real, shader, cbufslot, buffer, offs, mem); ShaderVariable[] ret = null; if (success) { ret = (ShaderVariable[])CustomMarshal.GetTemplatedArray(mem, typeof(ShaderVariable), true); } CustomMarshal.Free(mem); return(ret); }
public PixelModification[] PixelHistory(ResourceId target, UInt32 x, UInt32 y) { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = ReplayRenderer_PixelHistory(m_Real, target, x, y, mem); PixelModification[] ret = null; if (success) { ret = (PixelModification[])CustomMarshal.GetTemplatedArray(mem, typeof(PixelModification), true); } CustomMarshal.Free(mem); return(ret); }
public bool GetHistogram(ResourceId tex, UInt32 sliceFace, UInt32 mip, UInt32 sample, float minval, float maxval, bool Red, bool Green, bool Blue, bool Alpha, out UInt32[] histogram) { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool[] channels = new bool[] { Red, Green, Blue, Alpha }; bool success = ReplayRenderer_GetHistogram(m_Real, tex, sliceFace, mip, sample, minval, maxval, channels, mem); histogram = null; if (success) { histogram = (UInt32[])CustomMarshal.GetTemplatedArray(mem, typeof(UInt32), true); } CustomMarshal.Free(mem); return(success); }
public Dictionary <uint, List <CounterResult> > FetchCounters(UInt32 frameID, UInt32 minEventID, UInt32 maxEventID, UInt32[] counters) { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); IntPtr countersmem = CustomMarshal.Alloc(typeof(UInt32), counters.Length); // there's no Marshal.Copy for uint[], which is stupid. for (int i = 0; i < counters.Length; i++) { Marshal.WriteInt32(countersmem, sizeof(UInt32) * i, (int)counters[i]); } bool success = ReplayRenderer_FetchCounters(m_Real, frameID, minEventID, maxEventID, countersmem, (uint)counters.Length, mem); CustomMarshal.Free(countersmem); Dictionary <uint, List <CounterResult> > ret = null; if (success) { CounterResult[] resultArray = (CounterResult[])CustomMarshal.GetTemplatedArray(mem, typeof(CounterResult), true); // fixup previous/next/parent pointers ret = new Dictionary <uint, List <CounterResult> >(); foreach (var result in resultArray) { if (!ret.ContainsKey(result.eventID)) { ret.Add(result.eventID, new List <CounterResult>()); } ret[result.eventID].Add(result); } } CustomMarshal.Free(mem); return(ret); }
public static byte[] GetThumbnail(string filename, FileType type, UInt32 maxsize) { UInt32 len = 0; IntPtr filename_mem = CustomMarshal.MakeUTF8String(filename); IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = RENDERDOC_GetThumbnail(filename_mem, type, maxsize, mem); if (!success || len == 0) { CustomMarshal.Free(filename_mem); return(null); } byte[] ret = (byte[])CustomMarshal.GetTemplatedArray(mem, typeof(byte), true); CustomMarshal.Free(mem); return(ret); }
public FetchDrawcall[] GetDrawcalls(UInt32 frameID, bool includeTimes) { IntPtr mem = CustomMarshal.Alloc(typeof(templated_array)); bool success = ReplayRenderer_GetDrawcalls(m_Real, frameID, includeTimes, mem); FetchDrawcall[] ret = null; if (success) { ret = (FetchDrawcall[])CustomMarshal.GetTemplatedArray(mem, typeof(FetchDrawcall), true); // fixup previous/next/parent pointers var map = new Dictionary <Int64, FetchDrawcall>(); PopulateDraws(ref map, ret); FixupDraws(map, ret); } CustomMarshal.Free(mem); return(ret); }