Skip to content

Commit 21f5b9c

Browse files
Fix Regression in GLCore from GH #7029 (#7062)
* Fix Regression in GLCore from GH #7029 The changes in GH #7029 accidentally broke the platform shader macro override system for GLCore's texture cube arrays. This change fixes the issue by restoring the missing platform macros. * Fall Back to UNITY_NO_CUBEMAP_ARRAY Due to Bug Due to some sort of bug, SHADER_AVAILABLE_CUBEARRAY is not defined in compute shaders. This commit switches the code back to UNITY_NO_CUBEMAP_ARRAY to avoid futher problems. (FogBugz Case 1402457) * Fix Comment Typo * Revert UNITY_NO_CUBEMAP_ARRAY Changes This change removes usage of UNITY_NO_CUBEMAP_ARRAY and replaces it with SHADER_AVAILABLE_CUBEARRAY since that's the correct macro to be using. The bug we encountered after this change in VFX was actually due to a missing pragma: "#pragma require cubearray".
1 parent 8062e63 commit 21f5b9c

File tree

1 file changed

+6
-6
lines changed
  • com.unity.render-pipelines.core/ShaderLibrary/API

1 file changed

+6
-6
lines changed

com.unity.render-pipelines.core/ShaderLibrary/API/GLCore.hlsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@
109109
#define PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias)
110110

111111
#if SHADER_AVAILABLE_CUBEARRAY
112-
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index))
113-
#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod)
114-
#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias)
112+
#define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index))
113+
#define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod)
114+
#define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias)
115115
#else
116-
#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY)
117-
#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD)
118-
#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS)
116+
#define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY)
117+
#define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD)
118+
#define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS)
119119
#endif
120120

121121
#define PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)

0 commit comments

Comments
 (0)