[ Web Proxy ]
URL:
Viewing: https://docs.unity3d.com/ScriptReference/Profiling.FrameDataView.GetGfxResourceInfo.html [Back]  [Original]

Unity - Scripting API: Profiling.FrameDataView.GetGfxResourceInfo
Version: Unity 6.5 (6000.5)
    • Supported
    • Legacy
    LanguageEnglish
    • C#

    FrameDataView.GetGfxResourceInfo

    Suggest a change

    Success!

    Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

    Close

    Submission failed

    For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

    Close
    Your name Your email Suggestion* Submit suggestion

    Cancel

    Declaration

    public bool GetGfxResourceInfo(ulong gfxResourceId, out GfxResourceInfo info);

    Parameters

    Parameter Description
    gfxResourceId Graphics resource identifier.
    info Graphics resource information output struct with entityId and other attributes.

    Returns

    bool Returns true if resource exists in the frame and the information is available.

    Description

    Gets information for a given graphics resource identifier.

    Use this function to retrieve information about related Unity Objects for the graphics resource in the Profiler capture. On the Render Thread, the Profiler capture can be associated with a graphics resource representing a Texture, RenderTexture, Mesh Asset, or other graphics resource. This information is included as part of the sample metadata; you can use the RawFrameDataView.GetSampleMetadataAsInt or HierarchyFrameDataView.GetItemEntityId functions to retrieve this metadata.

    using UnityEditorInternal;
    using UnityEditor.Profiling;

    public class Example { public static string GetGfxResourceName(int frame, ulong gfxResourceId) { using (var frameData = ProfilerDriver.GetRawFrameDataView(frame, 0)) { if (frameData.GetGfxResourceInfo(gfxResourceId, out var info)) { if (frameData.GetUnityObjectInfo(info.relatedEntityId, out var objectInfo)) return objectInfo.name; } return "N/A"; } } }

    Web Proxy Viewer  |  New URL  |  Original Page