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

Commit 1e4d5e8

Browse files
committed
Remove UNITY_3D_TEXTURES_SUPPORTED define and use tex2D instead.
For Vita define the TEXTURE3D related macros to use 2D instead, avoids compiler errors and cleaner code with fewer #if's
1 parent 44a1eeb commit 1e4d5e8

File tree

9 files changed

+8
-18
lines changed

9 files changed

+8
-18
lines changed

PostProcessing/Shaders/API/D3D11.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#define UNITY_UV_STARTS_AT_TOP 1
22
#define UNITY_REVERSED_Z 1
33
#define UNITY_GATHER_SUPPORTED (SHADER_TARGET >= 50)
4-
#define UNITY_3D_TEXTURES_SUPPORTED 1
54
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
65

76
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName

PostProcessing/Shaders/API/D3D12.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#define UNITY_UV_STARTS_AT_TOP 1
22
#define UNITY_REVERSED_Z 1
33
#define UNITY_GATHER_SUPPORTED (SHADER_TARGET >= 50)
4-
#define UNITY_3D_TEXTURES_SUPPORTED 1
54
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
65

76
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName

PostProcessing/Shaders/API/D3D9.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define UNITY_UV_STARTS_AT_TOP 1
33
#define UNITY_REVERSED_Z 0
44
#define UNITY_GATHER_SUPPORTED 0
5-
#define UNITY_3D_TEXTURES_SUPPORTED 1
65
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
76

87
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) sampler2D textureName

PostProcessing/Shaders/API/Metal.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#define UNITY_UV_STARTS_AT_TOP 1
22
#define UNITY_REVERSED_Z 1
33
#define UNITY_GATHER_SUPPORTED 0 // Currently broken on Metal for some reason (May 2017)
4-
#define UNITY_3D_TEXTURES_SUPPORTED 1
54
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
65

76
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName

PostProcessing/Shaders/API/OpenGL.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define UNITY_UV_STARTS_AT_TOP 0
33
#define UNITY_REVERSED_Z 0
44
#define UNITY_GATHER_SUPPORTED 0
5-
#define UNITY_3D_TEXTURES_SUPPORTED 1
65
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
76

87
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) sampler2D textureName

PostProcessing/Shaders/API/PSP2.hlsl

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,33 @@
22
#define UNITY_UV_STARTS_AT_TOP 1
33
#define UNITY_REVERSED_Z 0
44
#define UNITY_GATHER_SUPPORTED 0
5-
#define UNITY_3D_TEXTURES_SUPPORTED 0
65
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 0
76

87
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) sampler2D textureName
9-
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) sampler3D textureName
108

119
#define TEXTURE2D(textureName) sampler2D textureName
1210
#define SAMPLER2D(samplerName)
1311

14-
#define TEXTURE3D(textureName) sampler3D textureName
15-
#define SAMPLER3D(samplerName)
16-
1712
#define TEXTURE2D_ARGS(textureName, samplerName) sampler2D textureName
1813
#define TEXTURE2D_PARAM(textureName, samplerName) textureName
1914

20-
#define TEXTURE3D_ARGS(textureName, samplerName) sampler3D textureName
21-
#define TEXTURE3D_PARAM(textureName, samplerName) textureName
22-
2315
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) tex2D(textureName, coord2)
2416
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) tex2Dlod(textureName, float4(coord2, 0.0, lod))
2517

26-
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) tex3D(textureName, coord3)
27-
2818
#define LOAD_TEXTURE2D(textureName, texelSize, icoord2) tex2D(textureName, icoord2 / texelSize)
2919
#define LOAD_TEXTURE2D_LOD(textureName, texelSize, icoord2) tex2Dlod(textureName, float4(icoord2 / texelSize, 0.0, lod))
3020

3121
#define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) tex2D<float>(textureName, coord2).r
3222
#define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) tex2Dlod<float>(textureName, float4(coord2, 0.0, lod)).r
3323

24+
// 3D textures are not supported on Vita, use 2D to avoid compile errors.
25+
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) sampler2D textureName
26+
#define TEXTURE3D(textureName) sampler2D textureName
27+
#define SAMPLER3D(samplerName)
28+
#define TEXTURE3D_ARGS(textureName, samplerName) sampler2D textureName
29+
#define TEXTURE3D_PARAM(textureName, samplerName) textureName
30+
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) tex2D(textureName, coord3)
31+
3432
#define UNITY_BRANCH
3533
#define UNITY_FLATTEN
3634
#define UNITY_UNROLL

PostProcessing/Shaders/API/PSSL.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#define UNITY_UV_STARTS_AT_TOP 1
22
#define UNITY_REVERSED_Z 1
33
#define UNITY_GATHER_SUPPORTED (SHADER_TARGET >= 50)
4-
#define UNITY_3D_TEXTURES_SUPPORTED 1
54
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
65
#define INTRINSIC_MINMAX3
76
#define Min3 min3

PostProcessing/Shaders/API/Vulkan.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#define UNITY_UV_STARTS_AT_TOP 1
22
#define UNITY_REVERSED_Z 1
33
#define UNITY_GATHER_SUPPORTED (SHADER_TARGET >= 50)
4-
#define UNITY_3D_TEXTURES_SUPPORTED 1
54
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
65

76
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName

PostProcessing/Shaders/API/XboxOne.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#define UNITY_UV_STARTS_AT_TOP 1
22
#define UNITY_REVERSED_Z 1
33
#define UNITY_GATHER_SUPPORTED (SHADER_TARGET >= 50)
4-
#define UNITY_3D_TEXTURES_SUPPORTED 1
54
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
65

76
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName

0 commit comments

Comments
 (0)