Skip to content

Commit 598ba9f

Browse files
author
Rys Sommefeldt
committed
AGS 5.2.0
1 parent 35fba69 commit 598ba9f

24 files changed

+392
-390
lines changed

ags_lib/doc/amd_ags.chm

46 KB
Binary file not shown.

ags_lib/hlsl/ags_shader_intrinsics_dx11.hlsl

Lines changed: 2 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved.
2+
// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files (the "Software"), to deal
@@ -65,12 +65,8 @@
6565
#define AmdDxExtShaderIntrinsicsOpcode_Swizzle 0x04
6666
#define AmdDxExtShaderIntrinsicsOpcode_Ballot 0x05
6767
#define AmdDxExtShaderIntrinsicsOpcode_MBCnt 0x06
68-
#define AmdDxExtShaderIntrinsicsOpcode_Min3U 0x08
69-
#define AmdDxExtShaderIntrinsicsOpcode_Min3F 0x09
7068
#define AmdDxExtShaderIntrinsicsOpcode_Med3U 0x0a
7169
#define AmdDxExtShaderIntrinsicsOpcode_Med3F 0x0b
72-
#define AmdDxExtShaderIntrinsicsOpcode_Max3U 0x0c
73-
#define AmdDxExtShaderIntrinsicsOpcode_Max3F 0x0d
7470
#define AmdDxExtShaderIntrinsicsOpcode_BaryCoord 0x0e
7571
#define AmdDxExtShaderIntrinsicsOpcode_VtxParam 0x0f
7672
#define AmdDxExtShaderIntrinsicsOpCode_ViewportIndex 0x10
@@ -503,60 +499,6 @@ uint AmdDxExtShaderIntrinsics_MBCnt(uint2 src)
503499
return retVal;
504500
}
505501

506-
/**
507-
*************************************************************************************************************
508-
* AmdDxExtShaderIntrinsics_Min3F
509-
*
510-
* Returns the minimum value of the three floating point source arguments.
511-
*
512-
* Available if CheckSupport(AmdDxExtShaderIntrinsicsSupport_Compare3) returned S_OK.
513-
*
514-
*************************************************************************************************************
515-
*/
516-
float AmdDxExtShaderIntrinsics_Min3F(float src0, float src1, float src2)
517-
{
518-
uint minimum;
519-
520-
uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Min3F,
521-
AmdDxExtShaderIntrinsicsOpcodePhase_0,
522-
0);
523-
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, asuint(src0), asuint(src1), minimum);
524-
525-
uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Min3F,
526-
AmdDxExtShaderIntrinsicsOpcodePhase_1,
527-
0);
528-
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, asuint(src2), minimum, minimum);
529-
530-
return asfloat(minimum);
531-
}
532-
533-
/**
534-
*************************************************************************************************************
535-
* AmdDxExtShaderIntrinsics_Min3U
536-
*
537-
* Returns the minimum value of the three unsigned integer source arguments.
538-
*
539-
* Available if CheckSupport(AmdDxExtShaderIntrinsicsSupport_Compare3) returned S_OK.
540-
*
541-
*************************************************************************************************************
542-
*/
543-
uint AmdDxExtShaderIntrinsics_Min3U(uint src0, uint src1, uint src2)
544-
{
545-
uint minimum;
546-
547-
uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Min3U,
548-
AmdDxExtShaderIntrinsicsOpcodePhase_0,
549-
0);
550-
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, src0, src1, minimum);
551-
552-
uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Min3U,
553-
AmdDxExtShaderIntrinsicsOpcodePhase_1,
554-
0);
555-
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, src2, minimum, minimum);
556-
557-
return minimum;
558-
}
559-
560502
/**
561503
*************************************************************************************************************
562504
* AmdDxExtShaderIntrinsics_Med3F
@@ -611,60 +553,6 @@ uint AmdDxExtShaderIntrinsics_Med3U(uint src0, uint src1, uint src2)
611553
return median;
612554
}
613555

614-
/**
615-
*************************************************************************************************************
616-
* AmdDxExtShaderIntrinsics_Max3F
617-
*
618-
* Returns the maximum value of the three floating point source arguments.
619-
*
620-
* Available if CheckSupport(AmdDxExtShaderIntrinsicsSupport_Compare3) returned S_OK.
621-
*
622-
*************************************************************************************************************
623-
*/
624-
float AmdDxExtShaderIntrinsics_Max3F(float src0, float src1, float src2)
625-
{
626-
uint maximum;
627-
628-
uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Max3F,
629-
AmdDxExtShaderIntrinsicsOpcodePhase_0,
630-
0);
631-
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, asuint(src0), asuint(src1), maximum);
632-
633-
uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Max3F,
634-
AmdDxExtShaderIntrinsicsOpcodePhase_1,
635-
0);
636-
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, asuint(src2), maximum, maximum);
637-
638-
return asfloat(maximum);
639-
}
640-
641-
/**
642-
*************************************************************************************************************
643-
* AmdDxExtShaderIntrinsics_Max3U
644-
*
645-
* Returns the maximum value of the three unsigned integer source arguments.
646-
*
647-
* Available if CheckSupport(AmdDxExtShaderIntrinsicsSupport_Compare3) returned S_OK.
648-
*
649-
*************************************************************************************************************
650-
*/
651-
uint AmdDxExtShaderIntrinsics_Max3U(uint src0, uint src1, uint src2)
652-
{
653-
uint maximum;
654-
655-
uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Max3U,
656-
AmdDxExtShaderIntrinsicsOpcodePhase_0,
657-
0);
658-
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, src0, src1, maximum);
659-
660-
uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdDxExtShaderIntrinsicsOpcode_Max3U,
661-
AmdDxExtShaderIntrinsicsOpcodePhase_1,
662-
0);
663-
AmdDxExtShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, src2, maximum, maximum);
664-
665-
return maximum;
666-
}
667-
668556
/**
669557
*************************************************************************************************************
670558
* AmdDxExtShaderIntrinsics_IjBarycentricCoords
@@ -3153,4 +3041,4 @@ uint4 AmdDxExtShaderIntrinsics_WavePostfixMax(uint4 src)
31533041
src);
31543042
}
31553043

3156-
#endif // _AMDDXEXTSHADERINTRINSICS_HLSL_
3044+
#endif // _AMDDXEXTSHADERINTRINSICS_HLSL_

ags_lib/hlsl/ags_shader_intrinsics_dx12.hlsl

Lines changed: 2 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved.
2+
// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files (the "Software"), to deal
@@ -70,12 +70,8 @@ RWByteAddressBuffer AmdExtD3DShaderIntrinsicsUAV : register(u0, AmdExtD3DShaderI
7070
#define AmdExtD3DShaderIntrinsicsOpcode_Swizzle 0x04
7171
#define AmdExtD3DShaderIntrinsicsOpcode_Ballot 0x05
7272
#define AmdExtD3DShaderIntrinsicsOpcode_MBCnt 0x06
73-
#define AmdExtD3DShaderIntrinsicsOpcode_Min3U 0x07
74-
#define AmdExtD3DShaderIntrinsicsOpcode_Min3F 0x08
7573
#define AmdExtD3DShaderIntrinsicsOpcode_Med3U 0x09
7674
#define AmdExtD3DShaderIntrinsicsOpcode_Med3F 0x0a
77-
#define AmdExtD3DShaderIntrinsicsOpcode_Max3U 0x0b
78-
#define AmdExtD3DShaderIntrinsicsOpcode_Max3F 0x0c
7975
#define AmdExtD3DShaderIntrinsicsOpcode_BaryCoord 0x0d
8076
#define AmdExtD3DShaderIntrinsicsOpcode_VtxParam 0x0e
8177
#define AmdExtD3DShaderIntrinsicsOpcode_Reserved1 0x0f
@@ -470,60 +466,6 @@ uint AmdExtD3DShaderIntrinsics_MBCnt(uint2 src)
470466
return retVal;
471467
}
472468

473-
/**
474-
***********************************************************************************************************************
475-
* AmdExtD3DShaderIntrinsics_Min3F
476-
*
477-
* Returns the minimum value of the three floating point source arguments.
478-
*
479-
* Available if CheckSupport(AmdExtD3DShaderIntrinsicsSupport_Compare3) returned S_OK.
480-
*
481-
***********************************************************************************************************************
482-
*/
483-
float AmdExtD3DShaderIntrinsics_Min3F(float src0, float src1, float src2)
484-
{
485-
uint minimum;
486-
487-
uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Min3F,
488-
AmdExtD3DShaderIntrinsicsOpcodePhase_0,
489-
0);
490-
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, asuint(src0), asuint(src1), minimum);
491-
492-
uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Min3F,
493-
AmdExtD3DShaderIntrinsicsOpcodePhase_1,
494-
0);
495-
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, asuint(src2), minimum, minimum);
496-
497-
return asfloat(minimum);
498-
}
499-
500-
/**
501-
***********************************************************************************************************************
502-
* AmdExtD3DShaderIntrinsics_Min3U
503-
*
504-
* Returns the minimum value of the three unsigned integer source arguments.
505-
*
506-
* Available if CheckSupport(AmdExtD3DShaderIntrinsicsSupport_Compare3) returned S_OK.
507-
*
508-
***********************************************************************************************************************
509-
*/
510-
uint AmdExtD3DShaderIntrinsics_Min3U(uint src0, uint src1, uint src2)
511-
{
512-
uint minimum;
513-
514-
uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Min3U,
515-
AmdExtD3DShaderIntrinsicsOpcodePhase_0,
516-
0);
517-
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, src0, src1, minimum);
518-
519-
uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Min3U,
520-
AmdExtD3DShaderIntrinsicsOpcodePhase_1,
521-
0);
522-
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, src2, minimum, minimum);
523-
524-
return minimum;
525-
}
526-
527469
/**
528470
***********************************************************************************************************************
529471
* AmdExtD3DShaderIntrinsics_Med3F
@@ -578,60 +520,6 @@ uint AmdExtD3DShaderIntrinsics_Med3U(uint src0, uint src1, uint src2)
578520
return median;
579521
}
580522

581-
/**
582-
***********************************************************************************************************************
583-
* AmdExtD3DShaderIntrinsics_Max3F
584-
*
585-
* Returns the maximum value of the three floating point source arguments.
586-
*
587-
* Available if CheckSupport(AmdExtD3DShaderIntrinsicsSupport_Compare3) returned S_OK.
588-
*
589-
***********************************************************************************************************************
590-
*/
591-
float AmdExtD3DShaderIntrinsics_Max3F(float src0, float src1, float src2)
592-
{
593-
uint maximum;
594-
595-
uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Max3F,
596-
AmdExtD3DShaderIntrinsicsOpcodePhase_0,
597-
0);
598-
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, asuint(src0), asuint(src1), maximum);
599-
600-
uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Max3F,
601-
AmdExtD3DShaderIntrinsicsOpcodePhase_1,
602-
0);
603-
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, asuint(src2), maximum, maximum);
604-
605-
return asfloat(maximum);
606-
}
607-
608-
/**
609-
***********************************************************************************************************************
610-
* AmdExtD3DShaderIntrinsics_Max3U
611-
*
612-
* Returns the maximum value of the three unsigned integer source arguments.
613-
*
614-
* Available if CheckSupport(AmdExtD3DShaderIntrinsicsSupport_Compare3) returned S_OK.
615-
*
616-
***********************************************************************************************************************
617-
*/
618-
uint AmdExtD3DShaderIntrinsics_Max3U(uint src0, uint src1, uint src2)
619-
{
620-
uint maximum;
621-
622-
uint instruction1 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Max3U,
623-
AmdExtD3DShaderIntrinsicsOpcodePhase_0,
624-
0);
625-
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction1, src0, src1, maximum);
626-
627-
uint instruction2 = MakeAmdShaderIntrinsicsInstruction(AmdExtD3DShaderIntrinsicsOpcode_Max3U,
628-
AmdExtD3DShaderIntrinsicsOpcodePhase_1,
629-
0);
630-
AmdExtD3DShaderIntrinsicsUAV.InterlockedCompareExchange(instruction2, src2, maximum, maximum);
631-
632-
return maximum;
633-
}
634-
635523
/**
636524
***********************************************************************************************************************
637525
* AmdExtD3DShaderIntrinsics_IjBarycentricCoords
@@ -3124,4 +3012,4 @@ uint4 AmdExtD3DShaderIntrinsics_WavePostfixMax(uint4 src)
31243012
src);
31253013
}
31263014

3127-
#endif // _AMDEXTD3DSHADERINTRINICS_HLSL
3015+
#endif // _AMDEXTD3DSHADERINTRINICS_HLSL

0 commit comments

Comments
 (0)