1Name 2 3 AMD_gcn_shader 4 5Name Strings 6 7 GL_AMD_gcn_shader 8 9Contact 10 11 Graham Sellers (graham.sellers 'at' amd.com) 12 13Contributors 14 15 Graham Sellers, AMD 16 Daniel Rakos, AMD 17 18Status 19 20 Shipping 21 22Version 23 24 Last Modified Date: 06/24/2019 25 Revision: 4 26 27Number 28 29 OpenGL Extension #453 30 31Dependencies 32 33 This extension is written against Revision 8 of the version 4.40 of the 34 OpenGL Shading Language Specification, dated January 22, 2014. 35 36 This extension builds upon features introduced by the 37 GL_ARB_shader_group_vote extension. 38 39 AMD_gpu_shader_int64 or NV_gpu_shader5 is required. 40 41Overview 42 43 This extension exposes miscellaneous features of the AMD "Graphics Core 44 Next" shader architecture that do not cleanly fit into other extensions 45 and are not significant enough alone to warrant their own extensions. 46 This includes cross-SIMD lane ballots, cube map query functions and 47 a functionality to query the elapsed shader core time. 48 49New Procedures and Functions 50 51 None. 52 53New Tokens 54 55 None. 56 57IP Status 58 59 None. 60 61Additions to Chapter 7 of the OpenGL Shading Language Specification 62(Built-In Language Variables) 63 64 Modify Section 7.1, Built-In Language Variables 65 66 (add to the list of built-in constants for each shader stage listed in 67 the chapter) 68 69 in int gl_SIMDGroupSizeAMD; 70 71Additions to Chapter 8 of the OpenGL Shading Language Specification 72(Built-in Functions) 73 74 Add New Section 8.9.5, Texture Cube Map Addressing Functions 75 76 Syntax: 77 78 float cubeFaceIndexAMD(vec3 P) 79 80 The function cubeFaceIndexAMD returns a single floating point value 81 that represents the index of the cube map face that would be accessed 82 by texture lookup functions for the cube map texture coordinates given 83 as parameter. The returned value correspond to cube map faces as follows: 84 85 * 0.0 for the cube map face facing the positive X direction 86 * 1.0 for the cube map face facing the negative X direction 87 * 2.0 for the cube map face facing the positive Y direction 88 * 3.0 for the cube map face facing the negative Y direction 89 * 4.0 for the cube map face facing the positive Z direction 90 * 5.0 for the cube map face facing the negative Z direction 91 92 Syntax: 93 94 vec2 cubeFaceCoordAMD(vec3 P) 95 96 The function cubeFaceCoordAMD returns a two-component floating point 97 vector that represents the 2D texture coordinates that would be used for 98 accessing the selected cube map face for the given cube map texture 99 coordinates given as parameter P. 100 101 Modify Section 8.18, Shader Invocation Group Functions 102 103 (add to the end of the section) 104 105 Syntax: 106 107 uint64_t ballotAMD(bool value); 108 109 The function ballotAMD returns a bitfield containing the result of 110 evaluating the expression <value> in all active invocations in the group. 111 SIMD groups of up to 64 invocations may be represented by the return value 112 of ballotAMD(). Invocations populate the result starting from the least 113 significant bit. If <value> evaluates to true for an active invocation 114 then the corresponding bit is set in the result, otherwise it is not set. 115 Bits corresponding to invocations that are not active or that do not 116 exist in the SIMD group (because, for example, they are at bit positions 117 beyond the SIMD group size) are set to zero. The following trivial 118 assumptions can be made: 119 120 * ballotAMD(true) returns bitfield where the corresponding bits are 121 set for all active invocations in the SIMD group. 122 * ballotAMD(false) returns 0ul. 123 124 125 Add New Section 8.19, "Timing Functions" 126 127 Syntax: 128 129 uint64_t timeAMD(void); 130 131 The timeAMD function returns a 64-bit value representing the current 132 execution clock as seen by the shader processor. Time monotonically 133 increments as the processor executes instructions. The returned time will 134 wrap after it exceeds the maximum value representable in 64 bits. The 135 units of time are not defined and need not be constant. Time is not 136 dynamically uniform. That is, shader invocations executing as part of a 137 single draw or dispatch will not necessarily see the same value of time. 138 Time is also not guaranteed to be consistent across shader stages. For 139 example, there is no requirement that time sampled inside a fragment 140 shader invocation will be greater than the time sampled in the vertex 141 that lead to its execution. 142 143Dependencies on GL_ARB_shader_group_vote: 144 145 This extension adds to sections introduced by GL_ARB_shader_group_vote. 146 If GL_ARB_shader_group_vote is not supported, introduce the referenced 147 sections, but do not introduce the functionality from that extension. 148 149Revision History 150 151 Rev. Date Author Changes 152 ---- -------- -------- --------------------------------------------- 153 4 06/24/2019 dwitczak gl_SIMDGroupSizeAMD is no longer a built-in constant. 154 3 03/17/2013 drakos Internal updates + ready to post 155 2 10/08/2013 gsellers Internal updates 156 1 09/20/2013 gsellers Initial revision 157