Version: 2023.2
言語: 日本語
public bool GetGfxResourceInfo (ulong gfxResourceId, out Profiling.FrameDataView.GfxResourceInfo info);

パラメーター

gfxResourceId Graphics resource identifier.
info Graphics resource information output struct with instance ID and other attributes.

戻り値

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

説明

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.GetItemInstanceID 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.relatedInstanceId, out var objectInfo)) return objectInfo.name; } return "N/A"; } } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961