Skip to content

Commit 124e662

Browse files
author
Antti Tapaninen
committed
Merge branch 'master' into metal
2 parents 00cfa72 + 553b358 commit 124e662

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Assets/ScriptableRenderPipeline/ShaderLibrary/SampleUVMappingInternal.hlsl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,27 @@ float4 ADD_FUNC_SUFFIX(SampleUVMapping)(TEXTURE2D_ARGS(textureName, samplerName)
3131
// TODO: Handle BC5 format, currently this code is for DXT5nm - After the change, rename this function UnpackNormalmapRGorAG
3232
// This version is use for the base normal map
3333
#define ADD_NORMAL_FUNC_SUFFIX(Name) Name
34+
#if defined(UNITY_NO_DXT5nm)
35+
#define UNPACK_NORMAL_FUNC UnpackNormalRGB
36+
#define UNPACK_DERIVATIVE_FUNC UnpackDerivativeNormalRGB
37+
#else
3438
#define UNPACK_NORMAL_FUNC UnpackNormalAG
3539
#define UNPACK_DERIVATIVE_FUNC UnpackDerivativeNormalAG
40+
#endif
3641
#include "SampleUVMappingNormalInternal.hlsl"
3742
#undef ADD_NORMAL_FUNC_SUFFIX
3843
#undef UNPACK_NORMAL_FUNC
3944
#undef UNPACK_DERIVATIVE_FUNC
4045

4146
// This version is for normalmap with AG encoding only. Mainly use with details map.
4247
#define ADD_NORMAL_FUNC_SUFFIX(Name) Name##AG
48+
#if defined(UNITY_NO_DXT5nm)
49+
#define UNPACK_NORMAL_FUNC UnpackNormalRGB
50+
#define UNPACK_DERIVATIVE_FUNC UnpackDerivativeNormalRGB
51+
#else
4352
#define UNPACK_NORMAL_FUNC UnpackNormalAG
4453
#define UNPACK_DERIVATIVE_FUNC UnpackDerivativeNormalAG
54+
#endif
4555
#include "SampleUVMappingNormalInternal.hlsl"
4656
#undef ADD_NORMAL_FUNC_SUFFIX
4757
#undef UNPACK_NORMAL_FUNC

0 commit comments

Comments
 (0)