Skip to content

Commit

Permalink
AGS 5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rys Sommefeldt committed May 23, 2018
1 parent 35fba69 commit 598ba9f
Show file tree
Hide file tree
Showing 24 changed files with 392 additions and 390 deletions.
Binary file modified ags_lib/doc/amd_ags.chm
Binary file not shown.
116 changes: 2 additions & 114 deletions ags_lib/hlsl/ags_shader_intrinsics_dx11.hlsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -65,12 +65,8 @@
#define AmdDxExtShaderIntrinsicsOpcode_Swizzle 0x04
#define AmdDxExtShaderIntrinsicsOpcode_Ballot 0x05
#define AmdDxExtShaderIntrinsicsOpcode_MBCnt 0x06
#define AmdDxExtShaderIntrinsicsOpcode_Min3U 0x08
#define AmdDxExtShaderIntrinsicsOpcode_Min3F 0x09
#define AmdDxExtShaderIntrinsicsOpcode_Med3U 0x0a
#define AmdDxExtShaderIntrinsicsOpcode_Med3F 0x0b
#define AmdDxExtShaderIntrinsicsOpcode_Max3U 0x0c
#define AmdDxExtShaderIntrinsicsOpcode_Max3F 0x0d
#define AmdDxExtShaderIntrinsicsOpcode_BaryCoord 0x0e
#define AmdDxExtShaderIntrinsicsOpcode_VtxParam 0x0f
#define AmdDxExtShaderIntrinsicsOpCode_ViewportIndex 0x10
Expand Down Expand Up @@ -503,60 +499,6 @@ uint AmdDxExtShaderIntrinsics_MBCnt(uint2 src)
return retVal;
}

/**
*************************************************************************************************************
* AmdDxExtShaderIntrinsics_Min3F
*
* Returns the minimum value of the three floating point source arguments.
*
* Available if CheckSupport(AmdDxExtShaderIntrinsicsSupport_Compare3) returned S_OK.
*
*************************************************************************************************************
*/
float AmdDxExtShaderIntrinsics_Min3F(float src0, float src1, float src2)
{
uint minimum;

uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Min3F,
AmdDxExtShaderIntrinsicsOpcodePhase_0,
0);
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, asuint(src0), asuint(src1), minimum);

uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Min3F,
AmdDxExtShaderIntrinsicsOpcodePhase_1,
0);
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, asuint(src2), minimum, minimum);

return asfloat(minimum);
}

/**
*************************************************************************************************************
* AmdDxExtShaderIntrinsics_Min3U
*
* Returns the minimum value of the three unsigned integer source arguments.
*
* Available if CheckSupport(AmdDxExtShaderIntrinsicsSupport_Compare3) returned S_OK.
*
*************************************************************************************************************
*/
uint AmdDxExtShaderIntrinsics_Min3U(uint src0, uint src1, uint src2)
{
uint minimum;

uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Min3U,
AmdDxExtShaderIntrinsicsOpcodePhase_0,
0);
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, src0, src1, minimum);

uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Min3U,
AmdDxExtShaderIntrinsicsOpcodePhase_1,
0);
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, src2, minimum, minimum);

return minimum;
}

/**
*************************************************************************************************************
* AmdDxExtShaderIntrinsics_Med3F
Expand Down Expand Up @@ -611,60 +553,6 @@ uint AmdDxExtShaderIntrinsics_Med3U(uint src0, uint src1, uint src2)
return median;
}

/**
*************************************************************************************************************
* AmdDxExtShaderIntrinsics_Max3F
*
* Returns the maximum value of the three floating point source arguments.
*
* Available if CheckSupport(AmdDxExtShaderIntrinsicsSupport_Compare3) returned S_OK.
*
*************************************************************************************************************
*/
float AmdDxExtShaderIntrinsics_Max3F(float src0, float src1, float src2)
{
uint maximum;

uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Max3F,
AmdDxExtShaderIntrinsicsOpcodePhase_0,
0);
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, asuint(src0), asuint(src1), maximum);

uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Max3F,
AmdDxExtShaderIntrinsicsOpcodePhase_1,
0);
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, asuint(src2), maximum, maximum);

return asfloat(maximum);
}

/**
*************************************************************************************************************
* AmdDxExtShaderIntrinsics_Max3U
*
* Returns the maximum value of the three unsigned integer source arguments.
*
* Available if CheckSupport(AmdDxExtShaderIntrinsicsSupport_Compare3) returned S_OK.
*
*************************************************************************************************************
*/
uint AmdDxExtShaderIntrinsics_Max3U(uint src0, uint src1, uint src2)
{
uint maximum;

uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Max3U,
AmdDxExtShaderIntrinsicsOpcodePhase_0,
0);
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, src0, src1, maximum);

uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Max3U,
AmdDxExtShaderIntrinsicsOpcodePhase_1,
0);
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, src2, maximum, maximum);

return maximum;
}

/**
*************************************************************************************************************
* AmdDxExtShaderIntrinsics_IjBarycentricCoords
Expand Down Expand Up @@ -3153,4 +3041,4 @@ uint4 AmdDxExtShaderIntrinsics_WavePostfixMax(uint4 src)
src);
}

#endif // _AMDDXEXTSHADERINTRINSICS_HLSL_
#endif // _AMDDXEXTSHADERINTRINSICS_HLSL_
116 changes: 2 additions & 114 deletions ags_lib/hlsl/ags_shader_intrinsics_dx12.hlsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -70,12 +70,8 @@ RWByteAddressBuffer AmdExtD3DShaderIntrinsicsUAV : register(u0, AmdExtD3DShaderI
#define AmdExtD3DShaderIntrinsicsOpcode_Swizzle 0x04
#define AmdExtD3DShaderIntrinsicsOpcode_Ballot 0x05
#define AmdExtD3DShaderIntrinsicsOpcode_MBCnt 0x06
#define AmdExtD3DShaderIntrinsicsOpcode_Min3U 0x07
#define AmdExtD3DShaderIntrinsicsOpcode_Min3F 0x08
#define AmdExtD3DShaderIntrinsicsOpcode_Med3U 0x09
#define AmdExtD3DShaderIntrinsicsOpcode_Med3F 0x0a
#define AmdExtD3DShaderIntrinsicsOpcode_Max3U 0x0b
#define AmdExtD3DShaderIntrinsicsOpcode_Max3F 0x0c
#define AmdExtD3DShaderIntrinsicsOpcode_BaryCoord 0x0d
#define AmdExtD3DShaderIntrinsicsOpcode_VtxParam 0x0e
#define AmdExtD3DShaderIntrinsicsOpcode_Reserved1 0x0f
Expand Down Expand Up @@ -470,60 +466,6 @@ uint AmdExtD3DShaderIntrinsics_MBCnt(uint2 src)
return retVal;
}

/**
***********************************************************************************************************************
* AmdExtD3DShaderIntrinsics_Min3F
*
* Returns the minimum value of the three floating point source arguments.
*
* Available if CheckSupport(AmdExtD3DShaderIntrinsicsSupport_Compare3) returned S_OK.
*
***********************************************************************************************************************
*/
float AmdExtD3DShaderIntrinsics_Min3F(float src0, float src1, float src2)
{
uint minimum;

uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Min3F,
AmdExtD3DShaderIntrinsicsOpcodePhase_0,
0);
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, asuint(src0), asuint(src1), minimum);

uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Min3F,
AmdExtD3DShaderIntrinsicsOpcodePhase_1,
0);
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, asuint(src2), minimum, minimum);

return asfloat(minimum);
}

/**
***********************************************************************************************************************
* AmdExtD3DShaderIntrinsics_Min3U
*
* Returns the minimum value of the three unsigned integer source arguments.
*
* Available if CheckSupport(AmdExtD3DShaderIntrinsicsSupport_Compare3) returned S_OK.
*
***********************************************************************************************************************
*/
uint AmdExtD3DShaderIntrinsics_Min3U(uint src0, uint src1, uint src2)
{
uint minimum;

uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Min3U,
AmdExtD3DShaderIntrinsicsOpcodePhase_0,
0);
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, src0, src1, minimum);

uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Min3U,
AmdExtD3DShaderIntrinsicsOpcodePhase_1,
0);
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, src2, minimum, minimum);

return minimum;
}

/**
***********************************************************************************************************************
* AmdExtD3DShaderIntrinsics_Med3F
Expand Down Expand Up @@ -578,60 +520,6 @@ uint AmdExtD3DShaderIntrinsics_Med3U(uint src0, uint src1, uint src2)
return median;
}

/**
***********************************************************************************************************************
* AmdExtD3DShaderIntrinsics_Max3F
*
* Returns the maximum value of the three floating point source arguments.
*
* Available if CheckSupport(AmdExtD3DShaderIntrinsicsSupport_Compare3) returned S_OK.
*
***********************************************************************************************************************
*/
float AmdExtD3DShaderIntrinsics_Max3F(float src0, float src1, float src2)
{
uint maximum;

uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Max3F,
AmdExtD3DShaderIntrinsicsOpcodePhase_0,
0);
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, asuint(src0), asuint(src1), maximum);

uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Max3F,
AmdExtD3DShaderIntrinsicsOpcodePhase_1,
0);
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, asuint(src2), maximum, maximum);

return asfloat(maximum);
}

/**
***********************************************************************************************************************
* AmdExtD3DShaderIntrinsics_Max3U
*
* Returns the maximum value of the three unsigned integer source arguments.
*
* Available if CheckSupport(AmdExtD3DShaderIntrinsicsSupport_Compare3) returned S_OK.
*
***********************************************************************************************************************
*/
uint AmdExtD3DShaderIntrinsics_Max3U(uint src0, uint src1, uint src2)
{
uint maximum;

uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Max3U,
AmdExtD3DShaderIntrinsicsOpcodePhase_0,
0);
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, src0, src1, maximum);

uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Max3U,
AmdExtD3DShaderIntrinsicsOpcodePhase_1,
0);
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, src2, maximum, maximum);

return maximum;
}

/**
***********************************************************************************************************************
* AmdExtD3DShaderIntrinsics_IjBarycentricCoords
Expand Down Expand Up @@ -3124,4 +3012,4 @@ uint4 AmdExtD3DShaderIntrinsics_WavePostfixMax(uint4 src)
src);
}

#endif // _AMDEXTD3DSHADERINTRINICS_HLSL
#endif // _AMDEXTD3DSHADERINTRINICS_HLSL
Loading

0 comments on commit 598ba9f

Please sign in to comment.