15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci AMD_gcn_shader 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_AMD_gcn_shader 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Graham Sellers (graham.sellers 'at' amd.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Graham Sellers, AMD 165bd8deadSopenharmony_ci Daniel Rakos, AMD 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Shipping 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Last Modified Date: 06/24/2019 255bd8deadSopenharmony_ci Revision: 4 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNumber 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci OpenGL Extension #453 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ciDependencies 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci This extension is written against Revision 8 of the version 4.40 of the 345bd8deadSopenharmony_ci OpenGL Shading Language Specification, dated January 22, 2014. 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci This extension builds upon features introduced by the 375bd8deadSopenharmony_ci GL_ARB_shader_group_vote extension. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci AMD_gpu_shader_int64 or NV_gpu_shader5 is required. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciOverview 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci This extension exposes miscellaneous features of the AMD "Graphics Core 445bd8deadSopenharmony_ci Next" shader architecture that do not cleanly fit into other extensions 455bd8deadSopenharmony_ci and are not significant enough alone to warrant their own extensions. 465bd8deadSopenharmony_ci This includes cross-SIMD lane ballots, cube map query functions and 475bd8deadSopenharmony_ci a functionality to query the elapsed shader core time. 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ciNew Procedures and Functions 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci None. 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ciNew Tokens 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci None. 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ciIP Status 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci None. 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ciAdditions to Chapter 7 of the OpenGL Shading Language Specification 625bd8deadSopenharmony_ci(Built-In Language Variables) 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci Modify Section 7.1, Built-In Language Variables 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci (add to the list of built-in constants for each shader stage listed in 675bd8deadSopenharmony_ci the chapter) 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci in int gl_SIMDGroupSizeAMD; 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ciAdditions to Chapter 8 of the OpenGL Shading Language Specification 725bd8deadSopenharmony_ci(Built-in Functions) 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci Add New Section 8.9.5, Texture Cube Map Addressing Functions 755bd8deadSopenharmony_ci 765bd8deadSopenharmony_ci Syntax: 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci float cubeFaceIndexAMD(vec3 P) 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci The function cubeFaceIndexAMD returns a single floating point value 815bd8deadSopenharmony_ci that represents the index of the cube map face that would be accessed 825bd8deadSopenharmony_ci by texture lookup functions for the cube map texture coordinates given 835bd8deadSopenharmony_ci as parameter. The returned value correspond to cube map faces as follows: 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci * 0.0 for the cube map face facing the positive X direction 865bd8deadSopenharmony_ci * 1.0 for the cube map face facing the negative X direction 875bd8deadSopenharmony_ci * 2.0 for the cube map face facing the positive Y direction 885bd8deadSopenharmony_ci * 3.0 for the cube map face facing the negative Y direction 895bd8deadSopenharmony_ci * 4.0 for the cube map face facing the positive Z direction 905bd8deadSopenharmony_ci * 5.0 for the cube map face facing the negative Z direction 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci Syntax: 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci vec2 cubeFaceCoordAMD(vec3 P) 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci The function cubeFaceCoordAMD returns a two-component floating point 975bd8deadSopenharmony_ci vector that represents the 2D texture coordinates that would be used for 985bd8deadSopenharmony_ci accessing the selected cube map face for the given cube map texture 995bd8deadSopenharmony_ci coordinates given as parameter P. 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ci Modify Section 8.18, Shader Invocation Group Functions 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci (add to the end of the section) 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci Syntax: 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci uint64_t ballotAMD(bool value); 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci The function ballotAMD returns a bitfield containing the result of 1105bd8deadSopenharmony_ci evaluating the expression <value> in all active invocations in the group. 1115bd8deadSopenharmony_ci SIMD groups of up to 64 invocations may be represented by the return value 1125bd8deadSopenharmony_ci of ballotAMD(). Invocations populate the result starting from the least 1135bd8deadSopenharmony_ci significant bit. If <value> evaluates to true for an active invocation 1145bd8deadSopenharmony_ci then the corresponding bit is set in the result, otherwise it is not set. 1155bd8deadSopenharmony_ci Bits corresponding to invocations that are not active or that do not 1165bd8deadSopenharmony_ci exist in the SIMD group (because, for example, they are at bit positions 1175bd8deadSopenharmony_ci beyond the SIMD group size) are set to zero. The following trivial 1185bd8deadSopenharmony_ci assumptions can be made: 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci * ballotAMD(true) returns bitfield where the corresponding bits are 1215bd8deadSopenharmony_ci set for all active invocations in the SIMD group. 1225bd8deadSopenharmony_ci * ballotAMD(false) returns 0ul. 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci Add New Section 8.19, "Timing Functions" 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci Syntax: 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci uint64_t timeAMD(void); 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci The timeAMD function returns a 64-bit value representing the current 1325bd8deadSopenharmony_ci execution clock as seen by the shader processor. Time monotonically 1335bd8deadSopenharmony_ci increments as the processor executes instructions. The returned time will 1345bd8deadSopenharmony_ci wrap after it exceeds the maximum value representable in 64 bits. The 1355bd8deadSopenharmony_ci units of time are not defined and need not be constant. Time is not 1365bd8deadSopenharmony_ci dynamically uniform. That is, shader invocations executing as part of a 1375bd8deadSopenharmony_ci single draw or dispatch will not necessarily see the same value of time. 1385bd8deadSopenharmony_ci Time is also not guaranteed to be consistent across shader stages. For 1395bd8deadSopenharmony_ci example, there is no requirement that time sampled inside a fragment 1405bd8deadSopenharmony_ci shader invocation will be greater than the time sampled in the vertex 1415bd8deadSopenharmony_ci that lead to its execution. 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ciDependencies on GL_ARB_shader_group_vote: 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci This extension adds to sections introduced by GL_ARB_shader_group_vote. 1465bd8deadSopenharmony_ci If GL_ARB_shader_group_vote is not supported, introduce the referenced 1475bd8deadSopenharmony_ci sections, but do not introduce the functionality from that extension. 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ciRevision History 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci Rev. Date Author Changes 1525bd8deadSopenharmony_ci ---- -------- -------- --------------------------------------------- 1535bd8deadSopenharmony_ci 4 06/24/2019 dwitczak gl_SIMDGroupSizeAMD is no longer a built-in constant. 1545bd8deadSopenharmony_ci 3 03/17/2013 drakos Internal updates + ready to post 1555bd8deadSopenharmony_ci 2 10/08/2013 gsellers Internal updates 1565bd8deadSopenharmony_ci 1 09/20/2013 gsellers Initial revision 157