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

Commit a8b9686

Browse files
authored
Merge pull request #528 from Unity-Technologies/vita_support
PSVita support
2 parents 737dee0 + f25493a commit a8b9686

File tree

16 files changed

+78
-5
lines changed

16 files changed

+78
-5
lines changed

PostProcessing/Runtime/Utils/XRSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Small shim for VRSettings/XRSettings on XboxOne and Switch
2-
#if (UNITY_XBOXONE || UNITY_SWITCH) && !UNITY_EDITOR
1+
// Small shim for VRSettings/XRSettings on XboxOne, Switch and PS Vita
2+
#if (UNITY_XBOXONE || UNITY_SWITCH || UNITY_PSP2) && !UNITY_EDITOR
33
using System;
44

55
#if UNITY_2017_2_OR_NEWER

PostProcessing/Shaders/API/D3D11.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
45

56
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
67
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName

PostProcessing/Shaders/API/D3D12.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
45

56
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
67
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName

PostProcessing/Shaders/API/D3D9.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define UNITY_UV_STARTS_AT_TOP 1
33
#define UNITY_REVERSED_Z 0
44
#define UNITY_GATHER_SUPPORTED 0
5+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
56

67
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) sampler2D textureName
78
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) sampler3D textureName

PostProcessing/Shaders/API/Metal.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
45

56
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
67
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName

PostProcessing/Shaders/API/OpenGL.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define UNITY_UV_STARTS_AT_TOP 0
33
#define UNITY_REVERSED_Z 0
44
#define UNITY_GATHER_SUPPORTED 0
5+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
56

67
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) sampler2D textureName
78
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) sampler3D textureName

PostProcessing/Shaders/API/PSP2.hlsl

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
#define UNITY_UV_STARTS_AT_TOP 1
3+
#define UNITY_REVERSED_Z 0
4+
#define UNITY_GATHER_SUPPORTED 0
5+
#define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 0
6+
7+
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) sampler2D textureName
8+
9+
#define TEXTURE2D(textureName) sampler2D textureName
10+
#define SAMPLER2D(samplerName)
11+
12+
#define TEXTURE2D_ARGS(textureName, samplerName) sampler2D textureName
13+
#define TEXTURE2D_PARAM(textureName, samplerName) textureName
14+
15+
#define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) tex2D(textureName, coord2)
16+
#define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) tex2Dlod(textureName, float4(coord2, 0.0, lod))
17+
18+
#define LOAD_TEXTURE2D(textureName, texelSize, icoord2) tex2D(textureName, icoord2 / texelSize)
19+
#define LOAD_TEXTURE2D_LOD(textureName, texelSize, icoord2) tex2Dlod(textureName, float4(icoord2 / texelSize, 0.0, lod))
20+
21+
#define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) tex2D<float>(textureName, coord2).r
22+
#define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) tex2Dlod<float>(textureName, float4(coord2, 0.0, lod)).r
23+
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+
32+
#define UNITY_BRANCH
33+
#define UNITY_FLATTEN
34+
#define UNITY_UNROLL
35+
#define UNITY_LOOP
36+
#define UNITY_FASTOPT
37+
38+
#define CBUFFER_START(name)
39+
#define CBUFFER_END
40+
41+
#define FXAA_HLSL_3 1
42+
#define SMAA_HLSL_3 1
43+
44+
// pragma exclude_renderers is only supported since Unity 2018.1 for compute shaders
45+
#if UNITY_VERSION < 201810 && !defined(SHADER_API_GLCORE)
46+
# define DISABLE_COMPUTE_SHADERS 1
47+
# define TRIVIAL_COMPUTE_KERNEL(name) [numthreads(1, 1, 1)] void name() {}
48+
#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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
45
#define INTRINSIC_MINMAX3
56
#define Min3 min3
67
#define Max3 max3

PostProcessing/Shaders/API/Vulkan.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1
45

56
#define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName
67
#define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName

0 commit comments

Comments
 (0)