Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 4b93a3a

Browse files
committed
Fixes after code review.
1 parent dd15794 commit 4b93a3a

15 files changed

Lines changed: 53 additions & 59 deletions

PostProcessing/Runtime/Effects/ColorGrading.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ void RenderHDRPipeline(PostProcessRenderContext context)
224224
break;
225225
}
226226

227-
bool isMobilePlatform = Application.platform == RuntimePlatform.Android;
227+
bool isAndroidOpenGL = Application.platform == RuntimePlatform.Android && SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan;
228228
int groupSizeXY = Mathf.CeilToInt(k_Lut3DSize / 8f);
229-
int groupSizeZ = Mathf.CeilToInt(k_Lut3DSize / (isMobilePlatform ? 2f : 8f));
229+
int groupSizeZ = Mathf.CeilToInt(k_Lut3DSize / (isAndroidOpenGL ? 2f : 8f));
230230
var cmd = context.command;
231231
cmd.SetComputeTextureParam(compute, kernel, "_Output", m_InternalLogLut);
232232
cmd.SetComputeVectorParam(compute, "_Size", new Vector4(k_Lut3DSize, 1f / (k_Lut3DSize - 1f), 0f, 0f));

PostProcessing/Runtime/Monitors/HistogramMonitor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ internal override void OnEnable()
2626
{
2727
base.OnEnable();
2828

29-
bool isMobilePlatform = Application.isMobilePlatform;
29+
bool isAndroidOpenGL = Application.platform == RuntimePlatform.Android && SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan;
3030

31-
numBins = isMobilePlatform ? 128 : 256;
32-
threadGroupSizeX = isMobilePlatform ? 16 : 16;
33-
threadGroupSizeY = isMobilePlatform ? 8 : 16;
31+
numBins = isAndroidOpenGL ? 128 : 256;
32+
threadGroupSizeX = isAndroidOpenGL ? 16 : 16;
33+
threadGroupSizeY = isAndroidOpenGL ? 8 : 16;
3434
}
3535

3636
internal override void OnDisable()

PostProcessing/Runtime/Monitors/VectorscopeMonitor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ internal override void OnEnable()
2626
{
2727
base.OnEnable();
2828

29-
bool isMobilePlatform = Application.isMobilePlatform;
29+
bool isAndroidOpenGL = Application.platform == RuntimePlatform.Android && SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan;
3030

31-
threadGroupSizeX = isMobilePlatform ? 16 : 16;
32-
threadGroupSizeY = isMobilePlatform ? 8 : 16;
31+
threadGroupSizeX = isAndroidOpenGL ? 16 : 16;
32+
threadGroupSizeY = isAndroidOpenGL ? 8 : 16;
3333
}
3434

3535
internal override bool NeedsHalfRes()

PostProcessing/Runtime/Monitors/WaveformMonitor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ internal override void OnEnable()
3131
{
3232
base.OnEnable();
3333

34-
bool isMobilePlatform = Application.platform == RuntimePlatform.Android;
34+
bool isAndroidOpenGL = Application.platform == RuntimePlatform.Android && SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan;
3535

36-
threadGroupSize = isMobilePlatform ? 128 : 256;
37-
threadGroupSizeX = isMobilePlatform ? 16 : 16;
38-
threadGroupSizeY = isMobilePlatform ? 8 : 16;
36+
threadGroupSize = isAndroidOpenGL ? 128 : 256;
37+
threadGroupSizeX = isAndroidOpenGL ? 16 : 16;
38+
threadGroupSizeY = isAndroidOpenGL ? 8 : 16;
3939
}
4040

4141
internal override bool NeedsHalfRes()

PostProcessing/Runtime/Utils/LogHistogram.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public void Generate(PostProcessRenderContext context)
1616
{
1717
if (data == null)
1818
{
19-
bool isMobilePlatform = Application.isMobilePlatform;
20-
threadX = isMobilePlatform ? 16 : 16;
21-
threadY = isMobilePlatform ? 8 : 16;
19+
bool isAndroidOpenGL = Application.platform == RuntimePlatform.Android && SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan;
20+
threadX = isAndroidOpenGL ? 16 : 16;
21+
threadY = isAndroidOpenGL ? 8 : 16;
2222
data = new ComputeBuffer (k_Bins, sizeof(uint));
2323
}
2424

PostProcessing/Runtime/Utils/TextureLerper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ internal Texture Lerp(Texture from, Texture to, float t)
107107

108108
RenderTexture rt = null;
109109

110-
bool isMobilePlatform = Application.platform == RuntimePlatform.Android;
110+
bool isAndroidOpenGL = Application.platform == RuntimePlatform.Android && SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan;
111111

112112
if (is3d)
113113
{
@@ -122,7 +122,7 @@ internal Texture Lerp(Texture from, Texture to, float t)
122122
m_Command.SetComputeTextureParam(compute, kernel, "_To", to);
123123

124124
int groupSizeXY = Mathf.CeilToInt(size / 8f);
125-
int groupSizeZ = Mathf.CeilToInt(size / (isMobilePlatform ? 2f : 8f));
125+
int groupSizeZ = Mathf.CeilToInt(size / (isAndroidOpenGL ? 2f : 8f));
126126
m_Command.DispatchCompute(compute, kernel, groupSizeXY, groupSizeXY, groupSizeZ);
127127
}
128128
else

PostProcessing/Shaders/Builtins/ExposureHistogram.compute

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RWStructuredBuffer<uint> _HistogramBuffer;
99
Texture2D<float4> _Source;
1010

1111
CBUFFER_START(Params)
12-
float4 _ScaleOffsetRes; // x: scale, y: offset, z: width, w: height
12+
float4 _ScaleOffsetRes; // x: scale, y: offset, z: width, w: height
1313
CBUFFER_END
1414

1515
groupshared uint gs_histogram[HISTOGRAM_BINS];

PostProcessing/Shaders/Builtins/ExposureHistogram.hlsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#define HISTOGRAM_BINS 128
88
#define HISTOGRAM_TEXELS HISTOGRAM_BINS / 4
99
#if SHADER_API_GLES3
10-
#define HISTOGRAM_THREAD_X 16
11-
#define HISTOGRAM_THREAD_Y 8
10+
#define HISTOGRAM_THREAD_X 16
11+
#define HISTOGRAM_THREAD_Y 8
1212
#else
13-
#define HISTOGRAM_THREAD_X 16
14-
#define HISTOGRAM_THREAD_Y 16
13+
#define HISTOGRAM_THREAD_X 16
14+
#define HISTOGRAM_THREAD_Y 16
1515
#endif
1616

1717
float GetHistogramBinFromLuminance(float value, float2 scaleOffset)

PostProcessing/Shaders/Builtins/Lut3DBaker.compute

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ void Eval(uint3 id)
152152
}
153153

154154
#ifdef SHADER_API_GLES3
155-
#define GROUP_SIZE_XY 8
156-
#define GROUP_SIZE_Z 2
155+
#define GROUP_SIZE_XY 8
156+
#define GROUP_SIZE_Z 2
157157
#else
158-
#define GROUP_SIZE_XY 8
159-
#define GROUP_SIZE_Z 8
158+
#define GROUP_SIZE_XY 8
159+
#define GROUP_SIZE_Z 8
160160
#endif
161161

162162
[numthreads(GROUP_SIZE_XY, GROUP_SIZE_XY, GROUP_SIZE_Z)]

PostProcessing/Shaders/Builtins/Texture3DLerp.compute

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Texture3D _From;
1212
Texture3D _To;
1313

1414
#ifdef SHADER_API_GLES3
15-
#define GROUP_SIZE_XY 8
16-
#define GROUP_SIZE_Z 2
15+
#define GROUP_SIZE_XY 8
16+
#define GROUP_SIZE_Z 2
1717
#else
18-
#define GROUP_SIZE_XY 8
19-
#define GROUP_SIZE_Z 8
18+
#define GROUP_SIZE_XY 8
19+
#define GROUP_SIZE_Z 8
2020
#endif
2121

2222
[numthreads(GROUP_SIZE_XY, GROUP_SIZE_XY, GROUP_SIZE_Z)]

0 commit comments

Comments
 (0)