| | | 1 | | // Copyright (c) 2020-2024 dotBunny Inc. |
| | | 2 | | // dotBunny licenses this file to you under the BSL-1.0 license. |
| | | 3 | | // See the LICENSE file in the project root for more information. |
| | | 4 | | |
| | | 5 | | #if !UNITY_DOTSRUNTIME |
| | | 6 | | |
| | | 7 | | using UnityEngine; |
| | | 8 | | |
| | | 9 | | namespace GDX.Developer.Reports.Resource.Objects |
| | | 10 | | { |
| | | 11 | | /// <exception cref="UnsupportedRuntimeException">Not supported on DOTS Runtime.</exception> |
| | | 12 | | public sealed class ShaderObjectInfo : ObjectInfo |
| | | 13 | | { |
| | | 14 | | public new const string TypeDefinition = "GDX.Developer.Reports.Resource.Objects.ShaderObjectInfo,GDX"; |
| | | 15 | | public bool IsSupported; |
| | | 16 | | public int PassCount; |
| | | 17 | | |
| | | 18 | | |
| | | 19 | | /// <summary> |
| | | 20 | | /// Create a clone of this object. |
| | | 21 | | /// </summary> |
| | | 22 | | /// <returns></returns> |
| | | 23 | | public override ObjectInfo Clone() |
| | 0 | 24 | | { |
| | 0 | 25 | | return new ShaderObjectInfo |
| | | 26 | | { |
| | | 27 | | CopyCount = CopyCount, |
| | | 28 | | MemoryUsage = MemoryUsage, |
| | | 29 | | Name = Name, |
| | | 30 | | Reference = Reference, |
| | | 31 | | TotalMemoryUsage = TotalMemoryUsage, |
| | | 32 | | Type = Type, |
| | | 33 | | IsSupported = IsSupported, |
| | | 34 | | PassCount = PassCount |
| | | 35 | | }; |
| | 0 | 36 | | } |
| | | 37 | | |
| | | 38 | | public override void Populate(Object targetObject, TransientReference reference = null) |
| | 132 | 39 | | { |
| | 132 | 40 | | base.Populate(targetObject, reference); |
| | 132 | 41 | | Shader shaderAsset = (Shader)targetObject; |
| | | 42 | | |
| | | 43 | | // Useful shader information |
| | 132 | 44 | | PassCount = shaderAsset.passCount; |
| | 132 | 45 | | IsSupported = shaderAsset.isSupported; |
| | 132 | 46 | | } |
| | | 47 | | |
| | | 48 | | /// <inheritdoc /> |
| | | 49 | | public override string GetDetailedInformation(int maximumWidth) |
| | 176 | 50 | | { |
| | 176 | 51 | | return $"Passes:{PassCount.ToString()}"; |
| | 176 | 52 | | } |
| | | 53 | | } |
| | | 54 | | } |
| | | 55 | | #endif // !UNITY_DOTSRUNTIME |