|
26 | 26 | #define UNITY_LOOP [loop] |
27 | 27 |
|
28 | 28 | // GLES 3.1 + AEP shader feature https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html |
29 | | -#if (SHADER_TARGET >= 40) |
| 29 | +#if (SHADER_TARGET >= 50) |
30 | 30 | #define GLES3_1_AEP 1 |
31 | 31 | #else |
32 | 32 | #define GLES3_1_AEP 0 |
|
66 | 66 | #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) |
67 | 67 | #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) |
68 | 68 |
|
69 | | -#if GLES3_1_AEP |
| 69 | +#if SHADER_AVAILABLE_RANDOMWRITE |
70 | 70 | #define RW_TEXTURE2D(type, textureName) RWTexture2D<type> textureName |
71 | 71 | #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray<type> textureName |
72 | 72 | #define RW_TEXTURE3D(type, textureName) RWTexture3D<type> textureName |
|
114 | 114 | #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) |
115 | 115 | #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) |
116 | 116 |
|
117 | | -#ifdef UNITY_NO_CUBEMAP_ARRAY |
118 | | -#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) |
119 | | -#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) |
120 | | -#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) |
121 | | -#else |
| 117 | +#if SHADER_AVAILABLE_CUBEARRAY |
122 | 118 | #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) |
123 | 119 | #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) |
124 | 120 | #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) |
| 121 | +#else |
| 122 | +#define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) |
| 123 | +#define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) |
| 124 | +#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) |
125 | 125 | #endif |
126 | 126 |
|
127 | 127 | #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) |
|
144 | 144 | #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) |
145 | 145 | #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) |
146 | 146 |
|
147 | | -#if GLES3_1_AEP |
| 147 | +#if SHADER_TARGET >= 45 |
148 | 148 | #define PLATFORM_SUPPORT_GATHER |
149 | 149 | #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) |
150 | 150 | #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) |
151 | 151 | #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) |
| 152 | +#if SHADER_AVAILABLE_CUBEARRAY |
152 | 153 | #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) |
| 154 | +#else |
| 155 | +#define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) |
| 156 | +#endif |
153 | 157 | #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) |
154 | 158 | #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) |
155 | 159 | #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) |
|
0 commit comments