15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci AMD_gpu_association 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GLX_AMD_gpu_association 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci David Mao, AMD (david.mao 'at' amd.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciStatus 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Complete 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciVersion 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci Last Modified Date: September 18, 2014 205bd8deadSopenharmony_ci Author Revision: 2 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ci Based on: GLX_SGI_make_current_read specification 235bd8deadSopenharmony_ci Date: 3/20/1997 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci EXT_framebuffer_object specification 265bd8deadSopenharmony_ci Date: 2/13/2007 Revision #119 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ciNumber 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci 398 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciDependencies 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci OpenGL 1.5 is required. 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci GLX 1.3 is required. 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci GL_EXT_framebuffer_object is required. 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci GLX_ARB_get_proc_address is required. 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci This extension interacts with GLX_SGI_make_current_read. 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci This extension interacts with GL_EXT_framebuffer_blit. 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci This extension interacts with GLX_ARB_create_context. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci This extension interacts with WGL_AMD_gpu_association. 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ciOverview 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci There currently is no way for applications to efficiently use GPU 545bd8deadSopenharmony_ci resources in systems that contain more than one GPU. Vendors have 555bd8deadSopenharmony_ci provided methods that attempt to split the workload for an 565bd8deadSopenharmony_ci application among the available GPU resources. This has proven to be 575bd8deadSopenharmony_ci very inefficient because most applications were never written with 585bd8deadSopenharmony_ci these sorts of optimizations in mind. 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci This extension provides a mechanism for applications to explicitly 615bd8deadSopenharmony_ci use the GPU resources on a given system individually. By providing 625bd8deadSopenharmony_ci this functionality, a driver allows applications to make appropriate 635bd8deadSopenharmony_ci decisions regarding where and when to distribute rendering tasks. 645bd8deadSopenharmony_ci 655bd8deadSopenharmony_ci The set of GPUs available on a system can be queried by calling 665bd8deadSopenharmony_ci glXGetGPUIDsAMD. The current GPU assigned to a specific context 675bd8deadSopenharmony_ci can be determined by calling glXGetContextGPUIDAMD. Each GPU in a 685bd8deadSopenharmony_ci system may have different performance characteristics in addition 695bd8deadSopenharmony_ci to supporting a different version of OpenGL. The specifics of each 705bd8deadSopenharmony_ci GPU can be obtained by calling glXGetGPUInfo. This will allow 715bd8deadSopenharmony_ci applications to pick the most appropriate GPU for each rendering 725bd8deadSopenharmony_ci task. 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci Once all necessary GPU information has been obtained, a context tied 755bd8deadSopenharmony_ci to a specific GPU can be created with glXCreateAssociatedContextAMD. 765bd8deadSopenharmony_ci These associated contexts can be made current with 775bd8deadSopenharmony_ci glXMakeAssociatedContextCurrentAMD and deleted with 785bd8deadSopenharmony_ci glXDeleteAssociatedContextAMD. Only one GPU associated or 795bd8deadSopenharmony_ci non-associated context can be current at one time per thread. 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci To provide an accelerated path for blitting data from one context 825bd8deadSopenharmony_ci to another, the new blit function BlitContextFramebufferAMD has 835bd8deadSopenharmony_ci been added. 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ciNew Procedures and Functions 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci unsigned int glXGetGPUIDsAMD(unsigned int maxCount, unsigned int *ids); 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci int glXGetGPUInfoAMD(unsigned int id, int property, GLenum dataType, 935bd8deadSopenharmony_ci unsigned int size, void *data) 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci unsigned int glXGetContextGPUIDAMD(GLXContext ctx); 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci GLXContext glXCreateAssociatedContextAMD(unsigned int id, 985bd8deadSopenharmony_ci GLXContext share_list); 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci GLXContext glXCreateAssociatedContextAttribsAMD(unsigned int id, 1015bd8deadSopenharmony_ci GLXContext share_context, 1025bd8deadSopenharmony_ci const int *attribList); 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci Bool glXDeleteAssociatedContextAMD(GLXContext ctx); 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci Bool glXMakeAssociatedContextCurrentAMD(GLXContext ctx); 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci GLXContext glXGetCurrentAssociatedContextAMD(void); 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci void glXBlitContextFramebufferAMD(GLXContext dstCtx, GLint srcX0, GLint srcY0, 1115bd8deadSopenharmony_ci GLint srcX1, GLint srcY1, GLint dstX0, 1125bd8deadSopenharmony_ci GLint dstY0, GLint dstX1, GLint dstY1, 1135bd8deadSopenharmony_ci GLbitfield mask, GLenum filter); 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ciNew Tokens 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci Accepted by the <property> parameter of glXGetGPUInfo: 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci GLX_GPU_VENDOR_AMD 0x1F00 1205bd8deadSopenharmony_ci GLX_GPU_RENDERER_STRING_AMD 0x1F01 1215bd8deadSopenharmony_ci GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 1225bd8deadSopenharmony_ci GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 1235bd8deadSopenharmony_ci GLX_GPU_RAM_AMD 0x21A3 1245bd8deadSopenharmony_ci GLX_GPU_CLOCK_AMD 0x21A4 1255bd8deadSopenharmony_ci GLX_GPU_NUM_PIPES_AMD 0x21A5 1265bd8deadSopenharmony_ci GLX_GPU_NUM_SIMD_AMD 0x21A6 1275bd8deadSopenharmony_ci GLX_GPU_NUM_RB_AMD 0x21A7 1285bd8deadSopenharmony_ci GLX_GPU_NUM_SPI_AMD 0x21A8 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci Accepted by the <dataType> argument of glXGetGPUInfoAMD: 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci GL_UNSIGNED_BYTE 1335bd8deadSopenharmony_ci GL_UNSIGNED_INT 1345bd8deadSopenharmony_ci GL_INT 1355bd8deadSopenharmony_ci GL_FLOAT 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci Accepted by the <mask> argument of glXBlitContextFramebufferAMD: 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci GL_COLOR_BUFFER_BIT 1405bd8deadSopenharmony_ci GL_DEPTH_BUFFER_BIT 1415bd8deadSopenharmony_ci GL_STENCIL_BUFFER_BIT 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ciAdditions to the WGL Specification 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci None. This specification is written for GLX. 1465bd8deadSopenharmony_ci 1475bd8deadSopenharmony_ciAdditions to the GLX 1.4 Specification 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci Add a new section in between 3.3.7 and 3.3.8 entitled "GPU 1505bd8deadSopenharmony_ci Associated Contexts" 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ci GPU Associated Contexts 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci When multiple GPUs are present, a context can be created for 1555bd8deadSopenharmony_ci off-screen rendering that is associated with a specific GPU. 1565bd8deadSopenharmony_ci This will allow applications to achieve an app-specific 1575bd8deadSopenharmony_ci distributed GPU utilization. 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci The IDs for available GPUs can be queried with the command: 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci unsigned int glXGetGPUIDsAMD(unsigned int maxCount, unsigned int *ids); 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci where <maxCount> is the max number of IDs that can be returned and 1645bd8deadSopenharmony_ci <ids> is the array of returned IDs. If the function succeeds, 1655bd8deadSopenharmony_ci the return value is the number of total GPUs available. The 1665bd8deadSopenharmony_ci value 0 is returned if no GPUs are available or if the call has 1675bd8deadSopenharmony_ci failed. The array pointer <ids> passed into the function will be 1685bd8deadSopenharmony_ci populated by the smaller of maxCount or the total GPU count 1695bd8deadSopenharmony_ci available. The ID 0 is reserved and will not be retuned as a 1705bd8deadSopenharmony_ci valid GPU ID. If the array <ids> is NULL, the function will 1715bd8deadSopenharmony_ci only return the total number of GPUs. <ids> will be tightly packed 1725bd8deadSopenharmony_ci with no 0 values between valid ids. 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci Calling glXGetGPUIDsAMD once with <maxCount> set to zero returns 1755bd8deadSopenharmony_ci the total available GPU count which can be used to allocate an 1765bd8deadSopenharmony_ci appropriately sized id array before calling glXGetGPUIDsAMD 1775bd8deadSopenharmony_ci again to query the full set of supported GPUs. 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci Each GPU in a system may have different properties, performance 1805bd8deadSopenharmony_ci characteristics and different supported OpenGL versions. To 1815bd8deadSopenharmony_ci determine which GPU is best suited for a specific task the 1825bd8deadSopenharmony_ci following functions may be used: 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci int glXGetGPUInfoAMD(unsigned int id, int property, GLenum dataType, 1855bd8deadSopenharmony_ci unsigned int size, void *data); 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ci <id> is a GPU id obtained from calling glXGetGPUIDsAMD. The GPU ID 1885bd8deadSopenharmony_ci must be a valid GPU ID. The function will fail if <id> is an invalid 1895bd8deadSopenharmony_ci GPU ID and -1 will be returned. <property> is the information being 1905bd8deadSopenharmony_ci queried. <dataType> may be GL_UNSIGNED_INT, GL_INT, GL_FLOAT, or 1915bd8deadSopenharmony_ci GL_UNSIGNED_BYTE and signals what data type is to be returned. <size> 1925bd8deadSopenharmony_ci signals the size of the data buffer passed into glXGetGPUInfoAMD. 1935bd8deadSopenharmony_ci This is the count of the array of type <dataType>. <data> is the 1945bd8deadSopenharmony_ci buffer which will be filled with the requested information. For a 1955bd8deadSopenharmony_ci string, <size> will be the number of characters allocated and will 1965bd8deadSopenharmony_ci include NULL termination. For arrays of type GL_UNSIGNED_INT, GL_INT, 1975bd8deadSopenharmony_ci and GL_FLOAT <size> will be the array depth. If the function 1985bd8deadSopenharmony_ci succeeds, the number of values written will be returned. If the number 1995bd8deadSopenharmony_ci of values written is equal to <size>, the query should be repeated with 2005bd8deadSopenharmony_ci a larger <data> buffer. Strings should be queried using the 2015bd8deadSopenharmony_ci GL_UNSIGNED_BYTE type, are UTF-8 encoded and will be NULL terminated. 2025bd8deadSopenharmony_ci If the function fails, -1 will be returned. 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci <property> defines the GPU property to be queried, and may be one of 2055bd8deadSopenharmony_ci GLX_GPU_OPENGL_VERSION_STRING_AMD, GLX_GPU_RENDERER_STRING_AMD, 2065bd8deadSopenharmony_ci GLX_GPU_FASTEST_TARGET_GPUS_AMD, GLX_GPU_RAM_AMD, GLX_GPU_CLOCK_AMD, 2075bd8deadSopenharmony_ci GLX_GPU_NUM_PIPES_AMD, GLX_GPU_NUM_SIMD_AMD, GLX_GPU_NUM_RB_AMD, or 2085bd8deadSopenharmony_ci GLX_GPU_NUM_SPI_AMD. 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci If <size> is not sufficient to hold the entire value for a particular 2115bd8deadSopenharmony_ci property, the number of values returned will equal <size>. If 2125bd8deadSopenharmony_ci <dataType> is inappropriate for <property>, for instance INT for a 2135bd8deadSopenharmony_ci property which is a string, the function will fail and -1 will be 2145bd8deadSopenharmony_ci returned. 2155bd8deadSopenharmony_ci 2165bd8deadSopenharmony_ci Querying GLX_GPU_OPENGL_VERSION_STRING_AMD returns the highest supported 2175bd8deadSopenharmony_ci OpenGL version string and GLX_GPU_RENDERER_STRING_AMD returns name 2185bd8deadSopenharmony_ci of the GPU. <dataType> must be GL_UNSIGNED_BYTE with the previous 2195bd8deadSopenharmony_ci properties. Querying GLX_GPU_FASTEST_TARGET_GPUS_AMD returns an array 2205bd8deadSopenharmony_ci of the IDs of GPUs with the fastest data blit rates when using 2215bd8deadSopenharmony_ci glXBlitContextFramebufferAMD. This list is ordered fastest 2225bd8deadSopenharmony_ci first. This provides a performance hint about which contexts and GPUS 2235bd8deadSopenharmony_ci are capable of transfering data between each other the quickest. Querying 2245bd8deadSopenharmony_ci GLX_GPU_RAM_AMD returns the amount of RAM available to GPU in MB. Querying 2255bd8deadSopenharmony_ci GLX_GPU_CLOCK_AMD returns the GPU clock speed in MHz. Querying 2265bd8deadSopenharmony_ci GLX_GPU_NUM_PIPES_AMD returns the nubmer of 3D pipes. Querying 2275bd8deadSopenharmony_ci GLX_GPU_NUM_SIMD_AMD returns the number of SIMD ALU units in each 2285bd8deadSopenharmony_ci shader pipe. Querying GLX_GPU_NUM_RB_AMD returns the number of render 2295bd8deadSopenharmony_ci backends. Querying GLX_GPU_NUM_SPI_AMD returns the number of shader 2305bd8deadSopenharmony_ci parameter interpolaters. If the <parameter> being queried is not 2315bd8deadSopenharmony_ci applicable for the GPU specified by <id>, the value 0 will be returned. 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci Unassociated contexts are created by calling glXCreateNewContext. 2345bd8deadSopenharmony_ci Although these contexts are unassociated, their use will still be 2355bd8deadSopenharmony_ci tied to a single GPU in most cases. For this reason it is advantageous 2365bd8deadSopenharmony_ci to be able to query the GPU an existing unassociated context resides 2375bd8deadSopenharmony_ci on. If multiple GPUs are available, it would be undesirable 2385bd8deadSopenharmony_ci to use one for rendering to visible surfaces and then chose the 2395bd8deadSopenharmony_ci same one for off-screen rendering. Use the following command to 2405bd8deadSopenharmony_ci determine which GPU a context is attached to: 2415bd8deadSopenharmony_ci 2425bd8deadSopenharmony_ci unsigned int glXGetContextGPUIDAMD(GLXContext ctx); 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ci <ctx> is the context for which the GPU id will be returned. If the 2455bd8deadSopenharmony_ci context is invalid or if an error has occurred, glXGetContextGPUIDAMD 2465bd8deadSopenharmony_ci will return 0. 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ci To create an associated context, use: 2495bd8deadSopenharmony_ci 2505bd8deadSopenharmony_ci GLXContext glXCreateAssociatedContextAMD(unsigned int id, 2515bd8deadSopenharmony_ci GLXContext share_list); 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ci <id> must be a valid GPU id and cannot be 0. <share_list> must either 2545bd8deadSopenharmony_ci be NULL or that of an associated context created with the the same GPU 2555bd8deadSopenharmony_ci ID as <id>. If <share_list> was created using a different ID, 2565bd8deadSopenharmony_ci glXCreateAssociatedContextAMD will fail and return NULL. If a context was 2575bd8deadSopenharmony_ci successfully created the handle will be returned by 2585bd8deadSopenharmony_ci glXCreateAssociatedContextAMD. If a context could not be created, NULL 2595bd8deadSopenharmony_ci will be returned. If a context could not be created, error information 2605bd8deadSopenharmony_ci can be obtained by calling GetLastError. Upon successful creation, 2615bd8deadSopenharmony_ci no pixel format is tied to an associated context and the context is not 2625bd8deadSopenharmony_ci tied to a specific Display. Associated contexts are always direct contexts. 2635bd8deadSopenharmony_ci Associated Contexts always support only GLX_RGBA_TYPE rendering type. 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ci glXCreateAssociatedContextAMD can generate the following errors: 2665bd8deadSopenharmony_ci GLXBadContext if <share_list> is neither zero nor a valid GLX rendering 2675bd8deadSopenharmony_ci context; BadMatch if the server context state for share list exists in 2685bd8deadSopenharmony_ci an address space that cannot be shared with the newly created context 2695bd8deadSopenharmony_ci or if share list was created on a different screen than the one 2705bd8deadSopenharmony_ci referenced by config; BadAlloc if the server does not have enough resources 2715bd8deadSopenharmony_ci to allocate the new context. 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci To create an associated context and request a specific GL version, use: 2745bd8deadSopenharmony_ci 2755bd8deadSopenharmony_ci GLXContext glXCreateAssociatedContextAttribsAMD(unsigned int id, 2765bd8deadSopenharmony_ci GLXContext share_list, const int *attribList) 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ci All capabilities and limitations of glXCreateContextAttribsARB apply 2795bd8deadSopenharmony_ci to glXCreateAssociatedContextAttribsAMD. Additionally, <id> must be 2805bd8deadSopenharmony_ci a valid GPU ID and cannot be 0. If a context was successfully created 2815bd8deadSopenharmony_ci the handle will be returned by glXCreateAssociatedContextAttribsAMD. 2825bd8deadSopenharmony_ci If a context could not be created, NULL will be returned. Upon 2835bd8deadSopenharmony_ci successful creation, no pixel format is tied to an associated context. 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci <share_list> must either be NULL or that of an associated context created 2865bd8deadSopenharmony_ci with the the same GPU ID as <id>. If <share_list> was created using a 2875bd8deadSopenharmony_ci different ID, glXCreateAssociatedContextAttribsAMD will fail and return NULL. 2885bd8deadSopenharmony_ci 2895bd8deadSopenharmony_ci glXCreateAssociatedContextAttribsAMD can generate the following errors: 2905bd8deadSopenharmony_ci GLXBadContext if <share_list> is neither zero nor a valid GLX rendering 2915bd8deadSopenharmony_ci context; BadMatch if the server context state for share list exists in 2925bd8deadSopenharmony_ci an address space that cannot be shared with the newly created context 2935bd8deadSopenharmony_ci or if share list was created on a different screen than the one 2945bd8deadSopenharmony_ci referenced by config; BadAlloc if the server does not have enough resources 2955bd8deadSopenharmony_ci to allocate the new context. 2965bd8deadSopenharmony_ci 2975bd8deadSopenharmony_ci A context must be deleted once it is no longer needed. Use the 2985bd8deadSopenharmony_ci following call to delete an associated context: 2995bd8deadSopenharmony_ci 3005bd8deadSopenharmony_ci Bool glXDeleteAssociatedContextAMD(GLXContext ctx); 3015bd8deadSopenharmony_ci 3025bd8deadSopenharmony_ci If the function succeeds, TRUE will be returned, otherwise FALSE is 3035bd8deadSopenharmony_ci returned. <ctx> must be a valid associated context created by 3045bd8deadSopenharmony_ci calling glXCreateAssociatedContextAMD. If an unassociated context, 3055bd8deadSopenharmony_ci created by calling glXCreateNewContext, is passed into <ctx>, the 3065bd8deadSopenharmony_ci function will fail. An associated context cannot be deleted by calling 3075bd8deadSopenharmony_ci glXDestroyContext. If an associated context is passed into 3085bd8deadSopenharmony_ci glXDestroyContext, the result is undefiend. 3095bd8deadSopenharmony_ci 3105bd8deadSopenharmony_ci To render using an associated context, it must be made the current 3115bd8deadSopenharmony_ci context for a thread: 3125bd8deadSopenharmony_ci 3135bd8deadSopenharmony_ci Bool glXMakeAssociatedContextCurrentAMD(GLXContext ctx); 3145bd8deadSopenharmony_ci 3155bd8deadSopenharmony_ci <ctx> is a context handle created by calling 3165bd8deadSopenharmony_ci glXCreateAssociatedContextAMD. If <ctx> was created using 3175bd8deadSopenharmony_ci glXCreateNewContext, the call will fail, FALSE will be returned and 3185bd8deadSopenharmony_ci the error BadAccess will be generated. If <ctx> is not a valid context 3195bd8deadSopenharmony_ci and not NULL, the call will fail, FALSE will be returned and the error 3205bd8deadSopenharmony_ci GLXBadContext will be generated. If the call succeeds, TRUE will be 3215bd8deadSopenharmony_ci returned. To detach the current associated context, pass NULL as <ctx>. 3225bd8deadSopenharmony_ci 3235bd8deadSopenharmony_ci Only one type of context can be current to a thread at a time. If an 3245bd8deadSopenharmony_ci unassociated context is current to a thread when 3255bd8deadSopenharmony_ci glXMakeAssociatedContextCurrentAMD is called with a valid <ctx>, it 3265bd8deadSopenharmony_ci is as if glxMakeContextCurrent is called first with a ctx value of NULL. 3275bd8deadSopenharmony_ci If an associated context is current and glxMakeContextCurrent is called 3285bd8deadSopenharmony_ci with a valid context, it is as if glXMakeAssociatedContextCurrentAMD is 3295bd8deadSopenharmony_ci called with a ctx value of NULL. 3305bd8deadSopenharmony_ci 3315bd8deadSopenharmony_ci The current associated context can be queried by calling: 3325bd8deadSopenharmony_ci 3335bd8deadSopenharmony_ci GLXContext glXGetCurrentAssociatedContextAMD(void); 3345bd8deadSopenharmony_ci 3355bd8deadSopenharmony_ci The current associated context is returned on a successful call to 3365bd8deadSopenharmony_ci this function. If no associated context is current, NULL is returned. 3375bd8deadSopenharmony_ci If an unassociated context is current, NULL will be returned. 3385bd8deadSopenharmony_ci 3395bd8deadSopenharmony_ci An associated context can not be passed in as a parameter into 3405bd8deadSopenharmony_ci glXCopyContext. If an associated context is passed into glXCopyContext, 3415bd8deadSopenharmony_ci the error GLXBadContext will be generated. 3425bd8deadSopenharmony_ci 3435bd8deadSopenharmony_ci The addresses returned from glXGetProcAddressARB are only valid for the 3445bd8deadSopenharmony_ci current context. It may be invalid to use proc addresses obtained from 3455bd8deadSopenharmony_ci a traditional context with an associated context. Furthermore, the 3465bd8deadSopenharmony_ci OpenGL version and extensions supported on an associated context may 3475bd8deadSopenharmony_ci differ. Each context should be treated seperately, proc addressses 3485bd8deadSopenharmony_ci should be queried for each after context creation. 3495bd8deadSopenharmony_ci 3505bd8deadSopenharmony_ci Calls to glXSwapBuffers when an associated context is current will have 3515bd8deadSopenharmony_ci no effect. 3525bd8deadSopenharmony_ci 3535bd8deadSopenharmony_ci There is no way to use pBuffers with associated contexts. 3545bd8deadSopenharmony_ci 3555bd8deadSopenharmony_ci Overlays and underlays are not supported with associated contexts. 3565bd8deadSopenharmony_ci 3575bd8deadSopenharmony_ci The same associated context is used for both write and read operations. 3585bd8deadSopenharmony_ci 3595bd8deadSopenharmony_ci To facilitate high performance data communication between multiple 3605bd8deadSopenharmony_ci contexts, a new function is necessary to blit data from one context 3615bd8deadSopenharmony_ci to another. 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ci VOID glXBlitContextFramebufferAMD(GLXContext dstCtx, GLint srcX0, GLint srcY0, 3645bd8deadSopenharmony_ci GLint srcX1, GLint srcY1, GLint dstX0, 3655bd8deadSopenharmony_ci GLint dstY0, GLint dstX1, GLint dstY1, 3665bd8deadSopenharmony_ci GLbitfield mask, GLenum filter); 3675bd8deadSopenharmony_ci 3685bd8deadSopenharmony_ci <dstCtx> is the context handle for the write context. <mask> is the 3695bd8deadSopenharmony_ci bitwise OR of a number of values indicating which buffers are to be 3705bd8deadSopenharmony_ci copied. The values are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, and 3715bd8deadSopenharmony_ci GL_STENCIL_BUFFER_BIT, which are described in section 4.2.3. The 3725bd8deadSopenharmony_ci pixels corresponding to these buffers are copied from the source 3735bd8deadSopenharmony_ci rectangle, bound by the locations (srcX0, srcY0) and (srcX1, srcY1), 3745bd8deadSopenharmony_ci to the destination rectangle, bound by the locations (dstX0, dstY0) 3755bd8deadSopenharmony_ci and (dstX1, dstY1). The lower bounds of the rectangle are inclusive, 3765bd8deadSopenharmony_ci while the upper bounds are exclusive. 3775bd8deadSopenharmony_ci 3785bd8deadSopenharmony_ci The source context is the current GL context. Specifying the current 3795bd8deadSopenharmony_ci GL context as the <dstCtx> will result in the error 3805bd8deadSopenharmony_ci GL_INVALID_OPERATION being generated. If <dstCtx> is invalid, the 3815bd8deadSopenharmony_ci error GL_INVALID_OPERATION will be generated. If no context is 3825bd8deadSopenharmony_ci current at the time of this call, the error GL_INVALID_OPERATION 3835bd8deadSopenharmony_ci will be generated. These errors may be queried by calling glGetError. 3845bd8deadSopenharmony_ci The target framebuffer will be the framebuffer bound to 3855bd8deadSopenharmony_ci GL_DRAW_FRAMEBUFFER_EXT in the context <dstCtx>. The source framebuffer 3865bd8deadSopenharmony_ci will be the framebuffer bound to GL_READ_FRAMEBUFFER_EXT in the 3875bd8deadSopenharmony_ci currently bound context. 3885bd8deadSopenharmony_ci 3895bd8deadSopenharmony_ci The restrictions that apply to the source and destination rectangles 3905bd8deadSopenharmony_ci specified with <srcX0>, <srcY0>, <srcX1>, <srcY1>, <dstX0>, <dstY0> 3915bd8deadSopenharmony_ci <dstX0>, and <dstY0> are the same as those that apply for 3925bd8deadSopenharmony_ci glBlitFramebufferEXT. The same error conditions exist as for 3935bd8deadSopenharmony_ci glBlitFramebufferEXT. 3945bd8deadSopenharmony_ci 3955bd8deadSopenharmony_ci When called, this function will execute immediately in the currently 3965bd8deadSopenharmony_ci bound context. It is up to the caller to maintain appropriate 3975bd8deadSopenharmony_ci synchronization between the current context and <dstCtx> to ensure 3985bd8deadSopenharmony_ci rendering to the appropriate surfaces has completed on the current 3995bd8deadSopenharmony_ci and <dstCtx> contexts. 4005bd8deadSopenharmony_ci 4015bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.5 Specification (Per-Fragment 4025bd8deadSopenharmony_ciOperations and the Frame Buffer) 4035bd8deadSopenharmony_ciModify the beginning of section 4.4.1 as follows: 4045bd8deadSopenharmony_ci 4055bd8deadSopenharmony_ci When an assoicated context is bound, the default state for an associated 4065bd8deadSopenharmony_ci context is invalid for rendering. Because there is no attached window, 4075bd8deadSopenharmony_ci there is no default framebuffer surface to render to. An app created 4085bd8deadSopenharmony_ci framebuffer object must be bound for rendering to be valid. If the 4095bd8deadSopenharmony_ci object bound to GL_FRAMEBUFFER_BINDING_EXT is 0, it is as if the 4105bd8deadSopenharmony_ci framebuffer is incomplete, and an 4115bd8deadSopenharmony_ci GL_INVALID_FRAMEBUFFER_OPERATION_EXT error will be generated 4125bd8deadSopenharmony_ci where rendering is attempted. 4135bd8deadSopenharmony_ci 4145bd8deadSopenharmony_ci 4155bd8deadSopenharmony_ciNew State 4165bd8deadSopenharmony_ci 4175bd8deadSopenharmony_ci None 4185bd8deadSopenharmony_ci 4195bd8deadSopenharmony_ci 4205bd8deadSopenharmony_ciInteractions with GL_EXT_framebuffer_blit 4215bd8deadSopenharmony_ci 4225bd8deadSopenharmony_ci If the framebuffer blit extension is not supported, all language 4235bd8deadSopenharmony_ci referring to glBlitFramebufferEXT and glXBlitContextFramebufferAMD 4245bd8deadSopenharmony_ci is removed. 4255bd8deadSopenharmony_ci 4265bd8deadSopenharmony_ciInteractions with GL_EXT_framebuffer_object 4275bd8deadSopenharmony_ci 4285bd8deadSopenharmony_ci If GLX_AMD_gpu_association is supported, a context created with it 4295bd8deadSopenharmony_ci will also support EXT_framebuffer_object. 4305bd8deadSopenharmony_ci 4315bd8deadSopenharmony_ci 4325bd8deadSopenharmony_ciInteractions with GLX_SGI_make_current_read 4335bd8deadSopenharmony_ci 4345bd8deadSopenharmony_ci If the make current read extension is supported, it is invalid to pass 4355bd8deadSopenharmony_ci an associated context handle as a parameter to 4365bd8deadSopenharmony_ci glXMaketCurrentReadSGI. If an associated context is passed into 4375bd8deadSopenharmony_ci glXMaketCurrentReadSGI, the error GLXBadContext will be generated. 4385bd8deadSopenharmony_ci 4395bd8deadSopenharmony_ciInteractions with GLX_create_context 4405bd8deadSopenharmony_ci 4415bd8deadSopenharmony_ci If GLX_create_context is not supported, all language 4425bd8deadSopenharmony_ci referring to glXCreateAssociatedContextAttribsAMD is removed. 4435bd8deadSopenharmony_ci 4445bd8deadSopenharmony_ci 4455bd8deadSopenharmony_ciIssues 4465bd8deadSopenharmony_ci 4475bd8deadSopenharmony_ci 1) Should the language for the new context creation methods be added to 4485bd8deadSopenharmony_ci GLX 1.4 section 3.3.7 or in a new section? 4495bd8deadSopenharmony_ci 4505bd8deadSopenharmony_ci Resolved. Although it is also possible to add this exension text to 4515bd8deadSopenharmony_ci section 3.3.7, the resulting text would not flow well or be as coherent. 4525bd8deadSopenharmony_ci 4535bd8deadSopenharmony_ci 4545bd8deadSopenharmony_ciRevision History 4555bd8deadSopenharmony_ci 4565bd8deadSopenharmony_ci 4575bd8deadSopenharmony_ci Rev. Date Author Changes 4585bd8deadSopenharmony_ci ---- -------- -------- --------------------------------------------- 4595bd8deadSopenharmony_ci 4605bd8deadSopenharmony_ci 2 09/18/2014 gsellers Fixed types in function prototypes. 4615bd8deadSopenharmony_ci Update contact. Minor formatting fixes. 4625bd8deadSopenharmony_ci 0.1 11/04/2009 nickh Initial version. 463