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: 03/17/2014 25 Revision: 3 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 Variables) 63 64 Modify Section 7.3, Built-In Constants 65 66 (add to the list of built-in constants) 67 68 const int gl_SIMDGroupSizeAMD = 64; 69 70Additions to Chapter 8 of the OpenGL Shading Language Specification 71(Built-in Functions) 72 73 Add New Section 8.9.5, Texture Cube Map Addressing Functions 74 75 Syntax: 76 77 float cubeFaceIndexAMD(vec3 P) 78 79 The function cubeFaceIndexAMD returns a single floating point value 80 that represents the index of the cube map face that would be accessed 81 by texture lookup functions for the cube map texture coordinates given 82 as parameter. The returned value correspond to cube map faces as follows: 83 84 * 0.0 for the cube map face facing the positive X direction 85 * 1.0 for the cube map face facing the negative X direction 86 * 2.0 for the cube map face facing the positive Y direction 87 * 3.0 for the cube map face facing the negative Y direction 88 * 4.0 for the cube map face facing the positive Z direction 89 * 5.0 for the cube map face facing the negative Z direction 90 91 Syntax: 92 93 vec2 cubeFaceCoordAMD(vec3 P) 94 95 The function cubeFaceCoordAMD returns a two-component floating point 96 vector that represents the 2D texture coordinates that would be used for 97 accessing the selected cube map face for the given cube map texture 98 coordinates given as parameter P. 99 100 Modify Section 8.18, Shader Invocation Group Functions 101 102 (add to the end of the section) 103 104 Syntax: 105 106 uint64_t ballotAMD(bool value); 107 108 The function ballotAMD returns a bitfield containing the result of 109 evaluating the expression <value> in all active invocations in the group. 110 SIMD groups of up to 64 invocations may be represented by the return value 111 of ballotAMD(). Invocations populate the result starting from the least 112 significant bit. If <value> evaluates to true for an active invocation 113 then the corresponding bit is set in the result, otherwise it is not set. 114 Bits corresponding to invocations that are not active or that do not 115 exist in the SIMD group (because, for example, they are at bit positions 116 beyond the SIMD group size) are set to zero. The following trivial 117 assumptions can be made: 118 119 * ballotAMD(true) returns bitfield where the corresponding bits are 120 set for all active invocations in the SIMD group. 121 * ballotAMD(false) returns 0ul. 122 123 124 Add New Section 8.19, "Timing Functions" 125 126 Syntax: 127 128 uint64_t timeAMD(void); 129 130 The timeAMD function returns a 64-bit value representing the current 131 execution clock as seen by the shader processor. Time monotonically 132 increments as the processor executes instructions. The returned time will 133 wrap after it exceeds the maximum value representable in 64 bits. The 134 units of time are not defined and need not be constant. Time is not 135 dynamically uniform. That is, shader invocations executing as part of a 136 single draw or dispatch will not necessarily see the same value of time. 137 Time is also not guaranteed to be consistent across shader stages. For 138 example, there is no requirement that time sampled inside a fragment 139 shader invocation will be greater than the time sampled in the vertex 140 that lead to its execution. 141 142Dependencies on GL_ARB_shader_group_vote: 143 144 This extension adds to sections introduced by GL_ARB_shader_group_vote. 145 If GL_ARB_shader_group_vote is not supported, introduce the referenced 146 sections, but do not introduce the functionality from that extension. 147 148Revision History 149 150 Rev. Date Author Changes 151 ---- -------- -------- --------------------------------------------- 152 3 03/17/2013 drakos Internal updates + ready to post 153 2 10/08/2013 gsellers Internal updates 154 1 09/20/2013 gsellers Initial revision 155