Exemple #1
0
        public FetchFrameInfo GetFrameInfo()
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(FetchFrameInfo));

            bool success = ReplayRenderer_GetFrameInfo(m_Real, mem);

            FetchFrameInfo ret = null;

            if (success)
            {
                ret = (FetchFrameInfo)CustomMarshal.PtrToStructure(mem, typeof(FetchFrameInfo), true);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #2
0
        public static RemoteServer CreateRemoteServer(string host, uint port)
        {
            IntPtr rendPtr = IntPtr.Zero;

            IntPtr host_mem = CustomMarshal.MakeUTF8String(host);

            ReplayCreateStatus ret = RENDERDOC_CreateRemoteServerConnection(host_mem, port, ref rendPtr);

            CustomMarshal.Free(host_mem);

            if (rendPtr == IntPtr.Zero || ret != ReplayCreateStatus.Success)
            {
                throw new ReplayCreateException(ret, "Failed to connect to remote replay host");
            }

            return(new RemoteServer(rendPtr));
        }
        public CounterDescription DescribeCounter(UInt32 counterID)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(CounterDescription));

            bool success = ReplayRenderer_DescribeCounter(m_Real, counterID, mem);

            CounterDescription ret = null;

            if (success)
            {
                ret = (CounterDescription)CustomMarshal.PtrToStructure(mem, typeof(CounterDescription), false);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #4
0
        public static ReplayRenderer CreateReplayRenderer(string logfile, ref float progress)
        {
            IntPtr rendPtr = IntPtr.Zero;

            IntPtr logfile_mem = CustomMarshal.MakeUTF8String(logfile);

            ReplayCreateStatus ret = RENDERDOC_CreateReplayRenderer(logfile_mem, ref progress, ref rendPtr);

            CustomMarshal.Free(logfile_mem);

            if (rendPtr == IntPtr.Zero || ret != ReplayCreateStatus.Success)
            {
                throw new ReplayCreateException(ret, "Failed to load log for local replay");
            }

            return(new ReplayRenderer(rendPtr));
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        public byte[] GetBufferData(ResourceId buff, UInt32 offset, UInt32 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);
        }
Exemple #7
0
        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);
        }
Exemple #8
0
        public ShaderDebugTrace DebugThread(UInt32[] groupid, UInt32[] threadid)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(ShaderDebugTrace));

            bool success = ReplayRenderer_DebugThread(m_Real, groupid, threadid, mem);

            ShaderDebugTrace ret = null;

            if (success)
            {
                ret = (ShaderDebugTrace)CustomMarshal.PtrToStructure(mem, typeof(ShaderDebugTrace), true);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #9
0
        public PostVSMeshData GetPostVSData(MeshDataStage stage)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(PostVSMeshData));

            PostVSMeshData ret = null;

            bool success = ReplayRenderer_GetPostVSData(m_Real, stage, mem);

            if (success)
            {
                ret = (PostVSMeshData)CustomMarshal.PtrToStructure(mem, typeof(PostVSMeshData), true);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #10
0
        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);
        }
Exemple #11
0
        public PixelValue PickPixel(ResourceId texID, bool customShader, UInt32 x, UInt32 y, UInt32 sliceFace, UInt32 mip, UInt32 sample)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(PixelValue));

            bool success = ReplayOutput_PickPixel(m_Real, texID, customShader, x, y, sliceFace, mip, sample, mem);

            PixelValue ret = null;

            if (success)
            {
                ret = (PixelValue)CustomMarshal.PtrToStructure(mem, typeof(PixelValue), false);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #12
0
        public ShaderDebugTrace DebugPixel(UInt32 x, UInt32 y, UInt32 sample, UInt32 primitive)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(ShaderDebugTrace));

            bool success = ReplayRenderer_DebugPixel(m_Real, x, y, sample, primitive, mem);

            ShaderDebugTrace ret = null;

            if (success)
            {
                ret = (ShaderDebugTrace)CustomMarshal.PtrToStructure(mem, typeof(ShaderDebugTrace), true);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #13
0
        public ShaderDebugTrace DebugVertex(UInt32 vertid, UInt32 instid, UInt32 idx, UInt32 instOffset, UInt32 vertOffset)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(ShaderDebugTrace));

            bool success = ReplayRenderer_DebugVertex(m_Real, vertid, instid, idx, instOffset, vertOffset, mem);

            ShaderDebugTrace ret = null;

            if (success)
            {
                ret = (ShaderDebugTrace)CustomMarshal.PtrToStructure(mem, typeof(ShaderDebugTrace), true);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #14
0
        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);
        }
Exemple #15
0
        public ShaderDebugTrace PSGetDebugStates(UInt32 x, UInt32 y)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(ShaderDebugTrace));

            bool success = ReplayRenderer_PSGetDebugStates(m_Real, x, y, mem);

            ShaderDebugTrace ret = null;

            if (success)
            {
                ret = (ShaderDebugTrace)CustomMarshal.PtrToStructure(mem, typeof(ShaderDebugTrace), true);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #16
0
        public PixelModification[] PixelHistory(ResourceId target, UInt32 x, UInt32 y, UInt32 slice, UInt32 mip, UInt32 sampleIdx)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));

            bool success = ReplayRenderer_PixelHistory(m_Real, target, x, y, slice, mip, sampleIdx, mem);

            PixelModification[] ret = null;

            if (success)
            {
                ret = (PixelModification[])CustomMarshal.GetTemplatedArray(mem, typeof(PixelModification), true);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #17
0
        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);
        }
Exemple #18
0
        public static TargetControl CreateTargetControl(string host, UInt32 ident, string clientName, bool forceConnection)
        {
            IntPtr host_mem       = CustomMarshal.MakeUTF8String(host);
            IntPtr clientName_mem = CustomMarshal.MakeUTF8String(clientName);

            IntPtr rendPtr = RENDERDOC_CreateTargetControl(host_mem, ident, clientName_mem, forceConnection);

            CustomMarshal.Free(host_mem);
            CustomMarshal.Free(clientName_mem);

            if (rendPtr == IntPtr.Zero)
            {
                throw new ReplayCreateException(ReplayCreateStatus.NetworkIOFailed, "Failed to open remote access connection");
            }

            return(new TargetControl(rendPtr));
        }
Exemple #19
0
        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);
        }
Exemple #20
0
        public VulkanPipelineState GetVulkanPipelineState()
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(VulkanPipelineState));

            bool success = ReplayRenderer_GetVulkanPipelineState(m_Real, mem);

            VulkanPipelineState ret = null;

            if (success)
            {
                ret = (VulkanPipelineState)CustomMarshal.PtrToStructure(mem, typeof(VulkanPipelineState), true);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #21
0
        public static RemoteAccess CreateRemoteAccessConnection(string host, UInt32 ident, string clientName, bool forceConnection)
        {
            IntPtr host_mem       = CustomMarshal.MakeUTF8String(host);
            IntPtr clientName_mem = CustomMarshal.MakeUTF8String(clientName);

            IntPtr rendPtr = RENDERDOC_CreateRemoteAccessConnection(host_mem, ident, clientName_mem, forceConnection);

            CustomMarshal.Free(host_mem);
            CustomMarshal.Free(clientName_mem);

            if (rendPtr == IntPtr.Zero)
            {
                var e = new System.ApplicationException("Failed to open remote access connection");
                e.Data.Add("status", ReplayCreateStatus.UnknownError);
                throw e;
            }

            return(new RemoteAccess(rendPtr));
        }
Exemple #22
0
        public void GetBasis(out Vec3f pos, out Vec3f fwd, out Vec3f right, out Vec3f up)
        {
            IntPtr p = CustomMarshal.Alloc(typeof(FloatVector));
            IntPtr f = CustomMarshal.Alloc(typeof(FloatVector));
            IntPtr r = CustomMarshal.Alloc(typeof(FloatVector));
            IntPtr u = CustomMarshal.Alloc(typeof(FloatVector));

            Camera_GetBasis(m_Real, p, f, r, u);

            pos   = new Vec3f((FloatVector)CustomMarshal.PtrToStructure(p, typeof(FloatVector), false));
            fwd   = new Vec3f((FloatVector)CustomMarshal.PtrToStructure(f, typeof(FloatVector), false));
            right = new Vec3f((FloatVector)CustomMarshal.PtrToStructure(r, typeof(FloatVector), false));
            up    = new Vec3f((FloatVector)CustomMarshal.PtrToStructure(u, typeof(FloatVector), false));

            CustomMarshal.Free(p);
            CustomMarshal.Free(f);
            CustomMarshal.Free(r);
            CustomMarshal.Free(u);
        }
Exemple #23
0
        public ResourceId BuildTargetShader(string entry, string source, UInt32 compileFlags, ShaderStageType type, out string errors)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));

            ResourceId ret = ResourceId.Null;

            bool success = ReplayRenderer_BuildTargetShader(m_Real, entry, source, compileFlags, type, ref ret, mem);

            if (!success)
            {
                ret = ResourceId.Null;
            }

            errors = CustomMarshal.TemplatedArrayToUniString(mem, true);

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #24
0
        public ReplayRenderer CreateProxyRenderer(int proxyid, string logfile, ref float progress)
        {
            IntPtr rendPtr = IntPtr.Zero;

            IntPtr logfile_mem = CustomMarshal.MakeUTF8String(logfile);

            ReplayCreateStatus ret = RemoteRenderer_CreateProxyRenderer(m_Real, (UInt32)proxyid, logfile_mem, ref progress, ref rendPtr);

            CustomMarshal.Free(logfile_mem);

            if (rendPtr == IntPtr.Zero || ret != ReplayCreateStatus.Success)
            {
                var e = new System.ApplicationException("Failed to set up local proxy replay with remote connection");
                e.Data.Add("status", ret);
                throw e;
            }

            return(new ReplayRenderer(rendPtr));
        }
Exemple #25
0
        public static ReplaySupport SupportLocalReplay(string logfile, out string driverName, out string recordMachineIdent)
        {
            IntPtr name_mem  = CustomMarshal.Alloc(typeof(templated_array));
            IntPtr ident_mem = CustomMarshal.Alloc(typeof(templated_array));

            IntPtr logfile_mem = CustomMarshal.MakeUTF8String(logfile);

            ReplaySupport ret = RENDERDOC_SupportLocalReplay(logfile_mem, name_mem, ident_mem);

            CustomMarshal.Free(logfile_mem);

            driverName         = CustomMarshal.TemplatedArrayToString(name_mem, true);
            recordMachineIdent = CustomMarshal.TemplatedArrayToString(ident_mem, true);

            CustomMarshal.Free(name_mem);
            CustomMarshal.Free(ident_mem);

            return(ret);
        }
Exemple #26
0
        public string[] GetResolve(UInt64[] callstack)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));

            UInt32 len = (UInt32)callstack.Length;

            bool success = ReplayRenderer_GetResolve(m_Real, callstack, len, mem);

            string[] ret = null;

            if (success)
            {
                ret = CustomMarshal.TemplatedArrayToStringArray(mem, true);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #27
0
        public MeshFormat GetPostVSData(UInt32 instID, MeshDataStage stage)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(MeshFormat));

            MeshFormat ret = new MeshFormat();

            ret.buf = ResourceId.Null;

            bool success = ReplayRenderer_GetPostVSData(m_Real, instID, stage, mem);

            if (success)
            {
                ret = (MeshFormat)CustomMarshal.PtrToStructure(mem, typeof(MeshFormat), true);
            }

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #28
0
        public static RemoteRenderer CreateRemoteReplayConnection(string host)
        {
            IntPtr rendPtr = IntPtr.Zero;

            IntPtr host_mem = CustomMarshal.MakeUTF8String(host);

            ReplayCreateStatus ret = RENDERDOC_CreateRemoteReplayConnection(host_mem, ref rendPtr);

            CustomMarshal.Free(host_mem);

            if (rendPtr == IntPtr.Zero || ret != ReplayCreateStatus.Success)
            {
                var e = new System.ApplicationException("Failed to connect to remote replay host");
                e.Data.Add("status", ret);
                throw e;
            }

            return(new RemoteRenderer(rendPtr));
        }
Exemple #29
0
        public ResourceId BuildTargetShader(string entry, string source, UInt32 compileFlags, ShaderStageType type, out string errors)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));

            ResourceId ret = ResourceId.Null;

            IntPtr entry_mem  = CustomMarshal.MakeUTF8String(entry);
            IntPtr source_mem = CustomMarshal.MakeUTF8String(source);

            ReplayRenderer_BuildTargetShader(m_Real, entry_mem, source_mem, compileFlags, type, ref ret, mem);

            CustomMarshal.Free(entry_mem);
            CustomMarshal.Free(source_mem);

            errors = CustomMarshal.TemplatedArrayToString(mem, true);

            CustomMarshal.Free(mem);

            return(ret);
        }
Exemple #30
0
        public static UInt32[] EnumerateRemoteConnections(string host)
        {
            IntPtr host_mem = CustomMarshal.MakeUTF8String(host);

            UInt32 numIdents = RENDERDOC_EnumerateRemoteConnections(host_mem, null);

            if (numIdents == 0)
            {
                CustomMarshal.Free(host_mem);
                return(null);
            }

            UInt32[] ret = new UInt32[numIdents];

            RENDERDOC_EnumerateRemoteConnections(host_mem, ret);

            CustomMarshal.Free(host_mem);

            return(ret);
        }