|
|
|
@ -240,11 +240,6 @@ typedef int4 FfxInt32x4; |
|
|
|
|
|
|
|
#endif // #if defined(FFXM_HLSL_6_2) |
|
|
|
|
|
|
|
// Arm ASR relies in efficient FP16 arithmetic. |
|
|
|
#if !defined(FFXM_HALF) |
|
|
|
#define FFXM_HALF (1) |
|
|
|
#endif |
|
|
|
|
|
|
|
#if FFXM_HALF |
|
|
|
|
|
|
|
#if FFXM_HLSL_6_2 |
|
|
|
@ -269,6 +264,29 @@ typedef int16_t FfxInt16; |
|
|
|
typedef int16_t2 FfxInt16x2; |
|
|
|
typedef int16_t3 FfxInt16x3; |
|
|
|
typedef int16_t4 FfxInt16x4; |
|
|
|
#elif SHADER_API_PSSL |
|
|
|
#pragma argument(realtypes) // Enable true 16-bit types |
|
|
|
|
|
|
|
typedef half FfxFloat16; |
|
|
|
typedef half2 FfxFloat16x2; |
|
|
|
typedef half3 FfxFloat16x3; |
|
|
|
typedef half4 FfxFloat16x4; |
|
|
|
|
|
|
|
/// A typedef for an unsigned 16bit integer. |
|
|
|
/// |
|
|
|
/// @ingroup GPU |
|
|
|
typedef ushort FfxUInt16; |
|
|
|
typedef ushort2 FfxUInt16x2; |
|
|
|
typedef ushort3 FfxUInt16x3; |
|
|
|
typedef ushort4 FfxUInt16x4; |
|
|
|
|
|
|
|
/// A typedef for a signed 16bit integer. |
|
|
|
/// |
|
|
|
/// @ingroup GPU |
|
|
|
typedef short FfxInt16; |
|
|
|
typedef short2 FfxInt16x2; |
|
|
|
typedef short3 FfxInt16x3; |
|
|
|
typedef short4 FfxInt16x4; |
|
|
|
#else // #if FFXM_HLSL_6_2 |
|
|
|
typedef min16float FfxFloat16; |
|
|
|
typedef min16float2 FfxFloat16x2; |
|
|
|
@ -340,7 +358,7 @@ typedef min16int4 FfxInt16x4; |
|
|
|
#endif // #if defined(FFXM_GLSL) |
|
|
|
|
|
|
|
|
|
|
|
#if FFXM_HALF |
|
|
|
#if FFXM_HALF && !defined(SHADER_API_PSSL) |
|
|
|
|
|
|
|
#if FFXM_HLSL_6_2 |
|
|
|
|
|
|
|
@ -378,7 +396,7 @@ typedef min16int4 FfxInt16x4; |
|
|
|
|
|
|
|
#if defined(FFXM_GPU) |
|
|
|
// Common typedefs: |
|
|
|
#if defined(FFXM_HLSL) |
|
|
|
#if defined(FFXM_HLSL) && !defined(SHADER_API_PSSL) |
|
|
|
FFXM_MIN16_SCALAR( FFXM_MIN16_F , float ); |
|
|
|
FFXM_MIN16_VECTOR( FFXM_MIN16_F2, float, 2 ); |
|
|
|
FFXM_MIN16_VECTOR( FFXM_MIN16_F3, float, 3 ); |
|
|
|
@ -452,6 +470,79 @@ typedef FfxUInt32x3 Prefix##_U3; \ |
|
|
|
typedef FfxUInt32x4 Prefix##_U4; |
|
|
|
#endif // #if defined(FFXM_HLSL) |
|
|
|
|
|
|
|
#if defined(SHADER_API_PSSL) |
|
|
|
|
|
|
|
#define unorm |
|
|
|
#define globallycoherent |
|
|
|
|
|
|
|
#if FFX_HALF |
|
|
|
|
|
|
|
#define FFXM_MIN16_F half |
|
|
|
#define FFXM_MIN16_F2 half2 |
|
|
|
#define FFXM_MIN16_F3 half3 |
|
|
|
#define FFXM_MIN16_F4 half4 |
|
|
|
|
|
|
|
#define FFXM_MIN16_I short |
|
|
|
#define FFXM_MIN16_I2 short2 |
|
|
|
#define FFXM_MIN16_I3 short3 |
|
|
|
#define FFXM_MIN16_I4 short4 |
|
|
|
|
|
|
|
#define FFXM_MIN16_U ushort |
|
|
|
#define FFXM_MIN16_U2 ushort2 |
|
|
|
#define FFXM_MIN16_U3 ushort3 |
|
|
|
#define FFXM_MIN16_U4 ushort4 |
|
|
|
|
|
|
|
#define FFXM_16BIT_F half |
|
|
|
#define FFXM_16BIT_F2 half2 |
|
|
|
#define FFXM_16BIT_F3 half3 |
|
|
|
#define FFXM_16BIT_F4 half4 |
|
|
|
|
|
|
|
#define FFXM_16BIT_I short |
|
|
|
#define FFXM_16BIT_I2 short2 |
|
|
|
#define FFXM_16BIT_I3 short3 |
|
|
|
#define FFXM_16BIT_I4 short4 |
|
|
|
|
|
|
|
#define FFXM_16BIT_U ushort |
|
|
|
#define FFXM_16BIT_U2 ushort2 |
|
|
|
#define FFXM_16BIT_U3 ushort3 |
|
|
|
#define FFXM_16BIT_U4 ushort4 |
|
|
|
|
|
|
|
#else // FFX_HALF |
|
|
|
|
|
|
|
#define FFXM_MIN16_F float |
|
|
|
#define FFXM_MIN16_F2 float2 |
|
|
|
#define FFXM_MIN16_F3 float3 |
|
|
|
#define FFXM_MIN16_F4 float4 |
|
|
|
|
|
|
|
#define FFXM_MIN16_I int |
|
|
|
#define FFXM_MIN16_I2 int2 |
|
|
|
#define FFXM_MIN16_I3 int3 |
|
|
|
#define FFXM_MIN16_I4 int4 |
|
|
|
|
|
|
|
#define FFXM_MIN16_U uint |
|
|
|
#define FFXM_MIN16_U2 uint2 |
|
|
|
#define FFXM_MIN16_U3 uint3 |
|
|
|
#define FFXM_MIN16_U4 uint4 |
|
|
|
|
|
|
|
#define FFXM_16BIT_F float |
|
|
|
#define FFXM_16BIT_F2 float2 |
|
|
|
#define FFXM_16BIT_F3 float3 |
|
|
|
#define FFXM_16BIT_F4 float4 |
|
|
|
|
|
|
|
#define FFXM_16BIT_I int |
|
|
|
#define FFXM_16BIT_I2 int2 |
|
|
|
#define FFXM_16BIT_I3 int3 |
|
|
|
#define FFXM_16BIT_I4 int4 |
|
|
|
|
|
|
|
#define FFXM_16BIT_U uint |
|
|
|
#define FFXM_16BIT_U2 uint2 |
|
|
|
#define FFXM_16BIT_U3 uint3 |
|
|
|
#define FFXM_16BIT_U4 uint4 |
|
|
|
|
|
|
|
#endif // FFX_HALF |
|
|
|
|
|
|
|
#endif // #if defined(SHADER_API_PSSL) |
|
|
|
|
|
|
|
#if defined(FFXM_GLSL) |
|
|
|
|
|
|
|
#if FFXM_HALF |
|
|
|
|