15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci     NV_shader_atomic_int64
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci     GL_NV_shader_atomic_int64
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci     Pat Brown, NVIDIA (pbrown 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci     Pat Brown, NVIDIA
165bd8deadSopenharmony_ci     Jeff Bolz, NVIDIA
175bd8deadSopenharmony_ci     Cyril Crassin, NVIDIA
185bd8deadSopenharmony_ci     Christoph Kubisch, NVIDIA
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ciStatus
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ci     Shipping
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ciVersion
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ci     Last Modified Date:	May 11, 2021
275bd8deadSopenharmony_ci     NVIDIA Revision:		3
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ciNumber
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ci     OpenGL Extension #455
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciDependencies
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci     This extension is written against version 4.40 (revision 8) of the OpenGL
365bd8deadSopenharmony_ci     Shading Language Specification, dated January 22, 2014.
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci     This extension interacts with NV_shader_buffer_store and NV_gpu_shader5.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci     This extension interacts with NV_gpu_program5, NV_compute_program5, and
415bd8deadSopenharmony_ci     NV_shader_storage_buffer_object.
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ciOverview
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci     This extension provides additional GLSL built-in functions and assembly
465bd8deadSopenharmony_ci     opcodes allowing shaders to perform additional atomic read-modify-write
475bd8deadSopenharmony_ci     operations on 64-bit signed and unsigned integers stored in buffer object
485bd8deadSopenharmony_ci     memory.
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ciNew Procedures and Functions
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci     None.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ciNew Tokens
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci     None.
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ciAdditions to OpenGL 4.4 Specification
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci     None.
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci     None.
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ciGLX Protocol
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci     None.
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ciModifications to the OpenGL Shading Language Specification, Version 4.40
715bd8deadSopenharmony_ci(revision 8)
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    Including the following line in a shader can be used to control the
745bd8deadSopenharmony_ci    language features described in this extension:
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci       #extension GL_NV_shader_atomic_int64 : <behavior>
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci    where <behavior> is as specified in section 3.3.
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    New preprocessor #defines are added to the OpenGL Shading Language:
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci       #define GL_NV_shader_atomic_int64	 1
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci    Modify Section 8.11, Atomic Memory Functions, p. 168
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    Add the following new functions to the table on p. 173:
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci      uint64_t atomicMin(inout uint64_t mem, uint64_t data);
895bd8deadSopenharmony_ci      uint64_t atomicMax(inout uint64_t mem, uint64_t data);
905bd8deadSopenharmony_ci      uint64_t atomicAnd(inout uint64_t mem, uint64_t data);
915bd8deadSopenharmony_ci      uint64_t atomicOr (inout uint64_t mem, uint64_t data);
925bd8deadSopenharmony_ci      uint64_t atomicXor(inout uint64_t mem, uint64_t data);
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci      int64_t atomicMin(inout int64_t mem, int64_t data);
955bd8deadSopenharmony_ci      int64_t atomicMax(inout int64_t mem, int64_t data);
965bd8deadSopenharmony_ci      int64_t atomicAnd(inout int64_t mem, int64_t data);
975bd8deadSopenharmony_ci      int64_t atomicOr (inout int64_t mem, int64_t data);
985bd8deadSopenharmony_ci      int64_t atomicXor(inout int64_t mem, int64_t data);
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci      int64_t atomicAdd(inout int64_t mem, int64_t data);
1015bd8deadSopenharmony_ci      int64_t atomicExchange(inout int64_t mem, int64_t data);
1025bd8deadSopenharmony_ci      int64_t atomicCompSwap(inout int64_t mem, int64_t data);
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ciDependencies on NV_shader_buffer_store and NV_gpu_shader5
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci     If NV_shader_buffer_store and NV_gpu_shader5 are supported, the following
1075bd8deadSopenharmony_ci     functions should be added to the "Section 8.Y, Shader Memory Functions"
1085bd8deadSopenharmony_ci     language in the NV_shader_buffer_store specification:
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci      uint64_t atomicMin(uint64_t *address, uint64_t data);
1115bd8deadSopenharmony_ci      uint64_t atomicMax(uint64_t *address, uint64_t data);
1125bd8deadSopenharmony_ci      uint64_t atomicAnd(uint64_t *address, uint64_t data);
1135bd8deadSopenharmony_ci      uint64_t atomicOr (uint64_t *address, uint64_t data);
1145bd8deadSopenharmony_ci      uint64_t atomicXor(uint64_t *address, uint64_t data);
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci      int64_t atomicMin(int64_t *address, int64_t data);
1175bd8deadSopenharmony_ci      int64_t atomicMax(int64_t *address, int64_t data);
1185bd8deadSopenharmony_ci      int64_t atomicAnd(int64_t *address, int64_t data);
1195bd8deadSopenharmony_ci      int64_t atomicOr (int64_t *address, int64_t data);
1205bd8deadSopenharmony_ci      int64_t atomicXor(int64_t *address, int64_t data);
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci      int64_t atomicAdd(int64_t *address, int64_t data);
1235bd8deadSopenharmony_ci      int64_t atomicExchange(int64_t *address, int64_t data);
1245bd8deadSopenharmony_ci      int64_t atomicCompSwap(int64_t *address, int64_t data);
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ciDependencies on NV_gpu_program5, NV_compute_program5, and
1275bd8deadSopenharmony_ciNV_shader_storage_buffer_object
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    If NV_gpu_program5 is supported and "OPTION NV_shader_atomic_int64" is
1305bd8deadSopenharmony_ci    specified in an assembly program, new combinations of atomic operations
1315bd8deadSopenharmony_ci    and storage modifiers are supported for the ATOM, ATOMB, and ATOMS
1325bd8deadSopenharmony_ci    instructions.  (Note:  ATOMB comes from NV_shader_storage_buffer_object
1335bd8deadSopenharmony_ci    and ATOMS comes from NV_compute_program5.)	"S64" should be allowed as a
1345bd8deadSopenharmony_ci    storage modifier for the atomic operations "MIN', "MAX", "AND", "OR",
1355bd8deadSopenharmony_ci    "XOR", "ADD", "EXCH", and "CSWAP".	"U64" should be allowed a s storage
1365bd8deadSopenharmony_ci    modifier for the atomic operations "MIN", "MAX", "AND", "OR", and "XOR".
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci    (Add to "Section 2.X.6, Program Options" of the NV_gpu_program4 extension,
1395bd8deadSopenharmony_ci     as extended by NV_gpu_program5:)
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci      + Extended 64-bit Atomic Operations (NV_shader_atomic_int64)
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci	If a program specifies the "NV_shader_atomic_int64" option, it may
1445bd8deadSopenharmony_ci	use the "S64" storage modifier with the atomic operations "MIN',
1455bd8deadSopenharmony_ci	"MAX", "AND", "OR", "XOR", "ADD", "EXCH", and "CSWAP", and the "U64"
1465bd8deadSopenharmony_ci	storage modifier with the atomic operations "MIN", "MAX", "AND", "OR",
1475bd8deadSopenharmony_ci	and "XOR".
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci    (Add "U64" and or "S64" opcode modifiers to the table in "Section 2.X.8.Z:
1505bd8deadSopenharmony_ci     ATOM" in NV_gpu_program5, "Section 2.X.8.Z: ATOMS" in
1515bd8deadSopenharmony_ci     NV_compute_program5, and "Section 2.X.8.Z: ATOMB" in
1525bd8deadSopenharmony_ci     NV_shader_storage_buffer_object)
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci      atomic	 storage
1555bd8deadSopenharmony_ci      modifier	 modifiers	      operation
1565bd8deadSopenharmony_ci      --------	 ------------------   --------------------------------------
1575bd8deadSopenharmony_ci       ADD	 U32, S32, U64, S64   compute a sum
1585bd8deadSopenharmony_ci       MIN	 U32, S32, U64, S64   compute minimum
1595bd8deadSopenharmony_ci       MAX	 U32, S32, U64, S64   compute maximum
1605bd8deadSopenharmony_ci       AND	 U32, S32, U64, S64   compute bit-wise AND
1615bd8deadSopenharmony_ci       OR	 U32, S32, U64, S64   compute bit-wise OR
1625bd8deadSopenharmony_ci       XOR	 U32, S32, U64, S64   compute bit-wise XOR
1635bd8deadSopenharmony_ci       EXCH	 U32, S32, U64, S64   exchange memory with operand
1645bd8deadSopenharmony_ci       CSWAP	 U32, S32, U64, S64   compare-and-swap
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    No new support is provided for the IWRAP and DWRAP atomic operations.
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ciErrors
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci     None.
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ciNew State
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci     None.
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ciNew Implementation Dependent State
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ci     None.
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ciIssues
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci     None.
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ciRevision History
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci    Revision 3, May 11, 2021
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci      Fix typos in the NV_gpu_program5 assembly option name, which should
1895bd8deadSopenharmony_ci      have been specified as "NV_shader_atomic_int64".
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci    Revision 2, March 13, 2014 (pbrown)
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci      Update to OpenGL 4.4 / GLSL 4.40, plus minor clarifications.
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci    Revision 1, November 8, 2013 (ckubisch)
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci      Initial revision.
198