|
|
|
|
|
|
#define real3x3 half3x3 |
|
|
|
#define real3x4 half3x4 |
|
|
|
#define real4x3 half4x3 |
|
|
|
#define real4x4 half4x4 |
|
|
|
|
|
|
|
#define half min16float |
|
|
|
#define half2 min16float2 |
|
|
|
#define half3 min16float3 |
|
|
|
#define half4 min16float4 |
|
|
|
|
|
|
|
#define half2x2 min16float2x2 |
|
|
|
#define half2x3 min16float2x3 |
|
|
|
#define half3x2 min16float3x2 |
|
|
|
#define half3x3 min16float3x3 |
|
|
|
#define half3x4 min16float3x4 |
|
|
|
#define half4x3 min16float4x3 |
|
|
|
#define real4x4 half4x4 |
|
|
|
|
|
|
|
#define half min16float |
|
|
|
#define half2 min16float2 |
|
|
|
#define half3 min16float3 |
|
|
|
#define half4 min16float4 |
|
|
|
|
|
|
|
#define half2x2 min16float2x2 |
|
|
|
#define half2x3 min16float2x3 |
|
|
|
#define half3x2 min16float3x2 |
|
|
|
#define half3x3 min16float3x3 |
|
|
|
#define half3x4 min16float3x4 |
|
|
|
#define half4x3 min16float4x3 |
|
|
|
#define half4x4 min16float4x4 |
|
|
|
|
|
|
|
#define REAL_MIN HALF_MIN |
|
|
|
|
|
|
// Texture utilities |
|
|
|
// ---------------------------------------------------------------------------- |
|
|
|
|
|
|
|
float ComputeTextureLOD(float2 uv) |
|
|
|
float ComputeTextureLOD(float2 uvdx, float2 uvdy, float2 scale) |
|
|
|
float2 ddx_ = ddx(uv); |
|
|
|
float2 ddy_ = ddy(uv); |
|
|
|
float2 ddx_ = scale * uvdx; |
|
|
|
float2 ddy_ = scale * uvdy; |
|
|
|
|
|
|
|
float ComputeTextureLOD(float2 uv) |
|
|
|
{ |
|
|
|
float2 ddx_ = ddx(uv); |
|
|
|
float2 ddy_ = ddy(uv); |
|
|
|
|
|
|
|
return ComputeTextureLOD(ddx_, ddy_, 1.0); |
|
|
|
} |
|
|
|
|
|
|
|
// x contains width, w contains height |
|
|
|
float ComputeTextureLOD(float2 uv, float2 texelSize) |
|
|
|