Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily disabled warnings in Core shader library for gles platforms. #3931

Merged
merged 2 commits into from Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl
@@ -1,6 +1,8 @@
#ifndef __ACES__
#define __ACES__

#pragma warning (disable : 3205) // conversion of larger type to smaller

/**
* https://github.com/ampas/aces-dev
*
Expand Down Expand Up @@ -1316,4 +1318,6 @@ half3 ODT_P3DCI_48nits(half3 oces)
return outputCV;
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // __ACES__
5 changes: 5 additions & 0 deletions com.unity.render-pipelines.core/ShaderLibrary/BSDF.hlsl
@@ -1,6 +1,8 @@
#ifndef UNITY_BSDF_INCLUDED
#define UNITY_BSDF_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"

// Note: All NDF and diffuse term have a version with and without divide by PI.
Expand Down Expand Up @@ -637,4 +639,7 @@ real3 D_KajiyaKay(real3 T, real3 H, real specularExponent)

return dirAttn * norm * PositivePow(sinTHSq, 0.5 * n);
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_BSDF_INCLUDED
4 changes: 4 additions & 0 deletions com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl
@@ -1,6 +1,8 @@
#ifndef UNITY_COLOR_INCLUDED
#define UNITY_COLOR_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl"

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -732,4 +734,6 @@ half3 DecodeRGBM(half4 rgbm)
return rgbm.xyz * rgbm.w * kRGBMRange;
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_COLOR_INCLUDED
4 changes: 4 additions & 0 deletions com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl
@@ -1,6 +1,8 @@
#ifndef UNITY_COMMON_INCLUDED
#define UNITY_COMMON_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller
JulienIgnace-Unity marked this conversation as resolved.
Show resolved Hide resolved

// Convention:

// Unity is Y up and left handed in world space
Expand Down Expand Up @@ -1351,4 +1353,6 @@ float SharpenAlpha(float alpha, float alphaClipTreshold)
// These clamping function to max of floating point 16 bit are use to prevent INF in code in case of extreme value
TEMPLATE_1_REAL(ClampToFloat16Max, value, return min(value, HALF_MAX))

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_COMMON_INCLUDED
@@ -1,6 +1,8 @@
#ifndef UNITY_COMMON_LIGHTING_INCLUDED
#define UNITY_COMMON_LIGHTING_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

// Ligthing convention
// Light direction is oriented backward (-Z). i.e in shader code, light direction is -lightData.forward

Expand Down Expand Up @@ -455,4 +457,6 @@ bool IsMatchingLightLayer(uint lightLayers, uint renderingLayers)
return (lightLayers & renderingLayers) != 0;
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_COMMON_LIGHTING_INCLUDED
@@ -1,6 +1,8 @@
#ifndef UNITY_COMMON_MATERIAL_INCLUDED
#define UNITY_COMMON_MATERIAL_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

//-----------------------------------------------------------------------------
// Define constants
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -329,4 +331,7 @@ real3 LerpWhiteTo(real3 b, real t)
real oneMinusT = 1.0 - t;
return real3(oneMinusT, oneMinusT, oneMinusT) + b * t;
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_COMMON_MATERIAL_INCLUDED
@@ -1,6 +1,8 @@
#ifndef UNITY_ENTITY_LIGHTING_INCLUDED
#define UNITY_ENTITY_LIGHTING_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"

Expand Down Expand Up @@ -365,5 +367,6 @@ real3 SampleDirectionalLightmap(TEXTURE2D_LIGHTMAP_PARAM(lightmapTex, lightmapSa
return bakeDiffuseLighting;
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_ENTITY_LIGHTING_INCLUDED
@@ -1,6 +1,8 @@
#ifndef UNITY_IMAGE_BASED_LIGHTING_INCLUDED
#define UNITY_IMAGE_BASED_LIGHTING_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/BSDF.hlsl"
Expand Down Expand Up @@ -738,4 +740,6 @@ float InfluenceFadeNormalWeight(float3 normal, float3 centerToPos)
return saturate((-1.0f / 0.4f) * dot(normal, centerToPos) + (0.6f / 0.4f));
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_IMAGE_BASED_LIGHTING_INCLUDED
4 changes: 4 additions & 0 deletions com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl
@@ -1,6 +1,8 @@
#ifndef UNITY_PACKING_INCLUDED
#define UNITY_PACKING_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

//-----------------------------------------------------------------------------
// Normal packing
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -581,4 +583,6 @@ float2 Unpack8ToFloat2(float f)
return float2(x, y);
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_PACKING_INCLUDED
@@ -1,6 +1,8 @@
#ifndef UNITY_FIBONACCI_INCLUDED
#define UNITY_FIBONACCI_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

// Computes a point using the Fibonacci sequence of length N.
// Input: Fib[N - 1], Fib[N - 2], and the index 'i' of the point.
// Ref: Efficient Quadrature Rules for Illumination Integrals
Expand Down Expand Up @@ -295,4 +297,6 @@ real2 SampleSphereFibonacci(uint i, uint sampleCount)
return real2(1 - 2 * f.x, TWO_PI * f.y);
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_FIBONACCI_INCLUDED
@@ -1,6 +1,8 @@
#ifndef UNITY_HAMMERSLEY_INCLUDED
#define UNITY_HAMMERSLEY_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

// Ref: http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html
uint ReverseBits32(uint bits)
{
Expand Down Expand Up @@ -420,4 +422,6 @@ real2 Hammersley2d(uint i, uint sampleCount)
}
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_HAMMERSLEY_INCLUDED
@@ -1,6 +1,8 @@
#ifndef UNITY_SAMPLING_INCLUDED
#define UNITY_SAMPLING_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

//-----------------------------------------------------------------------------
// Sample generator
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -305,4 +307,6 @@ void SampleCone(real2 u, real cosHalfAngle,
rcpPdf = TWO_PI * (1 - cosHalfAngle);
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif // UNITY_SAMPLING_INCLUDED
@@ -1,6 +1,8 @@
#ifndef UNITY_SPACE_TRANSFORMS_INCLUDED
#define UNITY_SPACE_TRANSFORMS_INCLUDED

#pragma warning (disable : 3205) // conversion of larger type to smaller

// Caution: For HDRP, adding a function in this file requires adding the appropriate #define in PickingSpaceTransforms.hlsl

// Return the PreTranslated ObjectToWorld Matrix (i.e matrix with _WorldSpaceCameraPos apply to it if we use camera relative rendering)
Expand Down Expand Up @@ -236,4 +238,6 @@ real3 TransformObjectToTangent(real3 dirOS, real3x3 tangentToWorld)
return TransformWorldToTangent(normalWS, tangentToWorld);
}

#pragma warning (enable : 3205) // conversion of larger type to smaller

#endif