From e229dab5393eac68121a54fa69dd42cb61015d74 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 10 Jul 2019 12:38:21 +0200 Subject: [PATCH] [unity] Fixed fragment shader output (from COLOR to SV_Target), fixes ps4 shader compile error. Closes #1374. --- .../Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader | 2 +- .../Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc | 2 +- .../spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc | 2 +- .../Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader | 4 ++-- .../Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader | 2 +- .../Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader | 4 ++-- .../spine-unity/Shaders/Spine-Skeleton-TintBlack.shader | 4 ++-- .../Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader | 4 ++-- .../Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader index 281e17a9d..34a72f5a0 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader @@ -102,7 +102,7 @@ Shader "Spine/Special/Skeleton Grayscale" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); clip(texcol.a * i.uvAndAlpha.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc index 8e93d3eb3..401ed899e 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc @@ -40,7 +40,7 @@ vertexOutput vert(vertexInput v, float4 vertexColor : COLOR) uniform fixed _ShadowAlphaCutoff; -fixed4 frag(vertexOutput IN) : COLOR +fixed4 frag(vertexOutput IN) : SV_Target { fixed4 texureColor = calculateTexturePixel(IN.texcoordAndAlpha.xy); clip(texureColor.a * IN.texcoordAndAlpha.a - _ShadowAlphaCutoff); diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc index 6839573f5..b1ca438c0 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc @@ -43,7 +43,7 @@ vertexOutput vert(vertexInput v, float4 vertexColor : COLOR) uniform fixed _ShadowAlphaCutoff; -fixed4 frag(vertexOutput IN) : COLOR +fixed4 frag(vertexOutput IN) : SV_Target { fixed4 texureColor = tex2D(_MainTex, IN.texcoordAndAlpha.xy); clip(texureColor.a * IN.texcoordAndAlpha.a - _ShadowAlphaCutoff); diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader index 50556cc2b..62aa8cb3e 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader @@ -60,7 +60,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Additive" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); #if defined(_STRAIGHT_ALPHA_INPUT) @@ -105,7 +105,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Additive" { uniform sampler2D _MainTex; uniform fixed _Cutoff; - float4 frag (v2f i) : COLOR { + float4 frag (v2f i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); clip(texcol.a * i.uvAndAlpha.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader index c94f2c5a6..a02077e94 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader @@ -60,7 +60,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Multiply" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); #if defined(_STRAIGHT_ALPHA_INPUT) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader index 4cf2439a5..f059dcb17 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader @@ -60,7 +60,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Screen" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); #if defined(_STRAIGHT_ALPHA_INPUT) @@ -105,7 +105,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Screen" { uniform sampler2D _MainTex; uniform fixed _Cutoff; - float4 frag (v2f i) : COLOR { + float4 frag (v2f i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); clip(texcol.a * i.uvAndAlpha.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader index 202faebfb..9af297ff4 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader @@ -69,7 +69,7 @@ Shader "Spine/Skeleton Tint Black" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); #if defined(_STRAIGHT_ALPHA_INPUT) @@ -111,7 +111,7 @@ Shader "Spine/Skeleton Tint Black" { return o; } - float4 frag (v2f i) : COLOR { + float4 frag (v2f i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); clip(texcol.a * i.uvAndAlpha.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader index bbbda8085..62649c969 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader @@ -50,7 +50,7 @@ Shader "Spine/Skeleton" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); #if defined(_STRAIGHT_ALPHA_INPUT) @@ -95,7 +95,7 @@ Shader "Spine/Skeleton" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); clip(texcol.a * i.uvAndAlpha.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader index 4f849f863..835802ccf 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader @@ -196,7 +196,7 @@ Shader "Spine/Skeleton Lit" { uniform sampler2D _MainTex; uniform fixed _Cutoff; - float4 frag (v2f i) : COLOR { + float4 frag (v2f i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); clip(texcol.a * i.uvAndAlpha.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i)