Skip to content

Commit d6e03d5

Browse files
author
Jiang Yin
committed
兼容Unity2020.2
1 parent 19b2a36 commit d6e03d5

File tree

4 files changed

+63
-6
lines changed

4 files changed

+63
-6
lines changed

Scripts/Runtime/Debugger/DebuggerComponent.GraphicsInformationWindow.cs

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,20 @@ protected override void OnDrawScrollableWindow()
2727
DrawItem("Device Version", SystemInfo.graphicsDeviceVersion);
2828
DrawItem("Memory Size", Utility.Text.Format("{0} MB", SystemInfo.graphicsMemorySize.ToString()));
2929
DrawItem("Multi Threaded", SystemInfo.graphicsMultiThreaded.ToString());
30+
#if UNITY_2019_3_OR_NEWER
31+
DrawItem("Rendering Threading Mode", SystemInfo.renderingThreadingMode.ToString());
32+
#endif
33+
#if UNITY_2020_1_OR_NEWER
34+
DrawItem("HRD Display Support Flags", SystemInfo.hdrDisplaySupportFlags.ToString());
35+
#endif
3036
DrawItem("Shader Level", GetShaderLevelString(SystemInfo.graphicsShaderLevel));
3137
DrawItem("Global Maximum LOD", Shader.globalMaximumLOD.ToString());
3238
#if UNITY_5_6_OR_NEWER
3339
DrawItem("Global Render Pipeline", Shader.globalRenderPipeline);
3440
#endif
41+
#if UNITY_2020_2_OR_NEWER
42+
DrawItem("Min OpenGLES Version", Graphics.minOpenGLESVersion.ToString());
43+
#endif
3544
#if UNITY_5_5_OR_NEWER
3645
DrawItem("Active Tier", Graphics.activeTier.ToString());
3746
#endif
@@ -44,6 +53,9 @@ protected override void OnDrawScrollableWindow()
4453
DrawItem("NPOT Support", SystemInfo.npotSupport.ToString());
4554
DrawItem("Max Texture Size", SystemInfo.maxTextureSize.ToString());
4655
DrawItem("Supported Render Target Count", SystemInfo.supportedRenderTargetCount.ToString());
56+
#if UNITY_2019_3_OR_NEWER
57+
DrawItem("Supported Random Write Target Count", SystemInfo.supportedRandomWriteTargetCount.ToString());
58+
#endif
4759
#if UNITY_5_4_OR_NEWER
4860
DrawItem("Copy Texture Support", SystemInfo.copyTextureSupport.ToString());
4961
#endif
@@ -54,7 +66,9 @@ protected override void OnDrawScrollableWindow()
5466
DrawItem("Max Cubemap Size", SystemInfo.maxCubemapSize.ToString());
5567
DrawItem("Graphics UV Starts At Top", SystemInfo.graphicsUVStartsAtTop.ToString());
5668
#endif
57-
#if UNITY_2019_1_OR_NEWER
69+
#if UNITY_2020_2_OR_NEWER
70+
DrawItem("Constant Buffer Offset Alignment", SystemInfo.constantBufferOffsetAlignment.ToString());
71+
#elif UNITY_2019_1_OR_NEWER
5872
DrawItem("Min Constant Buffer Offset Alignment", SystemInfo.minConstantBufferOffsetAlignment.ToString());
5973
#endif
6074
#if UNITY_2018_3_OR_NEWER
@@ -64,6 +78,19 @@ protected override void OnDrawScrollableWindow()
6478
#if UNITY_2019_2_OR_NEWER
6579
DrawItem("Has Mip Max Level", SystemInfo.hasMipMaxLevel.ToString());
6680
#endif
81+
#if UNITY_2019_3_OR_NEWER
82+
DrawItem("Uses Load Store Actions", SystemInfo.usesLoadStoreActions.ToString());
83+
DrawItem("Max Compute Buffer Inputs Compute", SystemInfo.maxComputeBufferInputsCompute.ToString());
84+
DrawItem("Max Compute Buffer Inputs Domain", SystemInfo.maxComputeBufferInputsDomain.ToString());
85+
DrawItem("Max Compute Buffer Inputs Fragment", SystemInfo.maxComputeBufferInputsFragment.ToString());
86+
DrawItem("Max Compute Buffer Inputs Geometry", SystemInfo.maxComputeBufferInputsGeometry.ToString());
87+
DrawItem("Max Compute Buffer Inputs Hull", SystemInfo.maxComputeBufferInputsHull.ToString());
88+
DrawItem("Max Compute Buffer Inputs Vertex", SystemInfo.maxComputeBufferInputsVertex.ToString());
89+
DrawItem("Max Compute Work Group Size", SystemInfo.maxComputeWorkGroupSize.ToString());
90+
DrawItem("Max Compute Work Group Size X", SystemInfo.maxComputeWorkGroupSizeX.ToString());
91+
DrawItem("Max Compute Work Group Size Y", SystemInfo.maxComputeWorkGroupSizeY.ToString());
92+
DrawItem("Max Compute Work Group Size Z", SystemInfo.maxComputeWorkGroupSizeZ.ToString());
93+
#endif
6794
#if UNITY_5_3 || UNITY_5_4
6895
DrawItem("Supports Stencil", SystemInfo.supportsStencil.ToString());
6996
DrawItem("Supports Render Textures", SystemInfo.supportsRenderTextures.ToString());
@@ -74,12 +101,10 @@ protected override void OnDrawScrollableWindow()
74101
DrawItem("Supports Raw Shadow Depth Sampling", SystemInfo.supportsRawShadowDepthSampling.ToString());
75102
#if !UNITY_2019_1_OR_NEWER
76103
DrawItem("Supports Render To Cubemap", SystemInfo.supportsRenderToCubemap.ToString());
104+
DrawItem("Supports Image Effects", SystemInfo.supportsImageEffects.ToString());
77105
#endif
78106
DrawItem("Supports Compute Shader", SystemInfo.supportsComputeShaders.ToString());
79107
DrawItem("Supports Instancing", SystemInfo.supportsInstancing.ToString());
80-
#if !UNITY_2019_1_OR_NEWER
81-
DrawItem("Supports Image Effects", SystemInfo.supportsImageEffects.ToString());
82-
#endif
83108
#if UNITY_5_4_OR_NEWER
84109
DrawItem("Supports 2D Array Textures", SystemInfo.supports2DArrayTextures.ToString());
85110
DrawItem("Supports Motion Vectors", SystemInfo.supportsMotionVectors.ToString());
@@ -100,7 +125,7 @@ protected override void OnDrawScrollableWindow()
100125
#endif
101126
#if UNITY_2017_3_OR_NEWER
102127
DrawItem("Supports Async Compute", SystemInfo.supportsAsyncCompute.ToString());
103-
DrawItem("Supports Multisampled Textures", SystemInfo.supportsMultisampledTextures.ToString());
128+
DrawItem("Supports Multi-sampled Textures", SystemInfo.supportsMultisampledTextures.ToString());
104129
#endif
105130
#if UNITY_2018_1_OR_NEWER
106131
DrawItem("Supports Async GPU Readback", SystemInfo.supportsAsyncGPUReadback.ToString());
@@ -109,13 +134,28 @@ protected override void OnDrawScrollableWindow()
109134
#endif
110135
#if UNITY_2018_2_OR_NEWER
111136
DrawItem("Supports Mip Streaming", SystemInfo.supportsMipStreaming.ToString());
112-
DrawItem("Supports Multisample Auto Resolve", SystemInfo.supportsMultisampleAutoResolve.ToString());
137+
DrawItem("Supports Multi-sample Auto Resolve", SystemInfo.supportsMultisampleAutoResolve.ToString());
113138
#endif
114139
#if UNITY_2018_3_OR_NEWER
115140
DrawItem("Supports Separated Render Targets Blend", SystemInfo.supportsSeparatedRenderTargetsBlend.ToString());
116141
#endif
117142
#if UNITY_2019_1_OR_NEWER
118143
DrawItem("Supports Set Constant Buffer", SystemInfo.supportsSetConstantBuffer.ToString());
144+
#endif
145+
#if UNITY_2019_3_OR_NEWER
146+
DrawItem("Supports Geometry Shaders", SystemInfo.supportsGeometryShaders.ToString());
147+
DrawItem("Supports Ray Tracing", SystemInfo.supportsRayTracing.ToString());
148+
DrawItem("Supports Tessellation Shaders", SystemInfo.supportsTessellationShaders.ToString());
149+
#endif
150+
#if UNITY_2020_1_OR_NEWER
151+
DrawItem("Supports Compressed 3D Textures", SystemInfo.supportsCompressed3DTextures.ToString());
152+
DrawItem("Supports Conservative Raster", SystemInfo.supportsConservativeRaster.ToString());
153+
DrawItem("Supports GPU Recorder", SystemInfo.supportsGpuRecorder.ToString());
154+
#endif
155+
#if UNITY_2020_2_OR_NEWER
156+
DrawItem("Supports Multi-sampled 2D Array Textures", SystemInfo.supportsMultisampled2DArrayTextures.ToString());
157+
DrawItem("Supports Multiview", SystemInfo.supportsMultiview.ToString());
158+
DrawItem("Supports Render Target Array Index From Vertex Shader", SystemInfo.supportsRenderTargetArrayIndexFromVertexShader.ToString());
119159
#endif
120160
}
121161
GUILayout.EndVertical();

Scripts/Runtime/Debugger/DebuggerComponent.ProfilerInformationWindow.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ protected override void OnDrawScrollableWindow()
2525
DrawItem("Supported", Profiler.supported.ToString());
2626
DrawItem("Enabled", Profiler.enabled.ToString());
2727
DrawItem("Enable Binary Log", Profiler.enableBinaryLog ? Utility.Text.Format("True, {0}", Profiler.logFile) : "False");
28+
#if UNITY_2019_3_OR_NEWER
29+
DrawItem("Enable Allocation Callstacks", Profiler.enableAllocationCallstacks.ToString());
30+
#endif
2831
#if UNITY_2018_3_OR_NEWER
2932
DrawItem("Area Count", Profiler.areaCount.ToString());
3033
#endif

Scripts/Runtime/Debugger/DebuggerComponent.SceneInformationWindow.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,19 @@ protected override void OnDrawScrollableWindow()
2323
DrawItem("Scene Count In Build Settings", SceneManager.sceneCountInBuildSettings.ToString());
2424

2525
Scene activeScene = SceneManager.GetActiveScene();
26+
#if UNITY_2018_3_OR_NEWER
27+
DrawItem("Active Scene Handle", activeScene.handle.ToString());
28+
#endif
2629
DrawItem("Active Scene Name", activeScene.name);
2730
DrawItem("Active Scene Path", activeScene.path);
2831
DrawItem("Active Scene Build Index", activeScene.buildIndex.ToString());
2932
DrawItem("Active Scene Is Dirty", activeScene.isDirty.ToString());
3033
DrawItem("Active Scene Is Loaded", activeScene.isLoaded.ToString());
3134
DrawItem("Active Scene Is Valid", activeScene.IsValid().ToString());
3235
DrawItem("Active Scene Root Count", activeScene.rootCount.ToString());
36+
#if UNITY_2019_1_OR_NEWER
37+
DrawItem("Active Scene Is Sub Scene", activeScene.isSubScene.ToString());
38+
#endif
3339
}
3440
GUILayout.EndVertical();
3541
}

Scripts/Runtime/FileSystem/AndroidFileSystemStream.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,13 @@ private int InternalRead()
245245

246246
private int InternalRead(int length, out byte[] result)
247247
{
248+
#if UNITY_2019_2_OR_NEWER
248249
#pragma warning disable CS0618
250+
#endif
249251
IntPtr resultPtr = AndroidJNI.NewByteArray(length);
252+
#if UNITY_2019_2_OR_NEWER
250253
#pragma warning restore CS0618
254+
#endif
251255
int offset = 0;
252256
int bytesLeft = length;
253257
while (bytesLeft > 0)
@@ -265,9 +269,13 @@ private int InternalRead(int length, out byte[] result)
265269
bytesLeft -= bytesRead;
266270
}
267271

272+
#if UNITY_2019_2_OR_NEWER
268273
#pragma warning disable CS0618
274+
#endif
269275
result = AndroidJNI.FromByteArray(resultPtr);
276+
#if UNITY_2019_2_OR_NEWER
270277
#pragma warning restore CS0618
278+
#endif
271279
AndroidJNI.DeleteLocalRef(resultPtr);
272280
return offset;
273281
}

0 commit comments

Comments
 (0)