15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_no_config_context 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GLX_EXT_no_config_context 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Adam Jackson 125bd8deadSopenharmony_ci Kyle Brenneman 135bd8deadSopenharmony_ci James Jones 145bd8deadSopenharmony_ci Alex Goins 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci This extension is derived from EGL_KHR_no_config_context, whose 175bd8deadSopenharmony_ci contributors include: 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci Etay Meiri 205bd8deadSopenharmony_ci Alon Or-bach 215bd8deadSopenharmony_ci Jeff Vigil 225bd8deadSopenharmony_ci Ray Smith 235bd8deadSopenharmony_ci Michael Gold 245bd8deadSopenharmony_ci James Jones 255bd8deadSopenharmony_ci Daniel Kartch 265bd8deadSopenharmony_ci Adam Jackson 275bd8deadSopenharmony_ci Jon Leech 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ciContact 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ci Adam Jackson <ajax@redhat.com> 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ciIP Status 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci No known IP claims. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ciStatus 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci Complete. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciVersion 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci Version 8, 2020/10/05 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ciNumber 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci OpenGL Extension #553 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ciDependencies 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci GLX_ARB_create_context is required. 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci Interacts with GLX_ARB_fbconfig_float. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci Interacts with GLX_EXT_fbconfig_packed_float. 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci This extension is written against the GLX 1.4 Specification. 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci Some of the capabilities of these extensions are only available when 605bd8deadSopenharmony_ci creating OpenGL or OpenGL ES contexts supporting specific versions or 615bd8deadSopenharmony_ci capabilities. All such restrictions are documented in the body of this 625bd8deadSopenharmony_ci extension specification. 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ciOverview 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci Modern GPUs allow contexts to render to almost any combination of 675bd8deadSopenharmony_ci supported color and auxiliary buffer formats. Traditionally GLX context 685bd8deadSopenharmony_ci creation is done with respect to a GLXFBConfig specifying buffer formats, 695bd8deadSopenharmony_ci and constrains contexts to only work with drawables created with a 705bd8deadSopenharmony_ci "compatible" config. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci This extension allows creation of GL & ES contexts without specifying a 735bd8deadSopenharmony_ci GLXFBConfig. 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ciNew Procedures and Functions 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci None. 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ciNew Tokens 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci None. 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ciAdditions to the GLX_ARB_create_context Specification 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci To the paragraph beginning "If glXCreateContextAttribsARB succeeds", 865bd8deadSopenharmony_ci append: 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci "If <config> is NULL, the context will be created without reference to a 895bd8deadSopenharmony_ci config. In this case, the attribute list must include GLX_SCREEN, naming 905bd8deadSopenharmony_ci the screen for the context; if GLX_SCREEN is not specified, or 915bd8deadSopenharmony_ci GLX_RENDER_TYPE is specified, BadValue is generated." 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ciAdditions to the GLX 1.4 Specification 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci In section 2.1 "Rendering Contexts and Drawing Surfaces", modify the 965bd8deadSopenharmony_ci 5th paragraph: 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci "A rendering context can be used with any GLXDrawable that it is 995bd8deadSopenharmony_ci compatible with (subject to the restrictions discussed in the section on 1005bd8deadSopenharmony_ci address space and the restrictions discussed under glXCreatePixmap). A 1015bd8deadSopenharmony_ci drawable and context are compatible if either of the following sets of 1025bd8deadSopenharmony_ci conditions are true: 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci * The context was created with NULL GLXFBConfig 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci * The drawable and context are on the same screen 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci or: 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci [...]" 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci Append a new paragraph to the end of section 2.1 "Rendering Contexts 1135bd8deadSopenharmony_ci and Drawing Surfaces": 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci "If NULL was specified as the GLXFBConfig at creation, the resulting 1165bd8deadSopenharmony_ci context is said to be created <without reference to a config>. In this 1175bd8deadSopenharmony_ci case, the context must pass the required conformance tests for the version 1185bd8deadSopenharmony_ci of OpenGL/OpenGL ES it supports, and must support being made current 1195bd8deadSopenharmony_ci without a drawable. Such support is guaranteed for OpenGL ES 2.0 1205bd8deadSopenharmony_ci implementations supporting the GL_OES_surfaceless_context extension, 1215bd8deadSopenharmony_ci OpenGL ES 3.0 and later versions of OpenGL ES, and OpenGL 3.0 and later 1225bd8deadSopenharmony_ci versions of OpenGL. Such contexts are compatible with any drawable on the 1235bd8deadSopenharmony_ci same screen, though the version of OpenGL or OpenGL ES in use may impose 1245bd8deadSopenharmony_ci further restrictions. For example, forward-compatible OpenGL 3.0 contexts 1255bd8deadSopenharmony_ci can not render to color index drawables, even if color index GLXFBConfigs 1265bd8deadSopenharmony_ci are available." 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci In section 3.3.7 "Rendering Contexts" in the discussion of glXQueryContext, 1295bd8deadSopenharmony_ci to the paragraph beginning "The values and types", append: 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci "If the context was created without reference to a config, the value 1325bd8deadSopenharmony_ci of GLX_RENDER_TYPE will be GLX_DONT_CARE, and the values of 1335bd8deadSopenharmony_ci GLX_FBCONFIG_ID and GLX_VISUAL_ID_EXT will be None." 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ciInteractions with GLX_ARB_fbconfig_float 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci A context created without reference to a config may be used to render to 1385bd8deadSopenharmony_ci drawables whose config has GLX_RGBA_FLOAT_BIT_ARB set. 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ciInteractions with GLX_EXT_fbconfig_packed_float 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci A context created without reference to a config may be used to render to 1435bd8deadSopenharmony_ci drawables whose config has GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT set. 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ciErrors 1465bd8deadSopenharmony_ci 1475bd8deadSopenharmony_ci No new error types are added. 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ciGLX Protocol 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci No new requests are added. 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci For GLXCreateContextAttribsARB, normally the client library derives the 1545bd8deadSopenharmony_ci <screen> field in the request from the specified fbconfig. When the 1555bd8deadSopenharmony_ci fbconfig is NULL, the GLX_SCREEN attribute and the <screen> field must 1565bd8deadSopenharmony_ci match, or BadValue is generated. This implies that the client library is 1575bd8deadSopenharmony_ci responsible for pulling the screen number out of the attribute list, since 1585bd8deadSopenharmony_ci glXCreateContextAttribsARB does not have an explicit screen parameter. 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ciIssues 1615bd8deadSopenharmony_ci 1625bd8deadSopenharmony_ci 1) Should non-conformant no-config contexts be allowed to be created? 1635bd8deadSopenharmony_ci 1645bd8deadSopenharmony_ci RESOLVED: No. We are not encouraging non-conformant contexts. This is 1655bd8deadSopenharmony_ci not a change, in the sense that CreateContextAttribs already does not 1665bd8deadSopenharmony_ci accept GLX_NON_CONFORMANT_CONFIG as an attribute. 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci What is required is: a no-context config bound to a drawable whose 1695bd8deadSopenharmony_ci config is conformant, or to no drawable, must be conformant. 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci 2) Are no-config contexts constrained to those GL & ES implementations 1725bd8deadSopenharmony_ci which can support them? 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci RESOLVED: Yes. ES2 + OES_surfaceless_context, ES 3.0, and GL 3.0 all 1755bd8deadSopenharmony_ci support binding a context without a drawable. This implies that they 1765bd8deadSopenharmony_ci don't need to know drawable attributes at context creation time. 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci In principle, equivalent functionality could be possible with ES 1.x + 1795bd8deadSopenharmony_ci OES_surfaceless_context. This extension makes no promises about that. An 1805bd8deadSopenharmony_ci implementation wishing to reliably support this combination, or a similarly 1815bd8deadSopenharmony_ci permissive combination for GL < 3.0, should indicate so with an additional 1825bd8deadSopenharmony_ci GLX extension. 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci 3) For an OpenGL or OpenGL ES context created with no config, what is the 1855bd8deadSopenharmony_ci initial state of GL_DRAW_BUFFER and GL_READ_BUFFER for the default 1865bd8deadSopenharmony_ci framebuffer? 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci RESOLVED: This is an implementation detail rather than a spec issue. 1895bd8deadSopenharmony_ci glReadBuffer/glDrawBuffer have undefined results if called without a 1905bd8deadSopenharmony_ci current context. The GL_DRAW_BUFFER and GL_READ_BUFFER are set on the 1915bd8deadSopenharmony_ci first glXMakeCurrent call and can be updated in glReadBuffer and 1925bd8deadSopenharmony_ci glDrawBuffers calls after that. Therefore, the attribute value with 1935bd8deadSopenharmony_ci which the context is created is irrelevant from the point of view of the 1945bd8deadSopenharmony_ci spec and is left up to the implementation. 1955bd8deadSopenharmony_ci 1965bd8deadSopenharmony_ci 4) Can glXMakeCurrent alter the GL_DRAW_BUFFER and GL_READ_BUFFER state of 1975bd8deadSopenharmony_ci the default framebuffer? 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ci RESOLVED: Yes, but only on the first call to glXMakeCurrent. The two 2005bd8deadSopenharmony_ci relevant excerpts from the OpenGL 3.2 Core Profile Specification. 2015bd8deadSopenharmony_ci From Section 4.2.1 Selecting a Buffer for Writing: 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci For the default framebuffer, in the initial state the draw buffer 2045bd8deadSopenharmony_ci for fragment color zero is BACK if there is a back buffer; FRONT if 2055bd8deadSopenharmony_ci there is no back buffer; and NONE if no default framebuffer is 2065bd8deadSopenharmony_ci associated with the context. 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ci From 4.3.3 Pixel Draw/Read State: 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci For the default framebuffer, in the initial state the read buffer is 2115bd8deadSopenharmony_ci BACK if there is a back buffer; FRONT if there is no back buffer; 2125bd8deadSopenharmony_ci and NONE if no default framebuffer is associated with the context. 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci Based on the above excerpts on the first call to glXMakeCurrent the 2155bd8deadSopenharmony_ci GL_DRAW_BUFFER and GL_READ_BUFFER are set to: GL_NONE if the drawable is 2165bd8deadSopenharmony_ci NULL, GL_BACK if the drawable is double buffered, GL_FRONT if the drawable 2175bd8deadSopenharmony_ci is single buffered. Following calls to glReadBuffer and glDrawBuffers 2185bd8deadSopenharmony_ci change the GL_DRAW_BUFFER and GL_READ_BUFFER attributes and these values 2195bd8deadSopenharmony_ci persist even when the application change the current context. 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci 5) Should we add a glXCreateGenericContext which is the same as 2225bd8deadSopenharmony_ci glXCreateContext but without the config parameter? 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ci RESOLVED: No. 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ci 6) Can no-config contexts share state with contexts that have a config? 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci RESOLVED: Yes, to the extent that the implementation would allow such 2295bd8deadSopenharmony_ci sharing if the contexts had the same config and compatible attributes. 2305bd8deadSopenharmony_ci 2315bd8deadSopenharmony_ci GLX_ARB_create_context has this to say about the <share_context> parameter: 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci "* If the server context state for <share_context> exists in an address 2345bd8deadSopenharmony_ci space that cannot be shared with the newly created context, if 2355bd8deadSopenharmony_ci <share_context> was created on a different screen than the one 2365bd8deadSopenharmony_ci referenced by <config>, or if the contexts are otherwise incompatible 2375bd8deadSopenharmony_ci (for example, one context being associated with a hardware device 2385bd8deadSopenharmony_ci driver and the other with a software renderer), BadMatch is generated." 2395bd8deadSopenharmony_ci 2405bd8deadSopenharmony_ci For this extension, "otherwise incompatible" might include mismatched GL 2415bd8deadSopenharmony_ci or ES versions, or versions that do not support making a context current 2425bd8deadSopenharmony_ci without a drawable. (This list is not intended to be exhaustive.) 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ci Other extensions like GLX_ARB_create_context_no_error and 2455bd8deadSopenharmony_ci GLX_ARB_create_context_robustness place additional restrictions on 2465bd8deadSopenharmony_ci share context compatibility; this extension does not relax them. 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ci 7) What drawable types can be made current with a no-config context? 2495bd8deadSopenharmony_ci 2505bd8deadSopenharmony_ci RESOLVED: Any drawable created relative to a supported config can be made 2515bd8deadSopenharmony_ci current with a no-config context. 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ci 8) Can you create a no-config context with glXCreate{,New}Context? 2545bd8deadSopenharmony_ci 2555bd8deadSopenharmony_ci RESOLVED: No. GLX contexts are per-screen. Although the corresponding 2565bd8deadSopenharmony_ci requests include the screen number, there is no way to specify it from 2575bd8deadSopenharmony_ci the function signature, the client library derives it from the visual 2585bd8deadSopenharmony_ci or the fbconfig. Only glXCreateContextAttribsARB is expressive enough. 2595bd8deadSopenharmony_ci 2605bd8deadSopenharmony_ci 9) Can you specify a no-config context with a specific GLX_RENDER_TYPE? 2615bd8deadSopenharmony_ci 2625bd8deadSopenharmony_ci RESOLVED: No. It might be possible to implement, but there seems to be 2635bd8deadSopenharmony_ci little point. 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ciRevision History 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci Version 8, 2020/10/05 (Adam Jackson) 2685bd8deadSopenharmony_ci - Add extension number 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ci Version 7, 2017/12/05 (Adam Jackson) 2715bd8deadSopenharmony_ci - Mark complete. 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci Version 6, 2017/10/04 (Adam Jackson) 2745bd8deadSopenharmony_ci - Clarify the float fbconfig extension interaction language 2755bd8deadSopenharmony_ci 2765bd8deadSopenharmony_ci Version 5, 2017/10/03 (Adam Jackson) 2775bd8deadSopenharmony_ci - s/GLX_NO_CONFIG_EXT/NULL/ 2785bd8deadSopenharmony_ci - s/surface/drawable/ 2795bd8deadSopenharmony_ci - Plain GL 3.0 doesn't fully drop color index, forward-compatible 3.0 does 2805bd8deadSopenharmony_ci - Clarify the interaction with non-conformant configs 2815bd8deadSopenharmony_ci - Reword references to "client API", which is an EGLism 2825bd8deadSopenharmony_ci - Add disclaimers about creating or sharing state with ES1 or GL<3 contexts 2835bd8deadSopenharmony_ci - Miscellaneous typo fixes 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci Version 4, 2017/09/26 (Adam Jackson) 2865bd8deadSopenharmony_ci - Tighten the GLX protocol to require the two screen numbers to match 2875bd8deadSopenharmony_ci 2885bd8deadSopenharmony_ci Version 3, 2017/09/21 (Adam Jackson) 2895bd8deadSopenharmony_ci - Restrict no-config contexts to glXCreateContextAttribsARB 2905bd8deadSopenharmony_ci - Add the GLX_VISUAL_ID_EXT case to glXQueryContext 2915bd8deadSopenharmony_ci - Forbid no-config contexts with a specific render type 2925bd8deadSopenharmony_ci - Get the screen from the attribute list not the <screen> request field 2935bd8deadSopenharmony_ci 2945bd8deadSopenharmony_ci Version 2, 2017/09/21 (Adam Jackson) 2955bd8deadSopenharmony_ci - Add the GLX_FBCONFIG_ID case to glXQueryContext 2965bd8deadSopenharmony_ci - Document the GLX protocol encoding 2975bd8deadSopenharmony_ci 2985bd8deadSopenharmony_ci Version 1, 2017/09/20 (Adam Jackson) 2995bd8deadSopenharmony_ci - Clone from version 9 of EGL_KHR_no_config_context 300