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

Commit 44a1eeb

Browse files
committed
Fixed UV inversion, shader compile errors, and define SHADER_API_CONSOLE for Vita.
1 parent 9c34127 commit 44a1eeb

File tree

15 files changed

+87
-4
lines changed

15 files changed

+87
-4
lines changed

PostProcessing/Shaders/API/D3D11.hlsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
46

57
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
68
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName

PostProcessing/Shaders/API/D3D12.hlsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
46

57
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
68
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName

PostProcessing/Shaders/API/D3D9.hlsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
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
6+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
57

68
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) sampler2D textureName
79
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) sampler3D textureName

PostProcessing/Shaders/API/Metal.hlsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
46

57
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
68
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName

PostProcessing/Shaders/API/OpenGL.hlsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
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
6+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
57

68
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) sampler2D textureName
79
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) sampler3D textureName

PostProcessing/Shaders/API/PSP2.hlsl

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
#define UNITY_UV_STARTS_AT_TOP 1
3+
#define UNITY_REVERSED_Z 0
4+
#define UNITY_GATHER_SUPPORTED 0
5+
#define UNITY_3D_TEXTURES_SUPPORTED 0
6+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 0
7+
8+
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) sampler2D textureName
9+
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) sampler3D textureName
10+
11+
#define TEXTURE2D(textureName) sampler2D textureName
12+
#define SAMPLER2D(samplerName)
13+
14+
#define TEXTURE3D(textureName) sampler3D textureName
15+
#define SAMPLER3D(samplerName)
16+
17+
#define TEXTURE2D_ARGS(textureName, samplerName) sampler2D textureName
18+
#define TEXTURE2D_PARAM(textureName, samplerName) textureName
19+
20+
#define TEXTURE3D_ARGS(textureName, samplerName) sampler3D textureName
21+
#define TEXTURE3D_PARAM(textureName, samplerName) textureName
22+
23+
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) tex2D(textureName, coord2)
24+
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) tex2Dlod(textureName, float4(coord2, 0.0, lod))
25+
26+
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) tex3D(textureName, coord3)
27+
28+
#define LOAD_TEXTURE2D(textureName, texelSize, icoord2) tex2D(textureName, icoord2 / texelSize)
29+
#define LOAD_TEXTURE2D_LOD(textureName, texelSize, icoord2) tex2Dlod(textureName, float4(icoord2 / texelSize, 0.0, lod))
30+
31+
#define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) tex2D<float>(textureName, coord2).r
32+
#define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) tex2Dlod<float>(textureName, float4(coord2, 0.0, lod)).r
33+
34+
#define UNITY_BRANCH
35+
#define UNITY_FLATTEN
36+
#define UNITY_UNROLL
37+
#define UNITY_LOOP
38+
#define UNITY_FASTOPT
39+
40+
#define CBUFFER_START(name)
41+
#define CBUFFER_END
42+
43+
#define FXAA_HLSL_3 1
44+
#define SMAA_HLSL_3 1
45+
46+
// pragma exclude_renderers is only supported since Unity 2018.1 for compute shaders
47+
#if UNITY_VERSION < 201810 && !defined(SHADER_API_GLCORE)
48+
# define DISABLE_COMPUTE_SHADERS 1
49+
# define TRIVIAL_COMPUTE_KERNEL(name) [numthreads(1, 1, 1)] void name() {}
50+
#endif

PostProcessing/Shaders/API/PSP2.hlsl.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PostProcessing/Shaders/API/PSSL.hlsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
46
#define INTRINSIC_MINMAX3
57
#define Min3 min3
68
#define Max3 max3

PostProcessing/Shaders/API/Vulkan.hlsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
46

57
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
68
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName

PostProcessing/Shaders/API/XboxOne.hlsl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
46

57
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
68
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName

0 commit comments

Comments
 (0)