diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2004_AnimatedCookie/AnimatedCookie_Shader.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2004_AnimatedCookie/AnimatedCookie_Shader.shader index bcf1df8c83f..404192adb0e 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2004_AnimatedCookie/AnimatedCookie_Shader.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2004_AnimatedCookie/AnimatedCookie_Shader.shader @@ -22,7 +22,7 @@ Shader "HDRenderPipeline/GraphicTests/2004_AnimatedCookie_AnimMat" float4 _Color; sampler2D _Tex; - float4 frag(v2f_customrendertexture IN) : COLOR + float4 frag(v2f_customrendertexture IN) : SV_Target { float f = _Time.y % 3; diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2004_AnimatedCookie/AnimatedCookie_Shader2.shader b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2004_AnimatedCookie/AnimatedCookie_Shader2.shader index 55d73c551bf..a5b406d3613 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2004_AnimatedCookie/AnimatedCookie_Shader2.shader +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2004_AnimatedCookie/AnimatedCookie_Shader2.shader @@ -129,7 +129,7 @@ Shader "HDRenderPipeline/GraphicTests/2004_AnimatedCookie_AnimMat2" if (_StarsAnim[frame*STAR_COL*STAR_ROW + uv.y*STAR_ROW +uv.x]) c = 1; } - float4 frag(v2f_customrendertexture IN) : COLOR + float4 frag(v2f_customrendertexture IN) : SV_Target { float4 c = float4(12.0/255.0, 65.0/255.0, 121.0/255.0, 1); // background color diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 98009c25eda..0840c6aad37 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Replaced calls to deprecated PlayerSettings.virtualRealitySupported property. - Enable RWTexture2D, RWTexture2DArray, RWTexture3D in gles 3.1 - Updated macros to be compatible with the new shader preprocessor. +- Updated shaders to be compatible with Microsoft's DXC. ## [7.1.1] - 2019-09-05 diff --git a/com.unity.render-pipelines.core/Editor/LookDev/Compositor.shader b/com.unity.render-pipelines.core/Editor/LookDev/Compositor.shader index 9bece36d382..82eee388d92 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/Compositor.shader +++ b/com.unity.render-pipelines.core/Editor/LookDev/Compositor.shader @@ -391,7 +391,7 @@ Shader "Hidden/LookDev/Compositor" #pragma target 3.0 float4 frag(float2 texcoord : TEXCOORD0, - UNITY_VPOS_TYPE vpos : VPOS) : COLOR + UNITY_VPOS_TYPE vpos : VPOS) : SV_Target { float4 color = float4(ComputeColor(_Tex0MainView, _Tex0Shadows, ShadowMultiplier0, _ShadowColor0, texcoord) * exp2(ExposureValue1), 1.0); color.rgb = ApplyToneMap(color.rgb); @@ -409,7 +409,7 @@ Shader "Hidden/LookDev/Compositor" #pragma target 3.0 float4 frag(float2 texcoord : TEXCOORD0, - UNITY_VPOS_TYPE vpos : VPOS) : COLOR + UNITY_VPOS_TYPE vpos : VPOS) : SV_Target { float4 color = float4(ComputeColor(_Tex1MainView, _Tex1Shadows, ShadowMultiplier1, _ShadowColor1, texcoord) * exp2(ExposureValue2), 1.0); color.rgb = ApplyToneMap(color.rgb); @@ -427,7 +427,7 @@ Shader "Hidden/LookDev/Compositor" #pragma target 3.0 float4 frag(float2 texcoord : TEXCOORD0, - UNITY_VPOS_TYPE vpos : VPOS) : COLOR + UNITY_VPOS_TYPE vpos : VPOS) : SV_Target { float3 color1 = ComputeColor(_Tex0MainView, _Tex0Shadows, ShadowMultiplier0, _ShadowColor0, texcoord) * exp2(ExposureValue1); float3 color2 = ComputeColor(_Tex1MainView, _Tex1Shadows, ShadowMultiplier1, _ShadowColor1, texcoord) * exp2(ExposureValue2); diff --git a/com.unity.render-pipelines.core/Editor/LookDev/CubeToLatlong.shader b/com.unity.render-pipelines.core/Editor/LookDev/CubeToLatlong.shader index 4cbadcce9ca..7921a02520a 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/CubeToLatlong.shader +++ b/com.unity.render-pipelines.core/Editor/LookDev/CubeToLatlong.shader @@ -45,7 +45,7 @@ Shader "Hidden/LookDev/CubeToLatlong" float4 frag( float2 texcoord : TEXCOORD0, UNITY_VPOS_TYPE vpos : VPOS - ) : COLOR + ) : SV_Target { float2 texCoord = texcoord.xy; float theta = texCoord.y * UNITY_PI; diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl index ee23fcfc54a..7c5fc3d3523 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl @@ -199,8 +199,8 @@ #define LODDitheringTransition ERROR_ON_UNSUPPORTED_FUNCTION(LODDitheringTransition) #endif -// On everything but GCN consoles we error on cross-lane operations -#ifndef PLATFORM_SUPPORTS_WAVE_INTRINSICS +// On everything but GCN consoles or DXC compiled shaders we error on cross-lane operations +#if !defined(PLATFORM_SUPPORTS_WAVE_INTRINSICS) && !defined(UNITY_COMPILER_DXC) #define WaveActiveAllTrue ERROR_ON_UNSUPPORTED_FUNCTION(WaveActiveAllTrue) #define WaveActiveAnyTrue ERROR_ON_UNSUPPORTED_FUNCTION(WaveActiveAnyTrue) #define WaveGetLaneIndex ERROR_ON_UNSUPPORTED_FUNCTION(WaveGetLaneIndex) @@ -701,6 +701,48 @@ uint GetMipCount(Texture2D tex) // Texture format sampling // ---------------------------------------------------------------------------- +// DXC no longer supports DX9-style HLSL syntax for sampler2D, tex2D and the like. +// These are emulated for backwards compatibilit using our own small structs and functions which manually combine samplers and textures. +#if defined(UNITY_COMPILER_DXC) && !defined(DXC_SAMPLER_COMPATIBILITY) +#define DXC_SAMPLER_COMPATIBILITY 1 +struct sampler1D { Texture1D t; SamplerState s; }; +struct sampler2D { Texture2D t; SamplerState s; }; +struct sampler3D { Texture3D t; SamplerState s; }; +struct samplerCUBE { TextureCube t; SamplerState s; }; + +float4 tex1D(sampler1D x, float v) { return x.t.Sample(x.s, v); } +float4 tex2D(sampler2D x, float2 v) { return x.t.Sample(x.s, v); } +float4 tex3D(sampler3D x, float3 v) { return x.t.Sample(x.s, v); } +float4 texCUBE(samplerCUBE x, float3 v) { return x.t.Sample(x.s, v); } + +float4 tex1Dbias(sampler1D x, in float4 t) { return x.t.SampleBias(x.s, t.x, t.w); } +float4 tex2Dbias(sampler2D x, in float4 t) { return x.t.SampleBias(x.s, t.xy, t.w); } +float4 tex3Dbias(sampler3D x, in float4 t) { return x.t.SampleBias(x.s, t.xyz, t.w); } +float4 texCUBEbias(samplerCUBE x, in float4 t) { return x.t.SampleBias(x.s, t.xyz, t.w); } + +float4 tex1Dlod(sampler1D x, in float4 t) { return x.t.SampleLevel(x.s, t.x, t.w); } +float4 tex2Dlod(sampler2D x, in float4 t) { return x.t.SampleLevel(x.s, t.xy, t.w); } +float4 tex3Dlod(sampler3D x, in float4 t) { return x.t.SampleLevel(x.s, t.xyz, t.w); } +float4 texCUBElod(samplerCUBE x, in float4 t) { return x.t.SampleLevel(x.s, t.xyz, t.w); } + +float4 tex1Dgrad(sampler1D x, float t, float dx, float dy) { return x.t.SampleGrad(x.s, t, dx, dy); } +float4 tex2Dgrad(sampler2D x, float2 t, float2 dx, float2 dy) { return x.t.SampleGrad(x.s, t, dx, dy); } +float4 tex3Dgrad(sampler3D x, float3 t, float3 dx, float3 dy) { return x.t.SampleGrad(x.s, t, dx, dy); } +float4 texCUBEgrad(samplerCUBE x, float3 t, float3 dx, float3 dy) { return x.t.SampleGrad(x.s, t, dx, dy); } + +float4 tex1D(sampler1D x, float t, float dx, float dy) { return x.t.SampleGrad(x.s, t, dx, dy); } +float4 tex2D(sampler2D x, float2 t, float2 dx, float2 dy) { return x.t.SampleGrad(x.s, t, dx, dy); } +float4 tex3D(sampler3D x, float3 t, float3 dx, float3 dy) { return x.t.SampleGrad(x.s, t, dx, dy); } +float4 texCUBE(samplerCUBE x, float3 t, float3 dx, float3 dy) { return x.t.SampleGrad(x.s, t, dx, dy); } + +float4 tex1Dproj(sampler1D s, in float2 t) { return tex1D(s, t.x / t.y); } +float4 tex1Dproj(sampler1D s, in float4 t) { return tex1D(s, t.x / t.w); } +float4 tex2Dproj(sampler2D s, in float3 t) { return tex2D(s, t.xy / t.z); } +float4 tex2Dproj(sampler2D s, in float4 t) { return tex2D(s, t.xy / t.w); } +float4 tex3Dproj(sampler3D s, in float4 t) { return tex3D(s, t.xyz / t.w); } +float4 texCUBEproj(samplerCUBE s, in float4 t) { return texCUBE(s, t.xyz / t.w); } +#endif + float2 DirectionToLatLongCoordinate(float3 unDir) { float3 dir = normalize(unDir); diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 078e562081b..11372fc7c22 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -506,6 +506,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix for issue that prevented scene from being completely saved when baked reflection probes are present and lighting is set to auto generate. - Fixed drag area width at left of Light's intensity field in Inspector. - Fixed light type resolution when performing a reset on HDAdditionalLightData (case 1220931) +- Fixed reliance on atan2 undefined behavior in motion vector debug shader. ### Changed - Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled @@ -614,6 +615,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Temporal Anti aliasing improvements. - Optimized PrepareLightsForGPU (cost reduced by over 25%) and PrepareGPULightData (around twice as fast now). - Moved scene view camera settings for HDRP from the preferences window to the scene view camera settings window. +- Updated shaders to be compatible with Microsoft's DXC. ## [7.1.1] - 2019-09-05 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugFullScreen.shader b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugFullScreen.shader index 749276a6073..a6ad34ffcbc 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugFullScreen.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugFullScreen.shader @@ -241,6 +241,11 @@ Shader "Hidden/HDRP/DebugFullScreen" d = 1.0 - saturate(d); } + // Explicitly handling the case where mv == float2(0, 0) as atan2(mv.x, mv.y) above would be atan2(0,0) which + // is undefined and in practice can be incosistent between compilers (e.g. NaN on FXC and ~pi/2 on DXC) + if(!any(mv)) + color = float3(0, 0, 0); + return float4(color + d.xxx, 1.0); } if (_FullScreenDebugMode == FULLSCREENDEBUGMODE_COLOR_LOG) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl index dfea286cb2d..be2bdb5cbeb 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl @@ -204,7 +204,7 @@ DecalSurfaceData GetDecalSurfaceData(PositionInputs posInput, inout float alpha) { uint mask = 0; // the code in the macros, gets moved inside the conditionals by the compiler - FETCH_DBUFFER(DBuffer, _DBufferTexture, posInput.positionSS); + FETCH_DBUFFER(DBuffer, _DBufferTexture, int2(posInput.positionSS.xy)); #if defined(_SURFACE_TYPE_TRANSPARENT) && defined(HAS_LIGHTLOOP) // forward transparent using clustered decals uint decalCount, decalStart; @@ -258,7 +258,7 @@ DecalSurfaceData GetDecalSurfaceData(PositionInputs posInput, inout float alpha) if (!fastPath) { - // If we are not in fast path, v_lightIdx is not scalar, so we need to query the Min value across the wave. + // If we are not in fast path, v_lightIdx is not scalar, so we need to query the Min value across the wave. s_decalIdx = WaveActiveMin(v_decalIdx); // If WaveActiveMin returns 0xffffffff it means that all lanes are actually dead, so we can safely ignore the loop and move forward. // This could happen as an helper lane could reach this point, hence having a valid v_lightIdx, but their values will be ignored by the WaveActiveMin diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/ShaderVariablesDecal.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/ShaderVariablesDecal.hlsl index d5210169a42..de886e269cc 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/ShaderVariablesDecal.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/ShaderVariablesDecal.hlsl @@ -10,7 +10,7 @@ TEXTURE2D(_DecalAtlas2D); SAMPLER(_trilinear_clamp_sampler_DecalAtlas2D); #ifdef PLATFORM_SUPPORTS_BUFFER_ATOMICS_IN_PIXEL_SHADER -RWStructuredBuffer _DecalPropertyMaskBuffer; +RWStructuredBuffer _DecalPropertyMaskBuffer : register(u4); StructuredBuffer _DecalPropertyMaskBufferSRV; #endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl index 74e704ede68..587c979266f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl @@ -1791,9 +1791,9 @@ IndirectLighting EvaluateBSDF_ScreenspaceRefraction(LightLoopContext lightLoopCo refractionOffsetMultiplier *= (hitLinearDepth > posInput.linearDepth); float2 samplingPositionNDC = lerp(posInput.positionNDC, hit.positionNDC, refractionOffsetMultiplier); - float3 preLD = SAMPLE_TEXTURE2D_X_LOD(_ColorPyramidTexture, s_trilinear_clamp_sampler, - // Offset by half a texel to properly interpolate between this pixel and its mips + float3 preLD = SAMPLE_TEXTURE2D_X_LOD(_ColorPyramidTexture, s_trilinear_clamp_sampler, \ samplingPositionNDC * _ColorPyramidScale.xy, preLightData.transparentSSMipLevel).rgb; + // Offset by half a texel to properly interpolate between this pixel and its mips // Inverse pre-exposure preLD *= GetInverseCurrentExposureMultiplier(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader index 7d17757f981..6ab2c6ba83c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntiAliasing.shader @@ -75,7 +75,7 @@ Shader "Hidden/HDRP/TemporalAA" TEXTURE2D_X(_DepthTexture); TEXTURE2D_X(_InputTexture); TEXTURE2D_X(_InputHistoryTexture); - RW_TEXTURE2D_X(CTYPE, _OutputHistoryTexture); + RW_TEXTURE2D_X(CTYPE, _OutputHistoryTexture) : register(u1); #define _HistorySharpening _TaaPostParameters.x diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ResolveStencilBuffer.compute b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ResolveStencilBuffer.compute index 2c2d60ab795..89c740ed8a5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ResolveStencilBuffer.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ResolveStencilBuffer.compute @@ -84,9 +84,13 @@ void KERNEL_NAME(uint3 groupId : SV_GroupID, #endif + //This temp is needed outside the if(isFirstThread) condition to workaround a DXC DXIL codegen + // issue https://github.com/microsoft/DirectXShaderCompiler/issues/2743 until it's fixed + uint perThreadCoarseStencilValue = coarseStencilValue; + if (isFirstThread) { uint addressIndex = Get1DAddressFromPixelCoord(groupId.xy, _CoarseStencilBufferSize.xy, groupId.z); - _CoarseStencilBuffer[addressIndex] = coarseStencilValue; + _CoarseStencilBuffer[addressIndex] = perThreadCoarseStencilValue; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl index b1981b88d7f..556accc54e7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl @@ -63,7 +63,8 @@ #define TEXTURE2D_X_UINT(textureName) Texture2DArray textureName #define TEXTURE2D_X_UINT2(textureName) Texture2DArray textureName #define TEXTURE2D_X_UINT4(textureName) Texture2DArray textureName - #define TEXTURE2D_X_MSAA(type, textureName) Texture2DMSArray textureName + //Using explicit sample count of 1 to force DXC to actually reflect the texture as MS. The actual count appears to be irrelevant and any 2D MS texture array should bind to it + #define TEXTURE2D_X_MSAA(type, textureName) Texture2DMSArray textureName #define RW_TEXTURE2D_X(type, textureName) RW_TEXTURE2D_ARRAY(type, textureName) #define LOAD_TEXTURE2D_X(textureName, unCoord2) LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, SLICE_ARRAY_INDEX) @@ -90,7 +91,8 @@ #define TEXTURE2D_X_UINT(textureName) Texture2D textureName #define TEXTURE2D_X_UINT2(textureName) Texture2D textureName #define TEXTURE2D_X_UINT4(textureName) Texture2D textureName - #define TEXTURE2D_X_MSAA(type, textureName) Texture2DMS textureName + //Using explicit sample count of 1 to force DXC to actually reflect the texture as MS. The actual count appears to be irrelevant and any 2D MS texture should bind to it + #define TEXTURE2D_X_MSAA(type, textureName) Texture2DMS textureName #define RW_TEXTURE2D_X RW_TEXTURE2D #define LOAD_TEXTURE2D_X LOAD_TEXTURE2D diff --git a/com.unity.render-pipelines.universal/CHANGELOG.md b/com.unity.render-pipelines.universal/CHANGELOG.md index 399c24e9053..4da84c4ee1e 100644 --- a/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/com.unity.render-pipelines.universal/CHANGELOG.md @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - URP shaders that contain a priority slider now no longer have an offset of 50 by default. - The virtual ScriptableRenderer.FrameCleanup() function has been marked obsolete and replaced by ScriptableRenderer.OnCameraCleanup() to better describe when the function gets invoked by the renderer. - DepthOnlyPass, CopyDepthPass and CopyColorPass now use OnCameraSetup() instead of Configure() to set up their passes before executing as they only need to get their rendertextures once per camera instead of once per eye. +- Updated shaders to be compatible with Microsoft's DXC. ### Fixed - Fixed an issue where linear to sRGB conversion occurred twice on certain Android devices. diff --git a/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl b/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl index 53f39c98818..e03ccd3e8e9 100644 --- a/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl +++ b/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl @@ -51,11 +51,8 @@ half4 MetaFragment(MetaInput input) { res = half4(input.Albedo, 1.0); - // d3d9 shader compiler doesn't like NaNs and infinity. - unity_OneOverOutputBoost = saturate(unity_OneOverOutputBoost); - // Apply Albedo Boost from LightmapSettings. - res.rgb = clamp(PositivePow(res.rgb, unity_OneOverOutputBoost), 0, unity_MaxOutputValue); + res.rgb = clamp(PositivePow(res.rgb, saturate(unity_OneOverOutputBoost)), 0, unity_MaxOutputValue); } if (unity_MetaFragmentControl.y) { diff --git a/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree7Input.hlsl b/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree7Input.hlsl index 7331734767a..84b4ac56537 100644 --- a/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree7Input.hlsl +++ b/com.unity.render-pipelines.universal/Shaders/Nature/SpeedTree7Input.hlsl @@ -7,9 +7,6 @@ #define GEOM_TYPE_BRANCH #endif -#ifdef GEOM_TYPE_BRANCH_DETAIL - sampler2D _DetailTex; -#endif #if defined(GEOM_TYPE_FROND) || defined(GEOM_TYPE_LEAF) || defined(GEOM_TYPE_FACING_LEAF) #define SPEEDTREE_ALPHATEST @@ -23,4 +20,8 @@ #include "SpeedTree7CommonInput.hlsl" +#ifdef GEOM_TYPE_BRANCH_DETAIL + sampler2D _DetailTex; +#endif + #endif diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 56a3c917881..aed58e04656 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Changed the `Branch` node so that it uses a ternary operator (`Out = bool ? a : B`) instead of a linear interpolate function. - Copied nodes are now pasted at the cursor location instead of slightly offset from their original location - Error messages reported on Sub Graph output nodes for invalid previews now present clearer information, with documentation support. +- Updated legacy COLOR output semantic to SV_Target in pixel shader for compatibility with DXC ### Fixed - Edges no longer produce errors when you save a Shader Graph. diff --git a/com.unity.shadergraph/Editor/Resources/Shaders/Checkerboard.shader b/com.unity.shadergraph/Editor/Resources/Shaders/Checkerboard.shader index f5c457b2419..e090fbd9461 100644 --- a/com.unity.shadergraph/Editor/Resources/Shaders/Checkerboard.shader +++ b/com.unity.shadergraph/Editor/Resources/Shaders/Checkerboard.shader @@ -16,7 +16,7 @@ Shader "Hidden/Checkerboard" static const float rows = 24; static const float columns = 24; - float4 frag(v2f_img i) : COLOR + float4 frag(v2f_img i) : SV_Target { float3 col1 = float3(32.0/255.0, 32.0/255.0, 32.0/255.0); float3 col2 = float3(42.0/255.0, 42.0/255.0, 42.0/255.0); diff --git a/com.unity.testing.hdrp/Shaders/DistordFromTex.shader b/com.unity.testing.hdrp/Shaders/DistordFromTex.shader index 252e9b41165..7091ef3b490 100644 --- a/com.unity.testing.hdrp/Shaders/DistordFromTex.shader +++ b/com.unity.testing.hdrp/Shaders/DistordFromTex.shader @@ -22,7 +22,7 @@ Shader "Hidden/DistordFromTex" sampler2D _Tex; float _Scale, _Bias; - float4 frag(v2f_customrendertexture IN) : COLOR + float4 frag(v2f_customrendertexture IN) : SV_Target { float4 c = float4(0,0,0,0); diff --git a/com.unity.testing.hdrp/Shaders/DistordTest.shader b/com.unity.testing.hdrp/Shaders/DistordTest.shader index 9274bd908e0..8c90b129649 100644 --- a/com.unity.testing.hdrp/Shaders/DistordTest.shader +++ b/com.unity.testing.hdrp/Shaders/DistordTest.shader @@ -18,7 +18,7 @@ Shader "Hidden/DistordTest" #define CENTER 0.15 - float4 frag(v2f_customrendertexture IN) : COLOR + float4 frag(v2f_customrendertexture IN) : SV_Target { float4 col = float4(0,0,0,1);