|
|
|
|
|
|
#define CUBEMAPFACE_POSITIVE_Z 4 |
|
|
|
#define CUBEMAPFACE_NEGATIVE_Z 5 |
|
|
|
|
|
|
|
// The function of the shader library are stateless, no uniform decalare in it. |
|
|
|
// Any function that require an explicit precision, use float or half qualifier, when the function can support both, it use real (see below) |
|
|
|
// If a function require to have both a half and a float version, then both need to be explicitly define |
|
|
|
#ifndef real |
|
|
|
|
|
|
|
#ifdef SHADER_API_MOBILE |
|
|
|
#define real half |
|
|
|
#define real2 half2 |
|
|
|
#define real3 half3 |
|
|
|
#define real4 half4 |
|
|
|
|
|
|
|
#define real2x2 half2x2 |
|
|
|
#define real2x3 half2x3 |
|
|
|
#define real3x2 half3x2 |
|
|
|
#define real3x3 half3x3 |
|
|
|
#define real3x4 half3x4 |
|
|
|
#define real4x3 half4x3 |
|
|
|
#define real4x4 half4x4 |
|
|
|
|
|
|
|
#define REAL_MIN HALF_MIN |
|
|
|
#define REAL_MAX HALF_MAX |
|
|
|
#define TEMPLATE_1_REAL TEMPLATE_1_HALF |
|
|
|
#define TEMPLATE_2_REAL TEMPLATE_2_HALF |
|
|
|
#define TEMPLATE_3_REAL TEMPLATE_3_HALF |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
#define real float |
|
|
|
#define real2 float2 |
|
|
|
#define real3 float3 |
|
|
|
#define real4 float4 |
|
|
|
|
|
|
|
#define real2x2 float2x2 |
|
|
|
#define real2x3 float2x3 |
|
|
|
#define real3x2 float3x2 |
|
|
|
#define real3x3 float3x3 |
|
|
|
#define real3x4 float3x4 |
|
|
|
#define real4x3 float4x3 |
|
|
|
#define real4x4 float4x4 |
|
|
|
|
|
|
|
#define REAL_MIN FLT_MIN |
|
|
|
#define REAL_MAX FLT_MAX |
|
|
|
#define TEMPLATE_1_REAL TEMPLATE_1_FLT |
|
|
|
#define TEMPLATE_2_REAL TEMPLATE_2_FLT |
|
|
|
#define TEMPLATE_3_REAL TEMPLATE_3_FLT |
|
|
|
|
|
|
|
#endif // SHADER_API_MOBILE |
|
|
|
|
|
|
|
#endif // #ifndef real |
|
|
|
|
|
|
|
#if defined(SHADER_API_D3D11) |
|
|
|
# include "CoreRP/ShaderLibrary/API/D3D11.hlsl" |
|
|
|
#elif defined(SHADER_API_PSSL) |
|
|
|