15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_framebuffer_object 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_framebuffer_object 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Kurt Akeley 125bd8deadSopenharmony_ci Jason Allen 135bd8deadSopenharmony_ci Rob Barris 145bd8deadSopenharmony_ci Bob Beretta 155bd8deadSopenharmony_ci Pat Brown 165bd8deadSopenharmony_ci Matt Craighead 175bd8deadSopenharmony_ci Alex Eddy 185bd8deadSopenharmony_ci Cass Everitt 195bd8deadSopenharmony_ci Mark Galvan 205bd8deadSopenharmony_ci Michael Gold 215bd8deadSopenharmony_ci Evan Hart 225bd8deadSopenharmony_ci Jeff Juliano 235bd8deadSopenharmony_ci John Kessenich 245bd8deadSopenharmony_ci Mark Kilgard 255bd8deadSopenharmony_ci Dale Kirkland 265bd8deadSopenharmony_ci Daniel Koch 275bd8deadSopenharmony_ci Jon Leech 285bd8deadSopenharmony_ci Bill Licea-Kane 295bd8deadSopenharmony_ci Barthold Lichtenbelt 305bd8deadSopenharmony_ci Kent Lin 315bd8deadSopenharmony_ci Rob Mace 325bd8deadSopenharmony_ci Teri Morrison 335bd8deadSopenharmony_ci Chris Niederauer 345bd8deadSopenharmony_ci Brian Paul 355bd8deadSopenharmony_ci Paul Puey 365bd8deadSopenharmony_ci Ian Romanick 375bd8deadSopenharmony_ci John Rosasco 385bd8deadSopenharmony_ci R. Jason Sams 395bd8deadSopenharmony_ci Jeremy Sandmel 405bd8deadSopenharmony_ci Mark Segal 415bd8deadSopenharmony_ci Avinash Seetharamaiah 425bd8deadSopenharmony_ci Folker Schamel 435bd8deadSopenharmony_ci Eskil Steenberg 445bd8deadSopenharmony_ci Daniel Vogel 455bd8deadSopenharmony_ci Eric Werness 465bd8deadSopenharmony_ci Cliff Woolley 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ciContacts 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci Rob Barris (rbarris 'at' gmail.com) 515bd8deadSopenharmony_ci Daniel Koch, TransGaming Inc. 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ciNotice 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci Copyright (c) 2008-2013 The Khronos Group Inc. Copyright terms at 565bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ciSpecification Update Policy 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 615bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 625bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 635bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 645bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 655bd8deadSopenharmony_ci described in more detail at 665bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ciStatus 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ci Approved by the ARB on August 4, 2008 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ciVersion 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci Last Modified Date: October 6, 2016 755bd8deadSopenharmony_ci Revision: #38 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ciNumber 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci ARB Extension #45 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ciDependencies 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci OpenGL 1.1 is required. 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci WGL_ARB_make_current_read affects the definition of this extension. 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci GLX 1.3 / GLX_SGI_make_current_read affects the definition of this 885bd8deadSopenharmony_ci extension. 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci ATI_draw_buffers affects the definition of this extension. 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci ARB_draw_buffers affects the definition of this extension. 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci ARB_fragment_program affects the definition of this extension. 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci ARB_fragment_shader affects the definition of this extension. 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci ARB_texture_rectangle affects the definition of this extension. 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci ARB_vertex_shader affects the definition of this extension. 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci NV_float_buffer affects the definition of this extension. 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci ARB_color_buffer_float affects the definition of this extension. 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci NV_texture_shader affects the definition of this extension. 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci This extension modifies NV_packed_depth_stencil. 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci ARB_depth_texture affects the definition of this extension. 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci SGIX_depth_texture affects the definition of this extension. 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci ARB_texture_rg affects the definition of this extension. 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci EXT_texture_array affects the definition of this extension. 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci EXT_texture_integer affects the definition of this extension. 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci ARB_framebuffer_sRGB affects the definition of this extension. 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci Written based on the wording of the OpenGL 2.1 specification. 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ciOverview 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci ARB_framebuffer_object is an extension intended to address the following 1275bd8deadSopenharmony_ci goals: 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci - Reflect FBO-related functionality found in the OpenGL 3.0 specification. 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci - Integrate multiple disjoint extensions into a single ARB extension. 1325bd8deadSopenharmony_ci These extensions are: 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ci EXT_framebuffer_object 1355bd8deadSopenharmony_ci EXT_framebuffer_blit 1365bd8deadSopenharmony_ci EXT_framebuffer_multisample 1375bd8deadSopenharmony_ci EXT_packed_depth_stencil 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci - Where appropriate, relax some of the constraints expressed by previous 1405bd8deadSopenharmony_ci FBO-related extensions. In particular the requirement of matching 1415bd8deadSopenharmony_ci attachment dimensions and component sizes has been relaxed, to allow 1425bd8deadSopenharmony_ci implementations the freedom to support more flexible usages where 1435bd8deadSopenharmony_ci possible. 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci ARB_framebuffer_object defines an interface for drawing to rendering 1475bd8deadSopenharmony_ci destinations other than the buffers provided to the GL by the 1485bd8deadSopenharmony_ci window-system. 1495bd8deadSopenharmony_ci 1505bd8deadSopenharmony_ci In this extension, these newly defined rendering destinations are 1515bd8deadSopenharmony_ci known collectively as "framebuffer-attachable images". This 1525bd8deadSopenharmony_ci extension provides a mechanism for attaching framebuffer-attachable 1535bd8deadSopenharmony_ci images to the GL framebuffer as one of the standard GL logical 1545bd8deadSopenharmony_ci buffers: color, depth, and stencil. (Attaching a 1555bd8deadSopenharmony_ci framebuffer-attachable image to the accum logical buffer is left for 1565bd8deadSopenharmony_ci a future extension to define). When a framebuffer-attachable image 1575bd8deadSopenharmony_ci is attached to the framebuffer, it is used as the source and 1585bd8deadSopenharmony_ci destination of fragment operations as described in Chapter 4. 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci By allowing the use of a framebuffer-attachable image as a rendering 1615bd8deadSopenharmony_ci destination, this extension enables a form of "offscreen" rendering. 1625bd8deadSopenharmony_ci Furthermore, "render to texture" is supported by allowing the images 1635bd8deadSopenharmony_ci of a texture to be used as framebuffer-attachable images. A 1645bd8deadSopenharmony_ci particular image of a texture object is selected for use as a 1655bd8deadSopenharmony_ci framebuffer-attachable image by specifying the mipmap level, cube 1665bd8deadSopenharmony_ci map face (for a cube map texture), and layer (for a 3D texture) 1675bd8deadSopenharmony_ci that identifies the image. The "render to texture" semantics of 1685bd8deadSopenharmony_ci this extension are similar to performing traditional rendering to 1695bd8deadSopenharmony_ci the framebuffer, followed immediately by a call to CopyTexSubImage. 1705bd8deadSopenharmony_ci However, by using this extension instead, an application can achieve 1715bd8deadSopenharmony_ci the same effect, but with the advantage that the GL can usually 1725bd8deadSopenharmony_ci eliminate the data copy that would have been incurred by calling 1735bd8deadSopenharmony_ci CopyTexSubImage. 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ci This extension also defines a new GL object type, called a 1765bd8deadSopenharmony_ci "renderbuffer", which encapsulates a single 2D pixel image. The 1775bd8deadSopenharmony_ci image of renderbuffer can be used as a framebuffer-attachable image 1785bd8deadSopenharmony_ci for generalized offscreen rendering and it also provides a means to 1795bd8deadSopenharmony_ci support rendering to GL logical buffer types which have no 1805bd8deadSopenharmony_ci corresponding texture format (stencil, accum, etc). A renderbuffer 1815bd8deadSopenharmony_ci is similar to a texture in that both renderbuffers and textures can 1825bd8deadSopenharmony_ci be independently allocated and shared among multiple contexts. The 1835bd8deadSopenharmony_ci framework defined by this extension is general enough that support 1845bd8deadSopenharmony_ci for attaching images from GL objects other than textures and 1855bd8deadSopenharmony_ci renderbuffers could be added by layered extensions. 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ci To facilitate efficient switching between collections of 1885bd8deadSopenharmony_ci framebuffer-attachable images, this extension introduces another new 1895bd8deadSopenharmony_ci GL object, called a framebuffer object. A framebuffer object 1905bd8deadSopenharmony_ci contains the state that defines the traditional GL framebuffer, 1915bd8deadSopenharmony_ci including its set of images. Prior to this extension, it was the 1925bd8deadSopenharmony_ci window-system which defined and managed this collection of images, 1935bd8deadSopenharmony_ci traditionally by grouping them into a "drawable". The window-system 1945bd8deadSopenharmony_ci API's would also provide a function (i.e., wglMakeCurrent, 1955bd8deadSopenharmony_ci glXMakeCurrent, aglSetDrawable, etc.) to bind a drawable with a GL 1965bd8deadSopenharmony_ci context (as is done in the WGL_ARB_pbuffer extension). In this 1975bd8deadSopenharmony_ci extension however, this functionality is subsumed by the GL and the 1985bd8deadSopenharmony_ci GL provides the function BindFramebufferARB to bind a framebuffer 1995bd8deadSopenharmony_ci object to the current context. Later, the context can bind back to 2005bd8deadSopenharmony_ci the window-system-provided framebuffer in order to display rendered 2015bd8deadSopenharmony_ci content. 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci Previous extensions that enabled rendering to a texture have been 2045bd8deadSopenharmony_ci much more complicated. One example is the combination of 2055bd8deadSopenharmony_ci ARB_pbuffer and ARB_render_texture, both of which are window-system 2065bd8deadSopenharmony_ci extensions. This combination requires calling MakeCurrent, an 2075bd8deadSopenharmony_ci operation that may be expensive, to switch between the window and 2085bd8deadSopenharmony_ci the pbuffer drawables. An application must create one pbuffer per 2095bd8deadSopenharmony_ci renderable texture in order to portably use ARB_render_texture. An 2105bd8deadSopenharmony_ci application must maintain at least one GL context per texture 2115bd8deadSopenharmony_ci format, because each context can only operate on a single 2125bd8deadSopenharmony_ci pixelformat or FBConfig. All of these characteristics make 2135bd8deadSopenharmony_ci ARB_render_texture both inefficient and cumbersome to use. 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ci ARB_framebuffer_object, on the other hand, is both simpler to use 2165bd8deadSopenharmony_ci and more efficient than ARB_render_texture. The 2175bd8deadSopenharmony_ci ARB_framebuffer_object API is contained wholly within the GL API and 2185bd8deadSopenharmony_ci has no (non-portable) window-system components. Under 2195bd8deadSopenharmony_ci ARB_framebuffer_object, it is not necessary to create a second GL 2205bd8deadSopenharmony_ci context when rendering to a texture image whose format differs from 2215bd8deadSopenharmony_ci that of the window. Finally, unlike the pbuffers of 2225bd8deadSopenharmony_ci ARB_render_texture, a single framebuffer object can facilitate 2235bd8deadSopenharmony_ci rendering to an unlimited number of texture objects. 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci This extension differs from EXT_framebuffer_object by splitting the 2265bd8deadSopenharmony_ci framebuffer object binding point into separate DRAW and READ 2275bd8deadSopenharmony_ci bindings (incorporating functionality introduced by 2285bd8deadSopenharmony_ci EXT_framebuffer_blit). This allows copying directly from one 2295bd8deadSopenharmony_ci framebuffer to another. In addition, a new high performance blit 2305bd8deadSopenharmony_ci function is added to facilitate these blits and perform some data 2315bd8deadSopenharmony_ci conversion where allowed. 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci This extension also enables usage of multisampling in conjunction with 2345bd8deadSopenharmony_ci renderbuffers (incorporating functionality from 2355bd8deadSopenharmony_ci EXT_packed_depth_stencil), as follows: 2365bd8deadSopenharmony_ci 2375bd8deadSopenharmony_ci The new operation RenderbufferStorageMultisample() allocates 2385bd8deadSopenharmony_ci storage for a renderbuffer object that can be used as a multisample 2395bd8deadSopenharmony_ci buffer. A multisample render buffer image differs from a 2405bd8deadSopenharmony_ci single-sample render buffer image in that a multisample image has a 2415bd8deadSopenharmony_ci number of SAMPLES that is greater than zero. No method is provided 2425bd8deadSopenharmony_ci for creating multisample texture images. 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ci All of the framebuffer-attachable images attached to a framebuffer 2455bd8deadSopenharmony_ci object must have the same number of SAMPLES or else the framebuffer 2465bd8deadSopenharmony_ci object is not "framebuffer complete". If a framebuffer object with 2475bd8deadSopenharmony_ci multisample attachments is "framebuffer complete", then the 2485bd8deadSopenharmony_ci framebuffer object behaves as if SAMPLE_BUFFERS is one. 2495bd8deadSopenharmony_ci 2505bd8deadSopenharmony_ci In traditional multisample rendering, where 2515bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING is zero and SAMPLE_BUFFERS is one, the 2525bd8deadSopenharmony_ci GL spec states that "the color sample values are resolved to a 2535bd8deadSopenharmony_ci single, displayable color each time a pixel is updated." There are, 2545bd8deadSopenharmony_ci however, several modern hardware implementations that do not 2555bd8deadSopenharmony_ci actually resolve for each sample update, but instead postpones the 2565bd8deadSopenharmony_ci resolve operation to a later time and resolve a batch of sample 2575bd8deadSopenharmony_ci updates at a time. This is OK as long as the implementation behaves 2585bd8deadSopenharmony_ci "as if" it had resolved a sample-at-a-time. Unfortunately, however, 2595bd8deadSopenharmony_ci honoring the "as if" rule can sometimes degrade performance. 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ci In contrast, when DRAW_FRAMEBUFFER_BINDING is an 2625bd8deadSopenharmony_ci application-created framebuffer object, MULTISAMPLE is enabled, and 2635bd8deadSopenharmony_ci SAMPLE_BUFFERS is one, there is no implicit per-sample-update 2645bd8deadSopenharmony_ci resolve. Instead, the application explicitly controls when the 2655bd8deadSopenharmony_ci resolve operation is performed. The resolve operation is affected 2665bd8deadSopenharmony_ci by calling BlitFramebuffer where the source is a multisample 2675bd8deadSopenharmony_ci application-created framebuffer object and the destination is a 2685bd8deadSopenharmony_ci single-sample framebuffer object (either application-created or 2695bd8deadSopenharmony_ci window-system provided). 2705bd8deadSopenharmony_ci 2715bd8deadSopenharmony_ci This design for multisample resolve more closely matches current 2725bd8deadSopenharmony_ci hardware, but still permits implementations which choose to resolve 2735bd8deadSopenharmony_ci a single sample at a time. If hardware that implements the 2745bd8deadSopenharmony_ci multisample resolution "one sample at a time" exposes 2755bd8deadSopenharmony_ci ARB_framebuffer_object, it could perform the implicit resolve 2765bd8deadSopenharmony_ci to a driver-managed hidden surface, then read from that surface when 2775bd8deadSopenharmony_ci the application calls BlitFramebuffer. 2785bd8deadSopenharmony_ci 2795bd8deadSopenharmony_ci Another motivation for granting the application explicit control 2805bd8deadSopenharmony_ci over the multisample resolve operation has to do with the 2815bd8deadSopenharmony_ci flexibility afforded by ARB_framebuffer_object. Previously, a 2825bd8deadSopenharmony_ci drawable (window or pbuffer) had exclusive access to all of its 2835bd8deadSopenharmony_ci buffers. There was no mechanism for sharing a buffer across 2845bd8deadSopenharmony_ci multiple drawables. Under ARB_framebuffer_object, however, a 2855bd8deadSopenharmony_ci mechanism exists for sharing a framebuffer-attachable image across 2865bd8deadSopenharmony_ci several framebuffer objects, as well as sharing an image between a 2875bd8deadSopenharmony_ci framebuffer object and a texture. If we had retained the "implicit" 2885bd8deadSopenharmony_ci resolve from traditional multisampled rendering, and allowed the 2895bd8deadSopenharmony_ci creation of "multisample" format renderbuffers, then this type of 2905bd8deadSopenharmony_ci sharing would have lead to two problematic situations: 2915bd8deadSopenharmony_ci 2925bd8deadSopenharmony_ci * Two contexts, which shared renderbuffers, might perform 2935bd8deadSopenharmony_ci competing resolve operations into the same single-sample buffer 2945bd8deadSopenharmony_ci with ambiguous results. 2955bd8deadSopenharmony_ci 2965bd8deadSopenharmony_ci * It would have introduced the unfortunate ability to use the 2975bd8deadSopenharmony_ci single-sample buffer as a texture while MULTISAMPLE is ENABLED. 2985bd8deadSopenharmony_ci 2995bd8deadSopenharmony_ci Using BlitFramebuffer as an explicit resolve to serialize access to 3005bd8deadSopenharmony_ci the multisampled contents and eliminate the implicit per-sample 3015bd8deadSopenharmony_ci resolve operation, we avoid both of these problems. 3025bd8deadSopenharmony_ci 3035bd8deadSopenharmony_ci This extension also enables usage of packed depth-stencil formats in 3045bd8deadSopenharmony_ci renderbuffers (incorporating functionality from 3055bd8deadSopenharmony_ci EXT_packed_depth_stencil), as follows: 3065bd8deadSopenharmony_ci 3075bd8deadSopenharmony_ci Many OpenGL implementations have chosen to interleave the depth and 3085bd8deadSopenharmony_ci stencil buffers into one buffer, often with 24 bits of depth 3095bd8deadSopenharmony_ci precision and 8 bits of stencil data. 32 bits is more than is 3105bd8deadSopenharmony_ci needed for the depth buffer much of the time; a 24-bit depth buffer, 3115bd8deadSopenharmony_ci on the other hand, requires that reads and writes of depth data be 3125bd8deadSopenharmony_ci unaligned with respect to power-of-two boundaries. On the other 3135bd8deadSopenharmony_ci hand, 8 bits of stencil data is more than sufficient for most 3145bd8deadSopenharmony_ci applications, so it is only natural to pack the two buffers into a 3155bd8deadSopenharmony_ci single buffer with both depth and stencil data. OpenGL never 3165bd8deadSopenharmony_ci provides direct access to the buffers, so the OpenGL implementation 3175bd8deadSopenharmony_ci can provide an interface to applications where it appears the one 3185bd8deadSopenharmony_ci merged buffer is composed of two logical buffers. 3195bd8deadSopenharmony_ci 3205bd8deadSopenharmony_ci One disadvantage of this scheme is that OpenGL lacks any means by 3215bd8deadSopenharmony_ci which this packed data can be handled efficiently. For example, 3225bd8deadSopenharmony_ci when an application reads from the 24-bit depth buffer, using the 3235bd8deadSopenharmony_ci type GL_UNSIGNED_SHORT will lose 8 bits of data, while 3245bd8deadSopenharmony_ci GL_UNSIGNED_INT has 8 too many. Both require expensive format 3255bd8deadSopenharmony_ci conversion operations. A 24-bit format would be no more suitable, 3265bd8deadSopenharmony_ci because it would also suffer from the unaligned memory accesses that 3275bd8deadSopenharmony_ci made the standalone 24-bit depth buffer an unattractive proposition 3285bd8deadSopenharmony_ci in the first place. 3295bd8deadSopenharmony_ci 3305bd8deadSopenharmony_ci Many applications, such as parallel rendering applications, may also 3315bd8deadSopenharmony_ci wish to draw to or read back from both the depth and stencil buffers 3325bd8deadSopenharmony_ci at the same time. Currently this requires two separate operations, 3335bd8deadSopenharmony_ci reducing performance. Since the buffers are interleaved, drawing to 3345bd8deadSopenharmony_ci or reading from both should be no more expensive than using just 3355bd8deadSopenharmony_ci one; in some cases, it may even be cheaper. 3365bd8deadSopenharmony_ci 3375bd8deadSopenharmony_ci This extension provides a new data format, GL_DEPTH_STENCIL, 3385bd8deadSopenharmony_ci that can be used with the glDrawPixels, glReadPixels, and 3395bd8deadSopenharmony_ci glCopyPixels commands, as well as a packed data type, 3405bd8deadSopenharmony_ci GL_UNSIGNED_INT_24_8, that is meant to be used with 3415bd8deadSopenharmony_ci GL_DEPTH_STENCIL. No other data types are supported with 3425bd8deadSopenharmony_ci GL_DEPTH_STENCIL. If ARB_depth_texture or SGIX_depth_texture is 3435bd8deadSopenharmony_ci supported, GL_DEPTH_STENCIL/GL_UNSIGNED_INT_24_8 data can 3445bd8deadSopenharmony_ci also be used for textures; this provides a more efficient way to 3455bd8deadSopenharmony_ci supply data for a 24-bit depth texture. 3465bd8deadSopenharmony_ci 3475bd8deadSopenharmony_ci GL_DEPTH_STENCIL data, when passed through the pixel path, 3485bd8deadSopenharmony_ci undergoes both depth and stencil operations. The depth data is 3495bd8deadSopenharmony_ci scaled and biased by the current GL_DEPTH_SCALE and GL_DEPTH_BIAS, 3505bd8deadSopenharmony_ci while the stencil data is shifted and offset by the current 3515bd8deadSopenharmony_ci GL_INDEX_SHIFT and GL_INDEX_OFFSET. The stencil data is also put 3525bd8deadSopenharmony_ci through the stencil-to-stencil pixel map. 3535bd8deadSopenharmony_ci 3545bd8deadSopenharmony_ci glDrawPixels of GL_DEPTH_STENCIL data operates similarly to that 3555bd8deadSopenharmony_ci of GL_STENCIL_INDEX data, bypassing the OpenGL fragment pipeline 3565bd8deadSopenharmony_ci entirely, unlike the treatment of GL_DEPTH_COMPONENT data. The 3575bd8deadSopenharmony_ci stencil and depth masks are applied, as are the pixel ownership and 3585bd8deadSopenharmony_ci scissor tests, but all other operations are skipped. 3595bd8deadSopenharmony_ci 3605bd8deadSopenharmony_ci glReadPixels of GL_DEPTH_STENCIL data reads back a rectangle 3615bd8deadSopenharmony_ci from both the depth and stencil buffers. 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ci glCopyPixels of GL_DEPTH_STENCIL data copies a rectangle from 3645bd8deadSopenharmony_ci both the depth and stencil buffers. Like glDrawPixels, it applies 3655bd8deadSopenharmony_ci both the stencil and depth masks but skips the remainder of the 3665bd8deadSopenharmony_ci OpenGL fragment pipeline. 3675bd8deadSopenharmony_ci 3685bd8deadSopenharmony_ci glTex[Sub]Image[1,2,3]D of GL_DEPTH_STENCIL data loads depth and 3695bd8deadSopenharmony_ci stencil data into a depth_stencil texture. glGetTexImage of 3705bd8deadSopenharmony_ci GL_DEPTH_STENCIL data can be used to retrieve depth and stencil 3715bd8deadSopenharmony_ci data from a depth/stencil texture. 3725bd8deadSopenharmony_ci 3735bd8deadSopenharmony_ci In addition, a new base internal format, GL_DEPTH_STENCIL, can 3745bd8deadSopenharmony_ci be used by both texture images and renderbuffer storage. When an 3755bd8deadSopenharmony_ci image with a DEPTH_STENCIL internal format is attached to both 3765bd8deadSopenharmony_ci the depth and stencil attachment points of a framebuffer object, 3775bd8deadSopenharmony_ci then it becomes both the depth and stencil 3785bd8deadSopenharmony_ci buffers of the framebuffer. This fits nicely with hardware that 3795bd8deadSopenharmony_ci interleaves both depth and stencil data into a single buffer. When 3805bd8deadSopenharmony_ci a texture with DEPTH_STENCIL data is bound for texturing, only 3815bd8deadSopenharmony_ci the depth component is accessible through the texture fetcher. The 3825bd8deadSopenharmony_ci stencil data can be written with TexImage or CopyTexImage, and can 3835bd8deadSopenharmony_ci be read with GetTexImage. When a DEPTH_STENCIL image is 3845bd8deadSopenharmony_ci attached to the stencil attachment of the bound framebuffer object, 3855bd8deadSopenharmony_ci the stencil data can be accessed through any operation that reads 3865bd8deadSopenharmony_ci from or writes to the framebuffer's stencil buffer. 3875bd8deadSopenharmony_ci 3885bd8deadSopenharmony_ci 3895bd8deadSopenharmony_ciGlossary of Helpful Terms 3905bd8deadSopenharmony_ci 3915bd8deadSopenharmony_ci logical buffer: 3925bd8deadSopenharmony_ci One of the color, depth, or stencil buffers of the 3935bd8deadSopenharmony_ci framebuffer. 3945bd8deadSopenharmony_ci 3955bd8deadSopenharmony_ci framebuffer: 3965bd8deadSopenharmony_ci The collection of logical buffers and associated state 3975bd8deadSopenharmony_ci defining where the output of GL rendering is directed. 3985bd8deadSopenharmony_ci 3995bd8deadSopenharmony_ci texture: 4005bd8deadSopenharmony_ci an object which consists of one or more 2D arrays of pixel 4015bd8deadSopenharmony_ci images and associated state that can be used as a source of 4025bd8deadSopenharmony_ci data during the texture-mapping process described in section 4035bd8deadSopenharmony_ci 3.8. 4045bd8deadSopenharmony_ci 4055bd8deadSopenharmony_ci texture image: 4065bd8deadSopenharmony_ci one of the 2D arrays of pixels that are part of a texture 4075bd8deadSopenharmony_ci object as defined in section 3.8. Texture images contain 4085bd8deadSopenharmony_ci and define the texels of the texture object. 4095bd8deadSopenharmony_ci 4105bd8deadSopenharmony_ci renderbuffer: 4115bd8deadSopenharmony_ci A new type of storage object which contains a single 2D 4125bd8deadSopenharmony_ci array of pixels and associated state that can be used as a 4135bd8deadSopenharmony_ci destination for pixel data written during the rendering 4145bd8deadSopenharmony_ci process described in Chapter 4. 4155bd8deadSopenharmony_ci 4165bd8deadSopenharmony_ci renderbuffer image: 4175bd8deadSopenharmony_ci The 2D array of pixels that is part of a renderbuffer 4185bd8deadSopenharmony_ci object. A renderbuffer image contains and defines the 4195bd8deadSopenharmony_ci pixels of the renderbuffer object. 4205bd8deadSopenharmony_ci 4215bd8deadSopenharmony_ci framebuffer-attachable image: 4225bd8deadSopenharmony_ci A 2D pixel image that can be attached to one of the logical 4235bd8deadSopenharmony_ci buffer attachment points of a framebuffer object. Texture 4245bd8deadSopenharmony_ci images and renderbuffer images are two examples of 4255bd8deadSopenharmony_ci framebuffer-attachable images. 4265bd8deadSopenharmony_ci 4275bd8deadSopenharmony_ci attachment point: 4285bd8deadSopenharmony_ci The set of state which references a specific 4295bd8deadSopenharmony_ci framebuffer-attachable image, and allows that 4305bd8deadSopenharmony_ci framebuffer-attachable image to be used to store the 4315bd8deadSopenharmony_ci contents of a logical buffer of a framebuffer object. There 4325bd8deadSopenharmony_ci is an attachment point state vector for each color, depth, 4335bd8deadSopenharmony_ci and stencil buffer of a framebuffer. 4345bd8deadSopenharmony_ci 4355bd8deadSopenharmony_ci attach: 4365bd8deadSopenharmony_ci The act of connecting one object to another object. 4375bd8deadSopenharmony_ci 4385bd8deadSopenharmony_ci An "attach" operation is similar to a "bind" operation in 4395bd8deadSopenharmony_ci that both represent a reference to the attached or bound 4405bd8deadSopenharmony_ci object for the purpose of managing object lifetimes and both 4415bd8deadSopenharmony_ci enable manipulation of the state of the attached or bound 4425bd8deadSopenharmony_ci object. 4435bd8deadSopenharmony_ci 4445bd8deadSopenharmony_ci However, an "attach" is also different from a "bind" in that 4455bd8deadSopenharmony_ci "binding" an unused object creates a new object, while 4465bd8deadSopenharmony_ci "attaching" does not. Additionally, "bind" establishes a 4475bd8deadSopenharmony_ci connection between a context and an object, while "attach" 4485bd8deadSopenharmony_ci establishes a connection between two objects. 4495bd8deadSopenharmony_ci 4505bd8deadSopenharmony_ci Finally, if object "A" is attached to object "B" and object 4515bd8deadSopenharmony_ci "B" is bound to context "C", then in most respects, we treat 4525bd8deadSopenharmony_ci "A" as if it is <implicitly> bound to "C". 4535bd8deadSopenharmony_ci 4545bd8deadSopenharmony_ci framebuffer attachment completeness: 4555bd8deadSopenharmony_ci Similar to texture "mipmap" or "cube" completeness from 4565bd8deadSopenharmony_ci section 3.8.10, defines a minimum set of criteria for 4575bd8deadSopenharmony_ci framebuffer attachment points. (for complete definition, 4585bd8deadSopenharmony_ci see section 4.4.4.1) 4595bd8deadSopenharmony_ci 4605bd8deadSopenharmony_ci framebuffer completeness: 4615bd8deadSopenharmony_ci Similar to texture "mipmap cube completeness", defines a 4625bd8deadSopenharmony_ci composite set of "completeness" requirements and 4635bd8deadSopenharmony_ci relationships among the attached framebuffer-attachable 4645bd8deadSopenharmony_ci images. (for complete definition, see section 4.4.4.2) 4655bd8deadSopenharmony_ci 4665bd8deadSopenharmony_ci 4675bd8deadSopenharmony_ciNew Procedures and Functions 4685bd8deadSopenharmony_ci 4695bd8deadSopenharmony_ci boolean IsRenderbuffer(uint renderbuffer); 4705bd8deadSopenharmony_ci void BindRenderbuffer(enum target, uint renderbuffer); 4715bd8deadSopenharmony_ci void DeleteRenderbuffers(sizei n, const uint *renderbuffers); 4725bd8deadSopenharmony_ci void GenRenderbuffers(sizei n, uint *renderbuffers); 4735bd8deadSopenharmony_ci 4745bd8deadSopenharmony_ci void RenderbufferStorage(enum target, enum internalformat, 4755bd8deadSopenharmony_ci sizei width, sizei height); 4765bd8deadSopenharmony_ci 4775bd8deadSopenharmony_ci void RenderbufferStorageMultisample(enum target, sizei samples, 4785bd8deadSopenharmony_ci enum internalformat, 4795bd8deadSopenharmony_ci sizei width, sizei height); 4805bd8deadSopenharmony_ci 4815bd8deadSopenharmony_ci void GetRenderbufferParameteriv(enum target, enum pname, int *params); 4825bd8deadSopenharmony_ci 4835bd8deadSopenharmony_ci boolean IsFramebuffer(uint framebuffer); 4845bd8deadSopenharmony_ci void BindFramebuffer(enum target, uint framebuffer); 4855bd8deadSopenharmony_ci void DeleteFramebuffers(sizei n, const uint *framebuffers); 4865bd8deadSopenharmony_ci void GenFramebuffers(sizei n, uint *framebuffers); 4875bd8deadSopenharmony_ci 4885bd8deadSopenharmony_ci enum CheckFramebufferStatus(enum target); 4895bd8deadSopenharmony_ci 4905bd8deadSopenharmony_ci void FramebufferTexture1D(enum target, enum attachment, 4915bd8deadSopenharmony_ci enum textarget, uint texture, int level); 4925bd8deadSopenharmony_ci void FramebufferTexture2D(enum target, enum attachment, 4935bd8deadSopenharmony_ci enum textarget, uint texture, int level); 4945bd8deadSopenharmony_ci void FramebufferTexture3D(enum target, enum attachment, 4955bd8deadSopenharmony_ci enum textarget, uint texture, 4965bd8deadSopenharmony_ci int level, int layer); 4975bd8deadSopenharmony_ci void FramebufferTextureLayer(enum target,enum attachment, 4985bd8deadSopenharmony_ci uint texture,int level,int layer); 4995bd8deadSopenharmony_ci 5005bd8deadSopenharmony_ci void FramebufferRenderbuffer(enum target, enum attachment, 5015bd8deadSopenharmony_ci enum renderbuffertarget, uint renderbuffer); 5025bd8deadSopenharmony_ci 5035bd8deadSopenharmony_ci void GetFramebufferAttachmentParameteriv(enum target, enum attachment, 5045bd8deadSopenharmony_ci enum pname, int *params); 5055bd8deadSopenharmony_ci 5065bd8deadSopenharmony_ci void BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, 5075bd8deadSopenharmony_ci int dstX0, int dstY0, int dstX1, int dstY1, 5085bd8deadSopenharmony_ci bitfield mask, enum filter); 5095bd8deadSopenharmony_ci 5105bd8deadSopenharmony_ci void GenerateMipmap(enum target); 5115bd8deadSopenharmony_ci 5125bd8deadSopenharmony_ci 5135bd8deadSopenharmony_ciNew Types 5145bd8deadSopenharmony_ci 5155bd8deadSopenharmony_ci None. 5165bd8deadSopenharmony_ci 5175bd8deadSopenharmony_ci 5185bd8deadSopenharmony_ciNew Tokens 5195bd8deadSopenharmony_ci 5205bd8deadSopenharmony_ci Accepted by the <target> parameter of BindFramebuffer, 5215bd8deadSopenharmony_ci CheckFramebufferStatus, FramebufferTexture{1D|2D|3D}, 5225bd8deadSopenharmony_ci FramebufferRenderbuffer, and 5235bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv: 5245bd8deadSopenharmony_ci 5255bd8deadSopenharmony_ci FRAMEBUFFER 0x8D40 5265bd8deadSopenharmony_ci READ_FRAMEBUFFER 0x8CA8 5275bd8deadSopenharmony_ci DRAW_FRAMEBUFFER 0x8CA9 5285bd8deadSopenharmony_ci 5295bd8deadSopenharmony_ci Accepted by the <target> parameter of BindRenderbuffer, 5305bd8deadSopenharmony_ci RenderbufferStorage, and GetRenderbufferParameteriv, and 5315bd8deadSopenharmony_ci returned by GetFramebufferAttachmentParameteriv: 5325bd8deadSopenharmony_ci 5335bd8deadSopenharmony_ci RENDERBUFFER 0x8D41 5345bd8deadSopenharmony_ci 5355bd8deadSopenharmony_ci Accepted by the <internalformat> parameter of 5365bd8deadSopenharmony_ci RenderbufferStorage: 5375bd8deadSopenharmony_ci 5385bd8deadSopenharmony_ci STENCIL_INDEX1 0x8D46 5395bd8deadSopenharmony_ci STENCIL_INDEX4 0x8D47 5405bd8deadSopenharmony_ci STENCIL_INDEX8 0x8D48 5415bd8deadSopenharmony_ci STENCIL_INDEX16 0x8D49 5425bd8deadSopenharmony_ci 5435bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetRenderbufferParameteriv: 5445bd8deadSopenharmony_ci 5455bd8deadSopenharmony_ci RENDERBUFFER_WIDTH 0x8D42 5465bd8deadSopenharmony_ci RENDERBUFFER_HEIGHT 0x8D43 5475bd8deadSopenharmony_ci RENDERBUFFER_INTERNAL_FORMAT 0x8D44 5485bd8deadSopenharmony_ci RENDERBUFFER_RED_SIZE 0x8D50 5495bd8deadSopenharmony_ci RENDERBUFFER_GREEN_SIZE 0x8D51 5505bd8deadSopenharmony_ci RENDERBUFFER_BLUE_SIZE 0x8D52 5515bd8deadSopenharmony_ci RENDERBUFFER_ALPHA_SIZE 0x8D53 5525bd8deadSopenharmony_ci RENDERBUFFER_DEPTH_SIZE 0x8D54 5535bd8deadSopenharmony_ci RENDERBUFFER_STENCIL_SIZE 0x8D55 5545bd8deadSopenharmony_ci RENDERBUFFER_SAMPLES 0x8CAB 5555bd8deadSopenharmony_ci 5565bd8deadSopenharmony_ci Accepted by the <pname> parameter of 5575bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv: 5585bd8deadSopenharmony_ci 5595bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 5605bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 5615bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 5625bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 5635bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 5645bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 5655bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 5665bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 5675bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 5685bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 5695bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 5705bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 5715bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 5725bd8deadSopenharmony_ci 5735bd8deadSopenharmony_ci Returned in <params> by GetFramebufferAttachmentParameteriv: 5745bd8deadSopenharmony_ci 5755bd8deadSopenharmony_ci SRGB 0x8C40 5765bd8deadSopenharmony_ci UNSIGNED_NORMALIZED 0x8C17 5775bd8deadSopenharmony_ci FRAMEBUFFER_DEFAULT 0x8218 5785bd8deadSopenharmony_ci INDEX 0x8222 5795bd8deadSopenharmony_ci 5805bd8deadSopenharmony_ci Accepted by the <attachment> parameter of 5815bd8deadSopenharmony_ci FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and 5825bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv 5835bd8deadSopenharmony_ci 5845bd8deadSopenharmony_ci COLOR_ATTACHMENT0 0x8CE0 5855bd8deadSopenharmony_ci COLOR_ATTACHMENT1 0x8CE1 5865bd8deadSopenharmony_ci COLOR_ATTACHMENT2 0x8CE2 5875bd8deadSopenharmony_ci COLOR_ATTACHMENT3 0x8CE3 5885bd8deadSopenharmony_ci COLOR_ATTACHMENT4 0x8CE4 5895bd8deadSopenharmony_ci COLOR_ATTACHMENT5 0x8CE5 5905bd8deadSopenharmony_ci COLOR_ATTACHMENT6 0x8CE6 5915bd8deadSopenharmony_ci COLOR_ATTACHMENT7 0x8CE7 5925bd8deadSopenharmony_ci COLOR_ATTACHMENT8 0x8CE8 5935bd8deadSopenharmony_ci COLOR_ATTACHMENT9 0x8CE9 5945bd8deadSopenharmony_ci COLOR_ATTACHMENT10 0x8CEA 5955bd8deadSopenharmony_ci COLOR_ATTACHMENT11 0x8CEB 5965bd8deadSopenharmony_ci COLOR_ATTACHMENT12 0x8CEC 5975bd8deadSopenharmony_ci COLOR_ATTACHMENT13 0x8CED 5985bd8deadSopenharmony_ci COLOR_ATTACHMENT14 0x8CEE 5995bd8deadSopenharmony_ci COLOR_ATTACHMENT15 0x8CEF 6005bd8deadSopenharmony_ci DEPTH_ATTACHMENT 0x8D00 6015bd8deadSopenharmony_ci STENCIL_ATTACHMENT 0x8D20 6025bd8deadSopenharmony_ci DEPTH_STENCIL_ATTACHMENT 0x821A 6035bd8deadSopenharmony_ci 6045bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 6055bd8deadSopenharmony_ci GetFloatv, and GetDoublev: 6065bd8deadSopenharmony_ci 6075bd8deadSopenharmony_ci MAX_SAMPLES 0x8D57 6085bd8deadSopenharmony_ci FRAMEBUFFER_BINDING 0x8CA6 // alias DRAW_FRAMEBUFFER_BINDING 6095bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING 0x8CA6 6105bd8deadSopenharmony_ci READ_FRAMEBUFFER_BINDING 0x8CAA 6115bd8deadSopenharmony_ci RENDERBUFFER_BINDING 0x8CA7 6125bd8deadSopenharmony_ci MAX_COLOR_ATTACHMENTS 0x8CDF 6135bd8deadSopenharmony_ci MAX_RENDERBUFFER_SIZE 0x84E8 6145bd8deadSopenharmony_ci 6155bd8deadSopenharmony_ci 6165bd8deadSopenharmony_ci Returned by CheckFramebufferStatus(): 6175bd8deadSopenharmony_ci 6185bd8deadSopenharmony_ci FRAMEBUFFER_COMPLETE 0x8CD5 6195bd8deadSopenharmony_ci FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 6205bd8deadSopenharmony_ci FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 6215bd8deadSopenharmony_ci FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB 6225bd8deadSopenharmony_ci FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC 6235bd8deadSopenharmony_ci FRAMEBUFFER_UNSUPPORTED 0x8CDD 6245bd8deadSopenharmony_ci FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 6255bd8deadSopenharmony_ci FRAMEBUFFER_UNDEFINED 0x8219 6265bd8deadSopenharmony_ci 6275bd8deadSopenharmony_ci Returned by GetError(): 6285bd8deadSopenharmony_ci 6295bd8deadSopenharmony_ci INVALID_FRAMEBUFFER_OPERATION 0x0506 6305bd8deadSopenharmony_ci 6315bd8deadSopenharmony_ci Accepted by the <format> parameter of DrawPixels, ReadPixels, 6325bd8deadSopenharmony_ci TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, 6335bd8deadSopenharmony_ci TexSubImage3D, and GetTexImage, by the <type> parameter of 6345bd8deadSopenharmony_ci CopyPixels, by the <internalformat> parameter of TexImage1D, 6355bd8deadSopenharmony_ci TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and 6365bd8deadSopenharmony_ci RenderbufferStorage, and returned in the <data> parameter of 6375bd8deadSopenharmony_ci GetTexLevelParameter and GetRenderbufferParameteriv: 6385bd8deadSopenharmony_ci 6395bd8deadSopenharmony_ci DEPTH_STENCIL 0x84F9 6405bd8deadSopenharmony_ci 6415bd8deadSopenharmony_ci Accepted by the <type> parameter of DrawPixels, ReadPixels, 6425bd8deadSopenharmony_ci TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, 6435bd8deadSopenharmony_ci TexSubImage3D, and GetTexImage: 6445bd8deadSopenharmony_ci 6455bd8deadSopenharmony_ci UNSIGNED_INT_24_8 0x84FA 6465bd8deadSopenharmony_ci 6475bd8deadSopenharmony_ci Accepted by the <internalformat> parameter of TexImage1D, 6485bd8deadSopenharmony_ci TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and 6495bd8deadSopenharmony_ci RenderbufferStorage, and returned in the <data> parameter of 6505bd8deadSopenharmony_ci GetTexLevelParameter and GetRenderbufferParameteriv: 6515bd8deadSopenharmony_ci 6525bd8deadSopenharmony_ci DEPTH24_STENCIL8 0x88F0 6535bd8deadSopenharmony_ci 6545bd8deadSopenharmony_ci Accepted by the <value> parameter of GetTexLevelParameter: 6555bd8deadSopenharmony_ci 6565bd8deadSopenharmony_ci TEXTURE_STENCIL_SIZE 0x88F1 6575bd8deadSopenharmony_ci 6585bd8deadSopenharmony_ci 6595bd8deadSopenharmony_ciAdditions to Chapter 2 of the 2.1 Specification (OpenGL Operation) 6605bd8deadSopenharmony_ci 6615bd8deadSopenharmony_ci "The GL interacts with two classes of framebuffers: window 6625bd8deadSopenharmony_ci system-provided and application-created. There is at most one window 6635bd8deadSopenharmony_ci system-provided framebuffer at any time, referred to as the <default 6645bd8deadSopenharmony_ci framebuffer>. Application-created framebuffers, referred to as 6655bd8deadSopenharmony_ci <framebuffer objects>, may be created as desired. These two types of 6665bd8deadSopenharmony_ci framebuffer are distinguished primarily by the interface for configuring 6675bd8deadSopenharmony_ci and managing their state. 6685bd8deadSopenharmony_ci 6695bd8deadSopenharmony_ci The effects of GL commands on the default framebuffer are ultimately 6705bd8deadSopenharmony_ci controlled by the window system, which allocates framebuffer resources, 6715bd8deadSopenharmony_ci determines what portions of the default framebuffer the GL may access at 6725bd8deadSopenharmony_ci any given time, and communicates to the GL how those portions are 6735bd8deadSopenharmony_ci structured. Therefore, there are no GL commands to initialize a GL 6745bd8deadSopenharmony_ci context or configure the default framebuffer. Similarly, display of 6755bd8deadSopenharmony_ci framebuffer contents on a physical display device (including the 6765bd8deadSopenharmony_ci transformation of individual framebuffer values by such techniques as 6775bd8deadSopenharmony_ci gamma correction) is not addressed by the GL. 6785bd8deadSopenharmony_ci 6795bd8deadSopenharmony_ci Allocation and configuration of the default framebuffer occurs outside 6805bd8deadSopenharmony_ci of the GL in conjunction with the window system, using companion APIs 6815bd8deadSopenharmony_ci such as GLX, WGL, and AGL for GL implementations running on the X Window 6825bd8deadSopenharmony_ci System, Microsoft Windows, and MacOS X respectively. 6835bd8deadSopenharmony_ci 6845bd8deadSopenharmony_ci Allocation and initialization of GL contexts is also done using these 6855bd8deadSopenharmony_ci companion APIs. GL contexts can typically be associated with different 6865bd8deadSopenharmony_ci default framebuffers, and some context state is determined at the time 6875bd8deadSopenharmony_ci this association is performed. 6885bd8deadSopenharmony_ci 6895bd8deadSopenharmony_ci It is possible to use a GL context <without> a default framebuffer, in 6905bd8deadSopenharmony_ci which case a framebuffer object must be used to perform all rendering. 6915bd8deadSopenharmony_ci This is useful for applications needing to perform <offscreen 6925bd8deadSopenharmony_ci rendering>." 6935bd8deadSopenharmony_ci 6945bd8deadSopenharmony_ci 6955bd8deadSopenharmony_ci Add to table 2.3, "Summary of GL errors": 6965bd8deadSopenharmony_ci 6975bd8deadSopenharmony_ci Error Description Offending command 6985bd8deadSopenharmony_ci ignored? 6995bd8deadSopenharmony_ci ----------------------------- ------------------ ----------------- 7005bd8deadSopenharmony_ci ... 7015bd8deadSopenharmony_ci INVALID_FRAMEBUFFER_OPERATION Framebuffer object Yes 7025bd8deadSopenharmony_ci is not complete 7035bd8deadSopenharmony_ci 7045bd8deadSopenharmony_ci 7055bd8deadSopenharmony_ci Append the following to section 2.6.1 "Begin and End": 7065bd8deadSopenharmony_ci 7075bd8deadSopenharmony_ci "Calling Begin will result in an INVALID_FRAMEBUFFER_OPERATION 7085bd8deadSopenharmony_ci error if the object bound to DRAW_FRAMEBUFFER_BINDING is not 7095bd8deadSopenharmony_ci "framebuffer complete" (see section 4.4.4.2)." 7105bd8deadSopenharmony_ci 7115bd8deadSopenharmony_ci Update the bulleted list in section 2.15.4 "Shader Execution" in 7125bd8deadSopenharmony_ci the subsection titled "Texture Access" to say: 7135bd8deadSopenharmony_ci 7145bd8deadSopenharmony_ci "* The sampler used in a texture lookup function is not one of 7155bd8deadSopenharmony_ci the shadow sampler types, the texture object's base internal 7165bd8deadSopenharmony_ci format is DEPTH_COMPONENT or DEPTH_STENCIL, and the 7175bd8deadSopenharmony_ci TEXTURE_COMPARE_MODE is not NONE. 7185bd8deadSopenharmony_ci 7195bd8deadSopenharmony_ci * The sampler used in a texture lookup function is one of the 7205bd8deadSopenharmony_ci shadow sampler types, the texture object's base 7215bd8deadSopenharmony_ci internal format is DEPTH_COMPONENT or DEPTH_STENCIL, and the 7225bd8deadSopenharmony_ci TEXTURE_COMPARE_MODE is NONE. 7235bd8deadSopenharmony_ci 7245bd8deadSopenharmony_ci * The sampler used in a texture lookup function is one of the 7255bd8deadSopenharmony_ci shadow sampler types, and the texture object's base 7265bd8deadSopenharmony_ci internal format is not DEPTH_COMPONENT or DEPTH_STENCIL. 7275bd8deadSopenharmony_ci 7285bd8deadSopenharmony_ci The stencil index texture internal component is ignored if the base 7295bd8deadSopenharmony_ci internal format is DEPTH_STENCIL. 7305bd8deadSopenharmony_ci 7315bd8deadSopenharmony_ci If a vertex shader uses..." 7325bd8deadSopenharmony_ci 7335bd8deadSopenharmony_ci 7345bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.1 Specification (Rasterization) 7355bd8deadSopenharmony_ci 7365bd8deadSopenharmony_ci Update section 3.6.3 "Pixel Transfer Modes", the first paragraph of 7375bd8deadSopenharmony_ci the subsection "Color Table Specification", in the definition of 7385bd8deadSopenharmony_ci ColorTable, to say: 7395bd8deadSopenharmony_ci 7405bd8deadSopenharmony_ci "... The <formats> COLOR_INDEX, DEPTH_COMPONENT, DEPTH_STENCIL, 7415bd8deadSopenharmony_ci and STENCIL_INDEX and the <type> BITMAP are not allowed." 7425bd8deadSopenharmony_ci 7435bd8deadSopenharmony_ci Update section 3.6.3 "Pixel Transfer Modes", the third paragraph of 7445bd8deadSopenharmony_ci the subsection "Color Table Specification", in the definition of 7455bd8deadSopenharmony_ci ColorTable, to say: 7465bd8deadSopenharmony_ci 7475bd8deadSopenharmony_ci "... <internalformat> must be one of the formats in table 3.15 or 7485bd8deadSopenharmony_ci table 3.16, other than the DEPTH_COMPONENT or DEPTH_STENCIL 7495bd8deadSopenharmony_ci formats in those tables." 7505bd8deadSopenharmony_ci 7515bd8deadSopenharmony_ci Add to section 3.6.3 "Pixel Transfer Modes", at the end of the 7525bd8deadSopenharmony_ci subsection titled "Alternate Color Table Specification Commands": 7535bd8deadSopenharmony_ci 7545bd8deadSopenharmony_ci "Calling CopyColorTable or CopyColorSubTable will result in an 7555bd8deadSopenharmony_ci INVALID_FRAMEBUFFER_OPERATION error if the object bound to 7565bd8deadSopenharmony_ci READ_FRAMEBUFFER_BINDING is not "framebuffer complete" 7575bd8deadSopenharmony_ci (see section 4.4.4.2)." 7585bd8deadSopenharmony_ci 7595bd8deadSopenharmony_ci In section 3.6.3 "Pixel Transfer Modes", the subsection "Covolution 7605bd8deadSopenharmony_ci Filter Specification", update the first paragraph in the definition 7615bd8deadSopenharmony_ci of ConvolutionFilter2D to say: 7625bd8deadSopenharmony_ci 7635bd8deadSopenharmony_ci "... The formats COLOR_INDEX, DEPTH_COMPONENT, DEPTH_STENCIL, 7645bd8deadSopenharmony_ci and STENCIL_INDEX and the type BITMAP are not allowed." 7655bd8deadSopenharmony_ci 7665bd8deadSopenharmony_ci In section 3.6.3 "Pixel Transfer Modes", update the third paragraph 7675bd8deadSopenharmony_ci of the subsection "Convolution Filter Specification", in the definition 7685bd8deadSopenharmony_ci of ConvolutionFilter2D, to say: 7695bd8deadSopenharmony_ci 7705bd8deadSopenharmony_ci "... <internalformat> accepts the same values as the corresponding 7715bd8deadSopenharmony_ci argument of ColorTable." 7725bd8deadSopenharmony_ci 7735bd8deadSopenharmony_ci Add to section 3.6.3 "Pixel Transfer Modes", at the end of the 7745bd8deadSopenharmony_ci subsection titled "Alternate Convolution Filter Specification Commands": 7755bd8deadSopenharmony_ci 7765bd8deadSopenharmony_ci "Calling CopyConvolutionFilter1D or CopyConvolutionFilter2D will 7775bd8deadSopenharmony_ci result in an INVALID_FRAMEBUFFER_OPERATION error if the object 7785bd8deadSopenharmony_ci bound to READ_FRAMEBUFFER_BINDING is not "framebuffer 7795bd8deadSopenharmony_ci complete" (see section 4.4.4.2)." 7805bd8deadSopenharmony_ci 7815bd8deadSopenharmony_ci In section 3.6.3 "Pixel Transfer Modes", update the third paragraph 7825bd8deadSopenharmony_ci of the "Histogram Table Specification" subsection , in the definition of 7835bd8deadSopenharmony_ci Histogram, to say: 7845bd8deadSopenharmony_ci 7855bd8deadSopenharmony_ci "... is too large for the implementation. <internalformat> accepts the 7865bd8deadSopenharmony_ci same values as the corresponding argument of ColorTable, with the 7875bd8deadSopenharmony_ci exception of the values 1, 2, 3, and 4." 7885bd8deadSopenharmony_ci 7895bd8deadSopenharmony_ci In section 3.6.3 "Pixel Transfer Modes", update the second paragraph 7905bd8deadSopenharmony_ci in the subsection titled "Minmax Table Specification", in the definition 7915bd8deadSopenharmony_ci of Minmax to say: 7925bd8deadSopenharmony_ci 7935bd8deadSopenharmony_ci "<internalformat> accepts the same values as the corresponding argument 7945bd8deadSopenharmony_ci of ColorTable, with the exception of the values 1, 2, 3, and 4, as well 7955bd8deadSopenharmony_ci as the INTENSITY base and sized internal formats." 7965bd8deadSopenharmony_ci 7975bd8deadSopenharmony_ci In section 3.6.4 "Rasterization of Pixel Rectangles", modify the final 7985bd8deadSopenharmony_ci paragraph of the definition of DrawPixels as follows: 7995bd8deadSopenharmony_ci 8005bd8deadSopenharmony_ci "... If the GL is in color index mode and <format> is not one of 8015bd8deadSopenharmony_ci COLOR_INDEX, STENCIL_INDEX, DEPTH_COMPONENT, or DEPTH_STENCIL, 8025bd8deadSopenharmony_ci then the error INVALID_OPERATION occurs. If <type> is BITMAP and 8035bd8deadSopenharmony_ci <format> is not COLOR_INDEX or STENCIL_INDEX then the error 8045bd8deadSopenharmony_ci INVALID_ENUM occurs. If <format> is DEPTH_STENCIL and <type> is 8055bd8deadSopenharmony_ci not UNSIGNED_INT_24_8 then the error INVALID_ENUM occurs. Some 8065bd8deadSopenharmony_ci additional constraints on the combinations of <format> and <type> 8075bd8deadSopenharmony_ci values that are accepted is discussed below. 8085bd8deadSopenharmony_ci 8095bd8deadSopenharmony_ci "Calling DrawPixels 8105bd8deadSopenharmony_ci will result in an INVALID_FRAMEBUFFER_OPERATION error if the 8115bd8deadSopenharmony_ci object bound to DRAW_FRAMEBUFFER_BINDING is not 8125bd8deadSopenharmony_ci "framebuffer complete" (see section 4.4.4.2)." 8135bd8deadSopenharmony_ci 8145bd8deadSopenharmony_ci Add a row to Table 3.5, in section 3.6.4: 8155bd8deadSopenharmony_ci 8165bd8deadSopenharmony_ci type Parameter GL Type Special 8175bd8deadSopenharmony_ci --------------------------- ------- ------- 8185bd8deadSopenharmony_ci ... ... ... 8195bd8deadSopenharmony_ci UNSIGNED_INT_2_10_10_10_REV uint Yes 8205bd8deadSopenharmony_ci UNSIGNED_INT_24_8 uint Yes 8215bd8deadSopenharmony_ci 8225bd8deadSopenharmony_ci Add a row to Table 3.6, in section 3.6.4: 8235bd8deadSopenharmony_ci 8245bd8deadSopenharmony_ci Format Name Element Meaning and Order Target Buffer 8255bd8deadSopenharmony_ci --------------- ------------------------- ----------------- 8265bd8deadSopenharmony_ci ... ... ... 8275bd8deadSopenharmony_ci DEPTH_COMPONENT Depth Depth 8285bd8deadSopenharmony_ci DEPTH_STENCIL Depth and Stencil Index Depth and Stencil 8295bd8deadSopenharmony_ci ... ... ... 8305bd8deadSopenharmony_ci 8315bd8deadSopenharmony_ci In section 3.6.4 "Rasterization of Pixel Rectangles", in the subsection 8325bd8deadSopenharmony_ci titled "Unpacking", update the last paragraph on page 131 to say: 8335bd8deadSopenharmony_ci 8345bd8deadSopenharmony_ci "Calling DrawPixels with a <type> matching one of the types in table 3.8 8355bd8deadSopenharmony_ci is a special case in which all the components of each group are packed 8365bd8deadSopenharmony_ci into a single unsigned byte, unsigned short, or unsigned int, depending 8375bd8deadSopenharmony_ci on the type. The number of components..." 8385bd8deadSopenharmony_ci 8395bd8deadSopenharmony_ci Add a row to Table 3.8, in section 3.6.4: 8405bd8deadSopenharmony_ci 8415bd8deadSopenharmony_ci type Parameter GL Type Components Pixel Formats 8425bd8deadSopenharmony_ci --------------------------- ------- ---------- ------------- 8435bd8deadSopenharmony_ci ... ... ... ... 8445bd8deadSopenharmony_ci UNSIGNED_INT_2_10_10_10_REV uint 4 RGBA,BGRA 8455bd8deadSopenharmony_ci UNSIGNED_INT_24_8 uint 2 DEPTH_STENCIL 8465bd8deadSopenharmony_ci 8475bd8deadSopenharmony_ci Add the following diagram to Table 3.11, in section 3.6.4: 8485bd8deadSopenharmony_ci 8495bd8deadSopenharmony_ci UNSIGNED_INT_24_8 8505bd8deadSopenharmony_ci 8515bd8deadSopenharmony_ci 31 30 29 28 27 26 ... 12 11 10 9 8 7 6 5 4 3 2 1 0 8525bd8deadSopenharmony_ci +----------------------------------+---------------+ 8535bd8deadSopenharmony_ci | 1st Component | 2nd Component | 8545bd8deadSopenharmony_ci +----------------------------------+---------------+ 8555bd8deadSopenharmony_ci 8565bd8deadSopenharmony_ci Add a row to Table 3.12, in section 3.6.4: 8575bd8deadSopenharmony_ci 8585bd8deadSopenharmony_ci Format | 1st 2nd 3rd 4th 8595bd8deadSopenharmony_ci --------------+------------------------------- 8605bd8deadSopenharmony_ci ... | ... ... ... ... 8615bd8deadSopenharmony_ci BGRA | blue green red alpha 8625bd8deadSopenharmony_ci DEPTH_STENCIL | depth stencil N/A N/A 8635bd8deadSopenharmony_ci 8645bd8deadSopenharmony_ci In section 3.6.4 "Rasterization of Pixel Rectangles", add the 8655bd8deadSopenharmony_ci following sentence to the end of the first paragraph in "Conversion 8665bd8deadSopenharmony_ci to floating-point": 8675bd8deadSopenharmony_ci 8685bd8deadSopenharmony_ci "For groups containing both components and indices, such as 8695bd8deadSopenharmony_ci DEPTH_STENCIL, the indices are not converted." 8705bd8deadSopenharmony_ci 8715bd8deadSopenharmony_ci In section 3.6.4 "Rasterization of Pixel Rectangles", update the 8725bd8deadSopenharmony_ci last paragraph in the section "Conversion to Fragments" to say: 8735bd8deadSopenharmony_ci 8745bd8deadSopenharmony_ci "... Groups arising from DrawPixels with a <format> of STENCIL_INDEX 8755bd8deadSopenharmony_ci or DEPTH_STENCIL are treated specially and are described in 8765bd8deadSopenharmony_ci section 4.3.1." 8775bd8deadSopenharmony_ci 8785bd8deadSopenharmony_ci Update the first paragraph of section 3.6.5 "Pixel Transfer 8795bd8deadSopenharmony_ci Operations" to say: 8805bd8deadSopenharmony_ci 8815bd8deadSopenharmony_ci "The GL defines five kinds of pixel groups: 8825bd8deadSopenharmony_ci 8835bd8deadSopenharmony_ci 1. RGBA component: Each group comprises four color components: 8845bd8deadSopenharmony_ci red, green, blue, and alpha. 8855bd8deadSopenharmony_ci 2. Depth component: Each group comprises a single depth 8865bd8deadSopenharmony_ci component. 8875bd8deadSopenharmony_ci 3. Color index: Each group comprises a single color index. 8885bd8deadSopenharmony_ci 4. Stencil index: Each group comprises a single stencil index. 8895bd8deadSopenharmony_ci 5. Depth/stencil: Each group comprises a single depth component 8905bd8deadSopenharmony_ci and a single stencil index." 8915bd8deadSopenharmony_ci 8925bd8deadSopenharmony_ci In section 3.6.5 "Pixel Transfer Operations" update the first paragraph 8935bd8deadSopenharmony_ci in the subsection "Arithmetic on Components" to say: 8945bd8deadSopenharmony_ci 8955bd8deadSopenharmony_ci "This step applies only to RGBA component and depth component 8965bd8deadSopenharmony_ci groups, and to the depth components in depth/stencil groups. ..." 8975bd8deadSopenharmony_ci 8985bd8deadSopenharmony_ci In section 3.6.5 "Pixel Transfer Operations" update the first paragraph 8995bd8deadSopenharmony_ci in the subsection "Arithmetic on Indices" to say: 9005bd8deadSopenharmony_ci 9015bd8deadSopenharmony_ci "This step applies only to color index and stencil index groups, and 9025bd8deadSopenharmony_ci to the stencil indices in depth/stencil groups. ..." 9035bd8deadSopenharmony_ci 9045bd8deadSopenharmony_ci In section 3.6.5 "Pixel Transfer Operations" update the first paragraph 9055bd8deadSopenharmony_ci in the subsection "Stencil Index Lookup" to say: 9065bd8deadSopenharmony_ci 9075bd8deadSopenharmony_ci "This step applies only to stencil index groups and to the stencil 9085bd8deadSopenharmony_ci indices in depth/stencil groups. ..." 9095bd8deadSopenharmony_ci 9105bd8deadSopenharmony_ci Add the following to section 3.7 "Bitmaps", following the description of 9115bd8deadSopenharmony_ci Bitmap: 9125bd8deadSopenharmony_ci 9135bd8deadSopenharmony_ci "Calling Bitmap will result in an 9145bd8deadSopenharmony_ci INVALID_FRAMEBUFFER_OPERATION error if the object bound to 9155bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING is not "framebuffer complete" 9165bd8deadSopenharmony_ci (see section 4.4.4.2)." 9175bd8deadSopenharmony_ci 9185bd8deadSopenharmony_ci In section 3.8.1 "Texture Image Specification", update the following 9195bd8deadSopenharmony_ci paragraphs as follows: 9205bd8deadSopenharmony_ci 9215bd8deadSopenharmony_ci Update the fourth paragraph to say: 9225bd8deadSopenharmony_ci 9235bd8deadSopenharmony_ci "The selected groups are processed exactly as for DrawPixels, 9245bd8deadSopenharmony_ci stopping just before final conversion. Each R, G, B, A, or depth 9255bd8deadSopenharmony_ci value so generated is clamped to [0, 1], while the stencil index 9265bd8deadSopenharmony_ci values are masked by 2^n-1, where n is the number of stencil bits in 9275bd8deadSopenharmony_ci the internal format resolution (see below). If the base internal 9285bd8deadSopenharmony_ci format is DEPTH_STENCIL and <format> is not DEPTH_STENCIL, 9295bd8deadSopenharmony_ci then the values of the stencil index texture component are 9305bd8deadSopenharmony_ci undefined." 9315bd8deadSopenharmony_ci 9325bd8deadSopenharmony_ci Update the fifth paragraph to say: 9335bd8deadSopenharmony_ci 9345bd8deadSopenharmony_ci "Components are then selected from the resulting R, G, B, A, depth, 9355bd8deadSopenharmony_ci or stencil index values to obtain a texture with the base internal 9365bd8deadSopenharmony_ci format specified by (or derived from) <internalformat>. Table 3.15 9375bd8deadSopenharmony_ci summarizes the mapping of R, G, B, A, depth, or stencil values to 9385bd8deadSopenharmony_ci texture components, as a function of the base internal format of the 9395bd8deadSopenharmony_ci texture image. <internalformat> may be specified as one of the 9405bd8deadSopenharmony_ci eight internal format symbolic constants listed in table 3.15, as 9415bd8deadSopenharmony_ci one of ..." 9425bd8deadSopenharmony_ci 9435bd8deadSopenharmony_ci Update the sixth paragraph to say: 9445bd8deadSopenharmony_ci 9455bd8deadSopenharmony_ci "Textures with a base internal format of DEPTH_COMPONENT or 9465bd8deadSopenharmony_ci DEPTH_STENCIL are supported by texture image specification 9475bd8deadSopenharmony_ci commands only if <target> is TEXTURE_1D, TEXTURE_2D, 9485bd8deadSopenharmony_ci PROXY_TEXTURE_1D or PROXY_TEXTURE_2D. Using these formats in 9495bd8deadSopenharmony_ci conjunction with any other <target> will result in an 9505bd8deadSopenharmony_ci INVALID_OPERATION error." 9515bd8deadSopenharmony_ci 9525bd8deadSopenharmony_ci Update the seventh paragraph to say: 9535bd8deadSopenharmony_ci 9545bd8deadSopenharmony_ci Textures with a base internal format of DEPTH_COMPONENT or 9555bd8deadSopenharmony_ci DEPTH_STENCIL require either depth component data or 9565bd8deadSopenharmony_ci depth/stencil component data. Textures with other base internal 9575bd8deadSopenharmony_ci formats require RGBA component data. The error INVALID_OPERATION is 9585bd8deadSopenharmony_ci generated if one of the base internal format and <format> 9595bd8deadSopenharmony_ci is DEPTH_COMPONENT or DEPTH_STENCIL, and the other is neither 9605bd8deadSopenharmony_ci of these values." 9615bd8deadSopenharmony_ci 9625bd8deadSopenharmony_ci Update the tenth paragraph to say: 9635bd8deadSopenharmony_ci 9645bd8deadSopenharmony_ci "...the mapping of the R, G, B, A, depth and stencil values to 9655bd8deadSopenharmony_ci texture components..." 9665bd8deadSopenharmony_ci 9675bd8deadSopenharmony_ci Add a row to table 3.15 in section 3.8.1, and update the title of the 9685bd8deadSopenharmony_ci second column: 9695bd8deadSopenharmony_ci 9705bd8deadSopenharmony_ci Base Internal Format RGBA and Depth and Stencil Values Internal Components 9715bd8deadSopenharmony_ci -------------------- --------------------------------- ------------------- 9725bd8deadSopenharmony_ci ... ... ... 9735bd8deadSopenharmony_ci DEPTH_STENCIL Depth,Stencil D,S 9745bd8deadSopenharmony_ci ... ... ... 9755bd8deadSopenharmony_ci 9765bd8deadSopenharmony_ci Update the caption for table 3.15 9775bd8deadSopenharmony_ci 9785bd8deadSopenharmony_ci "Table 3.15: Conversion from RGBA, depth, and stencil pixel 9795bd8deadSopenharmony_ci components to internal texture, table, or filter components. See 9805bd8deadSopenharmony_ci section 3.8.13 for a description of the texture components R, G, B, 9815bd8deadSopenharmony_ci A, L, I, D, and S." 9825bd8deadSopenharmony_ci 9835bd8deadSopenharmony_ci Add a new column to table 3.16, in section 3.8.1, labeled "S bits". The 9845bd8deadSopenharmony_ci value of this column is blank for all rows except a new row: 9855bd8deadSopenharmony_ci 9865bd8deadSopenharmony_ci Sized Base R G B A L I D S 9875bd8deadSopenharmony_ci Internal Format InternalFormat bits bits bits bits bits bits bits bits 9885bd8deadSopenharmony_ci ---------------- -------------- ---- ---- ---- ---- ---- ---- ---- ---- 9895bd8deadSopenharmony_ci ... ... ... ... ... ... ... ... ... ... 9905bd8deadSopenharmony_ci DEPTH24_STENCIL8 DEPTH_STENCIL 24 8 9915bd8deadSopenharmony_ci ... ... ... ... ... ... ... ... ... ... 9925bd8deadSopenharmony_ci 9935bd8deadSopenharmony_ci In section 3.8.2 "Alternate Texture Image Specification Commands", 9945bd8deadSopenharmony_ci update the second paragraph, in the definition of CopyTexImage2D, to 9955bd8deadSopenharmony_ci say: 9965bd8deadSopenharmony_ci 9975bd8deadSopenharmony_ci "...The image is taken from the framebuffer exactly as if these 9985bd8deadSopenharmony_ci arguments were passed to CopyPixels with argument type set to COLOR 9995bd8deadSopenharmony_ci DEPTH, or DEPTH_STENCIL, depending on <internalformat>, stopping 10005bd8deadSopenharmony_ci after pixel transfer processing is complete. RGBA data is taken 10015bd8deadSopenharmony_ci from the current color buffer, while depth component and stencil 10025bd8deadSopenharmony_ci index data are taken from the depth and stencil buffers, 10035bd8deadSopenharmony_ci respectively. If depth component data is required and no depth 10045bd8deadSopenharmony_ci buffer is present, or if stencil index data is required and there is 10055bd8deadSopenharmony_ci no stencil buffer, the error INVALID_OPERATION is generated. 10065bd8deadSopenharmony_ci Subsequent processing is identical to that described for TexImage2D, 10075bd8deadSopenharmony_ci beginning with clamping of the R, G, B, A, or depth values, and 10085bd8deadSopenharmony_ci masking of the stencil index value, from the resulting pixel 10095bd8deadSopenharmony_ci groups..." 10105bd8deadSopenharmony_ci 10115bd8deadSopenharmony_ci Update the third paragraph to say: 10125bd8deadSopenharmony_ci 10135bd8deadSopenharmony_ci "Subsequent processing is identical to that described for TexImage2D, 10145bd8deadSopenharmony_ci beginning with clamping of the R, G, B, A, or depth values, and masking 10155bd8deadSopenharmony_ci of the stencil index values from the resulting pixel groups..." 10165bd8deadSopenharmony_ci 10175bd8deadSopenharmony_ci In section 3.8.2 "Alternate Texture Image Specification Commands", 10185bd8deadSopenharmony_ci update the seventh paragraph, in the description of the 10195bd8deadSopenharmony_ci CopyTexSubImage{2|3}D arguments, to say: 10205bd8deadSopenharmony_ci 10215bd8deadSopenharmony_ci "...except that the assignment of R, G, B, A, depth, and stencil 10225bd8deadSopenharmony_ci pixel group values to the texture components is controlled by the 10235bd8deadSopenharmony_ci internalformat of the texture array, not by an argument to the 10245bd8deadSopenharmony_ci command..." 10255bd8deadSopenharmony_ci 10265bd8deadSopenharmony_ci Append the following to section 3.8.2 "Alternate Texture Image 10275bd8deadSopenharmony_ci Specification Commands": 10285bd8deadSopenharmony_ci 10295bd8deadSopenharmony_ci "Calling CopyTexSubImage3D, CopyTexImage2D, 10305bd8deadSopenharmony_ci CopyTexSubImage2D, CopyTexImage1D or CopyTexSubImage1D will result 10315bd8deadSopenharmony_ci in an INVALID_FRAMEBUFFER_OPERATION error if the object bound 10325bd8deadSopenharmony_ci to READ_FRAMEBUFFER_BINDING is not "framebuffer complete" 10335bd8deadSopenharmony_ci (see section 4.4.4.2)." 10345bd8deadSopenharmony_ci 10355bd8deadSopenharmony_ci Update section 3.8.5 "Depth Component Textures" to say: 10365bd8deadSopenharmony_ci 10375bd8deadSopenharmony_ci "Depth textures and the depth components of depth/stencil textures 10385bd8deadSopenharmony_ci can be treated as LUMINANCE, INTENSITY or ALPHA textures during 10395bd8deadSopenharmony_ci texture filtering and application. The initial state for depth and 10405bd8deadSopenharmony_ci depth/stencil textures treats them as LUMINANCE textures." 10415bd8deadSopenharmony_ci 10425bd8deadSopenharmony_ci In section 3.8.8 "Texture Minification", add the following text 10435bd8deadSopenharmony_ci immediately before the subsection "Mipmapping": 10445bd8deadSopenharmony_ci 10455bd8deadSopenharmony_ci "If all of the following conditions are satisfied, then the value of 10465bd8deadSopenharmony_ci the selected Tau(ijk), Tau(ij), or Tau(i) in the above equations is 10475bd8deadSopenharmony_ci undefined instead of referring to the value of the texel at location 10485bd8deadSopenharmony_ci (i), (i,j), or (i,j,k). See Chapter 4 for discussion of framebuffer 10495bd8deadSopenharmony_ci objects and their attachments. 10505bd8deadSopenharmony_ci 10515bd8deadSopenharmony_ci * The current DRAW_FRAMEBUFFER_BINDING names an application-created 10525bd8deadSopenharmony_ci framebuffer object <F>. 10535bd8deadSopenharmony_ci 10545bd8deadSopenharmony_ci * The texture is attached to one of the attachment points, <A>, of 10555bd8deadSopenharmony_ci framebuffer object <F>. 10565bd8deadSopenharmony_ci 10575bd8deadSopenharmony_ci * The value of TEXTURE_MIN_FILTER is NEAREST or LINEAR, and the value 10585bd8deadSopenharmony_ci of FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL for attachment point <A> 10595bd8deadSopenharmony_ci is equal to the value of TEXTURE_BASE_LEVEL 10605bd8deadSopenharmony_ci 10615bd8deadSopenharmony_ci -or- 10625bd8deadSopenharmony_ci 10635bd8deadSopenharmony_ci The value of TEXTURE_MIN_FILTER is NEAREST_MIPMAP_NEAREST, 10645bd8deadSopenharmony_ci NEAREST_MIPMAP_LINEAR, LINEAR_MIPMAP_NEAREST, or 10655bd8deadSopenharmony_ci LINEAR_MIPMAP_LINEAR, and the value of 10665bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL for attachment point 10675bd8deadSopenharmony_ci <A> is within the inclusive range from TEXTURE_BASE_LEVEL to q." 10685bd8deadSopenharmony_ci 10695bd8deadSopenharmony_ci In subsection "Automatic Mipmap Generation" to section 3.8.8, 10705bd8deadSopenharmony_ci replace the first paragraph with the following text and footnote: 10715bd8deadSopenharmony_ci 10725bd8deadSopenharmony_ci "If the value of texture parameter GENERATE MIPMAP is TRUE and a 10735bd8deadSopenharmony_ci change is made to the interior or border texels of the level_base 10745bd8deadSopenharmony_ci array of a mipmap by one of the texture image specification 10755bd8deadSopenharmony_ci operations defined in sections 3.8.1 through 3.8.3, then a complete 10765bd8deadSopenharmony_ci set of mipmap arrays (as defined in section 3.8.10) will be 10775bd8deadSopenharmony_ci computed. Array levels level_base + 1 through p are replaced with 10785bd8deadSopenharmony_ci arrays derived from the modified level_base, regardless of their 10795bd8deadSopenharmony_ci previous contents. All other mipmap arrays, including the 10805bd8deadSopenharmony_ci level_base array, are left unchanged by this computation[fn1]." 10815bd8deadSopenharmony_ci 10825bd8deadSopenharmony_ci "[fn1] Automatic mipmap generation is not performed for changes 10835bd8deadSopenharmony_ci resulting from rendering operations targeting a texture array 10845bd8deadSopenharmony_ci bound as a color buffer of a framebuffer object." 10855bd8deadSopenharmony_ci 10865bd8deadSopenharmony_ci 10875bd8deadSopenharmony_ci Add a new subsection "Manual Mipmap Generation" to section 3.8.8, 10885bd8deadSopenharmony_ci after "Automatic Mipmap Generation": 10895bd8deadSopenharmony_ci 10905bd8deadSopenharmony_ci "Manual Mipmap Generation 10915bd8deadSopenharmony_ci 10925bd8deadSopenharmony_ci Mipmaps can be generated manually with the command 10935bd8deadSopenharmony_ci 10945bd8deadSopenharmony_ci void GenerateMipmap(enum target); 10955bd8deadSopenharmony_ci 10965bd8deadSopenharmony_ci where <target> is one of TEXTURE_1D, TEXTURE_2D, TEXTURE_CUBE_MAP, or 10975bd8deadSopenharmony_ci TEXTURE_3D. Mipmap generation affects the texture image attached to 10985bd8deadSopenharmony_ci <target>. For cube map textures, an INVALID_OPERATION error is generated 10995bd8deadSopenharmony_ci if the texture bound to <target> is not cube complete, as defined in 11005bd8deadSopenharmony_ci section 3.8.10. 11015bd8deadSopenharmony_ci 11025bd8deadSopenharmony_ci Mipmap generation replaces texture array levels level_base + 1 11035bd8deadSopenharmony_ci through q with arrays derived from the level_base array, as 11045bd8deadSopenharmony_ci described above under Automatic Mipmap Generation. All other mipmap 11055bd8deadSopenharmony_ci arrays, including the level_base array, are left unchanged by this 11065bd8deadSopenharmony_ci computation. For arrays in the range level_base+1 through q, 11075bd8deadSopenharmony_ci inclusive, automatic and manual mipmap generation generate the same 11085bd8deadSopenharmony_ci derived arrays, given identical level_base arrays." 11095bd8deadSopenharmony_ci 11105bd8deadSopenharmony_ci Add a new section between sections 3.8.9 and 3.8.10: 11115bd8deadSopenharmony_ci 11125bd8deadSopenharmony_ci "3.8.10 DEPTH_STENCIL Textures 11135bd8deadSopenharmony_ci 11145bd8deadSopenharmony_ci If the texture image has a base internal format of 11155bd8deadSopenharmony_ci DEPTH_STENCIL, then the stencil index texture component is 11165bd8deadSopenharmony_ci ignored. The texture value Tau does not include a stencil index 11175bd8deadSopenharmony_ci component, but includes only the depth component." 11185bd8deadSopenharmony_ci 11195bd8deadSopenharmony_ci Update the first paragraph of section 3.8.11 "Texture State and 11205bd8deadSopenharmony_ci Proxy State" to say: 11215bd8deadSopenharmony_ci 11225bd8deadSopenharmony_ci "...eight integer values describing the resolutions of each of the 11235bd8deadSopenharmony_ci red, green, blue, alpha, luminance, intensity, depth, and stencil 11245bd8deadSopenharmony_ci components of the image..." 11255bd8deadSopenharmony_ci 11265bd8deadSopenharmony_ci Update the second paragraph of section 3.8.11 "Texture State and 11275bd8deadSopenharmony_ci Proxy State" to say: 11285bd8deadSopenharmony_ci 11295bd8deadSopenharmony_ci "... and internal format state values, as well as state for the red, 11305bd8deadSopenharmony_ci green, blue, alpha, luminance, intensity, depth, and stencil 11315bd8deadSopenharmony_ci component resolutions." 11325bd8deadSopenharmony_ci 11335bd8deadSopenharmony_ci Modify the definition of DeleteTextures in section 3.8.12 "Texture 11345bd8deadSopenharmony_ci Objects", to read: 11355bd8deadSopenharmony_ci 11365bd8deadSopenharmony_ci "Texture objects are deleted by calling 11375bd8deadSopenharmony_ci 11385bd8deadSopenharmony_ci void DeleteTextures( sizei n, uint *textures ); 11395bd8deadSopenharmony_ci 11405bd8deadSopenharmony_ci textures contains n names of texture objects to be deleted. After a 11415bd8deadSopenharmony_ci texture object is deleted, it has no contents or dimensionality, and 11425bd8deadSopenharmony_ci its name is again unused. If a texture that is currently bound to 11435bd8deadSopenharmony_ci one of the targets TEXTURE 1D, TEXTURE 2D, TEXTURE 3D, or TEXTURE 11445bd8deadSopenharmony_ci CUBE MAP is deleted, it is as though BindTexture had been executed 11455bd8deadSopenharmony_ci with the same target and texture zero. Additionally, special care 11465bd8deadSopenharmony_ci must be taken when deleting a texture if any of the images of the 11475bd8deadSopenharmony_ci texture are attached to a framebuffer object. See section 4.4.2.3 11485bd8deadSopenharmony_ci for details. 11495bd8deadSopenharmony_ci 11505bd8deadSopenharmony_ci Unused names in textures are silently ignored, as is the value 11515bd8deadSopenharmony_ci zero." 11525bd8deadSopenharmony_ci 11535bd8deadSopenharmony_ci In section 3.8.14 "Texture Comparison Modes", update the first 11545bd8deadSopenharmony_ci paragraph of "Depth Texture Comparison Mode" subsection to say: 11555bd8deadSopenharmony_ci 11565bd8deadSopenharmony_ci "If the currently bound texture's base internal format is 11575bd8deadSopenharmony_ci DEPTH_COMPONENT or DEPTH_STENCIL..." 11585bd8deadSopenharmony_ci 11595bd8deadSopenharmony_ci In the section 3.8.16 "Texture Application", update the first 11605bd8deadSopenharmony_ci paragraph of to say: 11615bd8deadSopenharmony_ci 11625bd8deadSopenharmony_ci "...Otherwise, a texture value is found according to the parameter 11635bd8deadSopenharmony_ci values of the currently bound texture image of the appropriate 11645bd8deadSopenharmony_ci dimensionality using the rules given in sections 3.8.6 through 11655bd8deadSopenharmony_ci 3.8.9. Note that the texture value may contain R, G, B, A, L, I, or 11665bd8deadSopenharmony_ci D components, but it does not contain an S component. If the 11675bd8deadSopenharmony_ci texture's base internal format is DEPTH_STENCIL, for the 11685bd8deadSopenharmony_ci purposes of texture application, it is as if the base internal 11695bd8deadSopenharmony_ci format were DEPTH_COMPONENT..." 11705bd8deadSopenharmony_ci 11715bd8deadSopenharmony_ci In section 3.11.2 "Shader Execution", in the bulleted list 11725bd8deadSopenharmony_ci in the "Texture Access" subsection to say: 11735bd8deadSopenharmony_ci 11745bd8deadSopenharmony_ci "* The sampler used in a texture lookup function is not one of the 11755bd8deadSopenharmony_ci shadow sampler types, the texture object's base internal 11765bd8deadSopenharmony_ci format is DEPTH_COMPONENT or DEPTH_STENCIL, and the 11775bd8deadSopenharmony_ci TEXTURE_COMPARE_MODE is not NONE. 11785bd8deadSopenharmony_ci 11795bd8deadSopenharmony_ci * The sampler used in a texture lookup function is one of the 11805bd8deadSopenharmony_ci shadow sampler types, the texture object's base 11815bd8deadSopenharmony_ci internal format is DEPTH_COMPONENT or DEPTH_STENCIL, and the 11825bd8deadSopenharmony_ci TEXTURE_COMPARE_MODE is NONE. 11835bd8deadSopenharmony_ci 11845bd8deadSopenharmony_ci * The sampler used in a texture lookup function is one of the 11855bd8deadSopenharmony_ci shadow sampler types, and the texture object's base 11865bd8deadSopenharmony_ci internal format is not DEPTH_COMPONENT or DEPTH_STENCIL. 11875bd8deadSopenharmony_ci 11885bd8deadSopenharmony_ci The stencil index texture internal component is ignored if the base 11895bd8deadSopenharmony_ci internal format is DEPTH_STENCIL. 11905bd8deadSopenharmony_ci 11915bd8deadSopenharmony_ci If a fragment shader uses..." 11925bd8deadSopenharmony_ci 11935bd8deadSopenharmony_ci 11945bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.1 Specification (Per-Fragment 11955bd8deadSopenharmony_ciOperations and the Framebuffer) 11965bd8deadSopenharmony_ci 11975bd8deadSopenharmony_ci In the introduction to chapter 4, modify the first 11985bd8deadSopenharmony_ci three paragraphs to read as follows: 11995bd8deadSopenharmony_ci 12005bd8deadSopenharmony_ci "The framebuffer, whether it is the default framebuffer or a framebuffer 12015bd8deadSopenharmony_ci object (see section 2.1), consists of a set of pixels arranged as a 12025bd8deadSopenharmony_ci two-dimensional array. 12035bd8deadSopenharmony_ci For purposes of this 12045bd8deadSopenharmony_ci discussion, each pixel in the framebuffer is simply a set of some 12055bd8deadSopenharmony_ci number of bits. The number of bits per pixel may vary 12065bd8deadSopenharmony_ci depending on the GL implementation, the type of framebuffer 12075bd8deadSopenharmony_ci selected, and parameters specified when the framebuffer was created. 12085bd8deadSopenharmony_ci Creation and management of the default framebuffer is outside the scope 12095bd8deadSopenharmony_ci of this specification, while creation and management of framebuffer 12105bd8deadSopenharmony_ci objects is described in detail in section 4.4 12115bd8deadSopenharmony_ci 12125bd8deadSopenharmony_ci Corresponding bits from each pixel in the framebuffer are grouped 12135bd8deadSopenharmony_ci together into a <bitplane>; each bitplane contains a single bit from 12145bd8deadSopenharmony_ci each pixel. These bitplanes are grouped into several <logical 12155bd8deadSopenharmony_ci buffers>. These are the color, accumulation, depth, and stencil 12165bd8deadSopenharmony_ci buffers. The color buffer actually consists of a number of buffers, 12175bd8deadSopenharmony_ci and these color buffers serve related but slightly different 12185bd8deadSopenharmony_ci purposes depending on whether the GL is bound to the default 12195bd8deadSopenharmony_ci framebuffer or a framebuffer object. 12205bd8deadSopenharmony_ci 12215bd8deadSopenharmony_ci For the default framebuffer, the color buffers are the <front left> 12225bd8deadSopenharmony_ci buffer, the <front right> buffer, the <back left> buffer, the <back 12235bd8deadSopenharmony_ci right> buffer, and some number of <auxiliary> buffers. Typically, the 12245bd8deadSopenharmony_ci contents of the front buffers are displayed on a color monitor while the 12255bd8deadSopenharmony_ci contents of the back buffers are invisible. (Monoscopic contexts display 12265bd8deadSopenharmony_ci only the front left buffer; stereoscopic contexts display both the front 12275bd8deadSopenharmony_ci left and the front right buffers.) The contents of the auxiliary buffers 12285bd8deadSopenharmony_ci are never visible. All color buffers must have the same number of 12295bd8deadSopenharmony_ci bitplanes, although an implementation or context may choose not to 12305bd8deadSopenharmony_ci provide right buffers, back buffers, or auxiliary buffers at all. 12315bd8deadSopenharmony_ci Further, an implementation or context may choose not to provide 12325bd8deadSopenharmony_ci accumulation, depth, or stencil buffers. If no default framebuffer is 12335bd8deadSopenharmony_ci associated with the GL context, the framebuffer is incomplete except 12345bd8deadSopenharmony_ci when a framebuffer object is bound (see sections 4.4.1 and 4.4.4). 12355bd8deadSopenharmony_ci 12365bd8deadSopenharmony_ci Framebuffer objects are not visible, and do not have any of the color 12375bd8deadSopenharmony_ci buffers present in the default framebuffer. Instead, the buffers of an 12385bd8deadSopenharmony_ci framebuffer object are specified by attaching individual textures or 12395bd8deadSopenharmony_ci renderbuffers (see section 4.4) to a set of attachment points. A 12405bd8deadSopenharmony_ci framebuffer object has an array of color buffer attachment points, 12415bd8deadSopenharmony_ci numbered zero through <n>, a depth buffer attachment point, and a 12425bd8deadSopenharmony_ci stencil buffer attachment point. In order to be used for rendering, a 12435bd8deadSopenharmony_ci framebuffer object must be complete, as described in section 4.4.4. Not 12445bd8deadSopenharmony_ci all attachments of a framebuffer object need to be populated. 12455bd8deadSopenharmony_ci 12465bd8deadSopenharmony_ci Each pixel in a color buffer consists of either an unsigned integer 12475bd8deadSopenharmony_ci color index or of up to four color components. The four color components 12485bd8deadSopenharmony_ci are named R, G, B, and A, in that order; color buffers are not required 12495bd8deadSopenharmony_ci to have all four color components. R, G, B, and A components may be 12505bd8deadSopenharmony_ci represented as signed or unsigned normalized fixed-point, 12515bd8deadSopenharmony_ci floating-point, or signed or unsigned integer values; all components 12525bd8deadSopenharmony_ci must have the same representation. Each pixel in a depth buffer consists 12535bd8deadSopenharmony_ci of a single unsigned integer value in the format described in section 12545bd8deadSopenharmony_ci 2.12.1 or a floating-point value. Each pixel in a stencil buffer 12555bd8deadSopenharmony_ci consists of a single unsigned integer value. Each pixel in an 12565bd8deadSopenharmony_ci accumulation buffer consists of up to four color components. If an 12575bd8deadSopenharmony_ci accumulation buffer is present, it must have at least as many bitplanes 12585bd8deadSopenharmony_ci per component as in the color buffers. 12595bd8deadSopenharmony_ci 12605bd8deadSopenharmony_ci The number of bitplanes in the accumulation, color, depth, and stencil 12615bd8deadSopenharmony_ci buffers is dependent on the currently bound framebuffer. For the default 12625bd8deadSopenharmony_ci framebuffer, the number of bitplanes is fixed. For framebuffer objects, 12635bd8deadSopenharmony_ci the number of bitplanes in a given logical buffer may change if the 12645bd8deadSopenharmony_ci image attached to the corresponding attachment point changes. 12655bd8deadSopenharmony_ci 12665bd8deadSopenharmony_ci The GL has two active framebuffers; the <draw framebuffer> is the 12675bd8deadSopenharmony_ci destination for rendering operations, and the <read framebuffer> is the 12685bd8deadSopenharmony_ci source for readback operations. The same framebuffer may be used for 12695bd8deadSopenharmony_ci both drawing and reading. Section 4.4.1 describes the mechanism for 12705bd8deadSopenharmony_ci controlling framebuffer usage." 12715bd8deadSopenharmony_ci 12725bd8deadSopenharmony_ci The default framebuffer is initially used as the draw and read 12735bd8deadSopenharmony_ci framebuffer [fn1], and the initial state of all provided bitplanes is 12745bd8deadSopenharmony_ci undefined. The format and encoding of buffers in the draw and read 12755bd8deadSopenharmony_ci framebuffers can be queried as described in section 6.1.3. 12765bd8deadSopenharmony_ci [fn1] The window system binding API may allow associating a GL 12775bd8deadSopenharmony_ci context with two separate ``default framebuffers'' provided by 12785bd8deadSopenharmony_ci the window system as the draw and read framebuffers, but if 12795bd8deadSopenharmony_ci so, both default framebuffers are referred to by the name zero 12805bd8deadSopenharmony_ci at their respective binding points. 12815bd8deadSopenharmony_ci 12825bd8deadSopenharmony_ci Add a new paragraph to the end of section 4.1.1 "Pixel Ownership Test": 12835bd8deadSopenharmony_ci 12845bd8deadSopenharmony_ci "If the draw framebuffer is a framebuffer object (see section 4.2.1), 12855bd8deadSopenharmony_ci the pixel ownership test always passes, since the pixels of framebuffer 12865bd8deadSopenharmony_ci objects are owned by the GL, not the window system. If the draw 12875bd8deadSopenharmony_ci framebuffer is the default framebuffer, the window system controls pixel 12885bd8deadSopenharmony_ci ownership." 12895bd8deadSopenharmony_ci 12905bd8deadSopenharmony_ci Change section 4.1.5 "Stencil Test", the fifth paragraph, 12915bd8deadSopenharmony_ci the second and third sentences, to read as follows: 12925bd8deadSopenharmony_ci 12935bd8deadSopenharmony_ci "<ref> is an integer reference value that is used in the unsigned 12945bd8deadSopenharmony_ci stencil comparison. Stencil comparison operations and queries of 12955bd8deadSopenharmony_ci of <ref> clamp its value to the range [0,(2^s)-1], where <s> is the 12965bd8deadSopenharmony_ci number of bits in the stencil buffer attached to the draw framebuffer. 12975bd8deadSopenharmony_ci 12985bd8deadSopenharmony_ci Replace the first three sentences of 4.1.10 "Logical Operation": 12995bd8deadSopenharmony_ci 13005bd8deadSopenharmony_ci "Finally, a logical operation is applied between the incoming 13015bd8deadSopenharmony_ci fragment's color or index values and the color or index values 13025bd8deadSopenharmony_ci stored at the corresponding location in the framebuffer. The result 13035bd8deadSopenharmony_ci replaces the values in the framebuffer at the fragment's (x[w], 13045bd8deadSopenharmony_ci y[w]) coordinates. If the selected draw buffers refer to the same 13055bd8deadSopenharmony_ci framebuffer-attachable image more than once, then the values stored 13065bd8deadSopenharmony_ci in that image are undefined." 13075bd8deadSopenharmony_ci 13085bd8deadSopenharmony_ci Change section 4.2.1 "Selecting a Buffer for Writing", to read as follows: 13095bd8deadSopenharmony_ci 13105bd8deadSopenharmony_ci "The first such operation is controlling the buffers into which each of 13115bd8deadSopenharmony_ci the fragment color values is written. This is accomplished with either 13125bd8deadSopenharmony_ci DrawBuffer or DrawBuffers. The command 13135bd8deadSopenharmony_ci 13145bd8deadSopenharmony_ci void DrawBuffer( enum buf ); 13155bd8deadSopenharmony_ci 13165bd8deadSopenharmony_ci defines the set of color buffers to which fragment color zero is 13175bd8deadSopenharmony_ci written. <buf> must be one of the values from tables 4.4 or 10.nnn. In 13185bd8deadSopenharmony_ci addition, acceptable values for <buf> depend on whether the GL is using 13195bd8deadSopenharmony_ci the default framebuffer (i.e., DRAW_FRAMEBUFFER_BINDING is zero), or a 13205bd8deadSopenharmony_ci framebuffer object (i.e., DRAW_FRAMEBUFFER_BINDING is non-zero). In the 13215bd8deadSopenharmony_ci initial state, the GL is bound to the default framebuffer. For more 13225bd8deadSopenharmony_ci information about framebuffer objects, see section 4.4. 13235bd8deadSopenharmony_ci 13245bd8deadSopenharmony_ci If the GL is bound to the default framebuffer, then 13255bd8deadSopenharmony_ci <buf> must be one the values listed in table 4.4, which summarizes 13265bd8deadSopenharmony_ci the constants and the buffers they indicate. In this case, <buf> is 13275bd8deadSopenharmony_ci a symbolic constant specifying zero, one, two, or four buffers for 13285bd8deadSopenharmony_ci writing. These constants refer to the four potentially visible 13295bd8deadSopenharmony_ci buffers front left, front right, back left, and back right, and to 13305bd8deadSopenharmony_ci the auxiliary buffers. Arguments other than AUXi that omit 13315bd8deadSopenharmony_ci reference to LEFT or RIGHT refer to both left and right buffers. 13325bd8deadSopenharmony_ci Arguments other than AUXi that omit reference to FRONT or BACK refer 13335bd8deadSopenharmony_ci to both front and back buffers. AUXi enables drawing only to 13345bd8deadSopenharmony_ci auxiliary buffer i. Each AUXi adheres to AUXi = AUX0 + i, 13355bd8deadSopenharmony_ci and i must be in the range 0 to the value of AUX_BUFFERS minus one. 13365bd8deadSopenharmony_ci 13375bd8deadSopenharmony_ci If the GL is bound to a framebuffer object, 13385bd8deadSopenharmony_ci <buf> must be one of the values listed in table 10.nnn, which 13395bd8deadSopenharmony_ci summarizes the constants and the buffers they indicate. In this 13405bd8deadSopenharmony_ci case, <buf> is a symbolic constant specifying a single color buffer 13415bd8deadSopenharmony_ci for writing. Specifying COLOR_ATTACHMENTi enables drawing only 13425bd8deadSopenharmony_ci to the image attached to the framebuffer at COLOR_ATTACHMENTi. 13435bd8deadSopenharmony_ci Each COLOR_ATTACHMENTi adheres to COLOR_ATTACHMENTi = 13445bd8deadSopenharmony_ci COLOR_ATTACHMENT0 + i. The initial value of DRAW_BUFFER for 13455bd8deadSopenharmony_ci application-created framebuffer objects is COLOR_ATTACHMENT0. 13465bd8deadSopenharmony_ci 13475bd8deadSopenharmony_ci 13485bd8deadSopenharmony_ci Symbolic Constant Meaning 13495bd8deadSopenharmony_ci ----------------- ------- 13505bd8deadSopenharmony_ci NONE no buffer 13515bd8deadSopenharmony_ci COLOR_ATTACHMENTi (see caption) output fragment color to image attached 13525bd8deadSopenharmony_ci at color attachment point i 13535bd8deadSopenharmony_ci ------------------------------------------------------------------- 13545bd8deadSopenharmony_ci Table 10.nnn: Arguments to DrawBuffer(s) and ReadBuffer when the 13555bd8deadSopenharmony_ci context is bound to a framebuffer object, and 13565bd8deadSopenharmony_ci the buffers they indicate. i in COLOR_ATTACHMENTi may range from 13575bd8deadSopenharmony_ci zero to the value of MAX_COLOR_ATTACHMENTS - 1. 13585bd8deadSopenharmony_ci 13595bd8deadSopenharmony_ci If the GL is bound to the default framebuffer and 13605bd8deadSopenharmony_ci DrawBuffer is supplied with a constant (other than NONE) that does 13615bd8deadSopenharmony_ci not indicate any of the color buffers allocated to the GL context, 13625bd8deadSopenharmony_ci the error INVALID_OPERATION results. 13635bd8deadSopenharmony_ci 13645bd8deadSopenharmony_ci If the GL is bound to a framebuffer object and <buf> is one of the 13655bd8deadSopenharmony_ci constants from table 4.4, then the error INVALID_OPERATION results. 13665bd8deadSopenharmony_ci If <buf> is COLOR_ATTACHMENT<m> and <m> is greater than or equal to 13675bd8deadSopenharmony_ci the value of MAX_COLOR_ATTACHMENTS, then the error INVALID_VALUE 13685bd8deadSopenharmony_ci results. 13695bd8deadSopenharmony_ci 13705bd8deadSopenharmony_ci If DrawBuffer is supplied with a constant that is neither legal for 13715bd8deadSopenharmony_ci the default framebuffer nor a framebuffer object, then the error 13725bd8deadSopenharmony_ci INVALID_ENUM results. 13735bd8deadSopenharmony_ci 13745bd8deadSopenharmony_ci DrawBuffer will set the draw buffer for fragment colors other than 13755bd8deadSopenharmony_ci zero to NONE. 13765bd8deadSopenharmony_ci 13775bd8deadSopenharmony_ci The command 13785bd8deadSopenharmony_ci 13795bd8deadSopenharmony_ci void DrawBuffers( sizei n, const enum *bufs ); 13805bd8deadSopenharmony_ci 13815bd8deadSopenharmony_ci defines the draw buffers to which all fragment colors are written. 13825bd8deadSopenharmony_ci <n> specifies the number of buffers in <bufs>. <bufs> is a pointer 13835bd8deadSopenharmony_ci to an array of symbolic constants specifying the buffer to which 13845bd8deadSopenharmony_ci each fragment color is written. 13855bd8deadSopenharmony_ci 13865bd8deadSopenharmony_ci Each buffer listed in <bufs> must be one of the values from tables 13875bd8deadSopenharmony_ci 10.nnn or 11.nnn. Otherwise, an INVALID_ENUM error is generated. 13885bd8deadSopenharmony_ci Further, acceptable values for the constants in <bufs> depend on 13895bd8deadSopenharmony_ci whether the GL is using the default 13905bd8deadSopenharmony_ci framebuffer (i.e., DRAW_FRAMEBUFFER_BINDING is zero), or an 13915bd8deadSopenharmony_ci framebuffer object (i.e., 13925bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING is non-zero). For more information about 13935bd8deadSopenharmony_ci framebuffer objects, see section 4.4. 13945bd8deadSopenharmony_ci 13955bd8deadSopenharmony_ci 13965bd8deadSopenharmony_ci symbolic front front back back aux 13975bd8deadSopenharmony_ci constant left right left right i 13985bd8deadSopenharmony_ci -------- ----- ----- ---- ----- --- 13995bd8deadSopenharmony_ci NONE 14005bd8deadSopenharmony_ci FRONT LEFT X 14015bd8deadSopenharmony_ci FRONT RIGHT X 14025bd8deadSopenharmony_ci BACK LEFT X 14035bd8deadSopenharmony_ci BACK RIGHT X 14045bd8deadSopenharmony_ci AUXi X 14055bd8deadSopenharmony_ci -------------------------------------------------- 14065bd8deadSopenharmony_ci Table 11.nnn: Arguments to DrawBuffers, when the context is bound 14075bd8deadSopenharmony_ci to the default framebuffer, and the buffers that they indicate. 14085bd8deadSopenharmony_ci 14095bd8deadSopenharmony_ci If the GL is bound to the default 14105bd8deadSopenharmony_ci framebuffer, then each of the constants must be one of the 14115bd8deadSopenharmony_ci values listed in table 11.nnn. 14125bd8deadSopenharmony_ci 14135bd8deadSopenharmony_ci If the GL is bound to a framebuffer object, 14145bd8deadSopenharmony_ci then each of the constants must be one of the values listed in table 14155bd8deadSopenharmony_ci 10.nnn. 14165bd8deadSopenharmony_ci 14175bd8deadSopenharmony_ci In both cases, the draw buffers being defined correspond in order to 14185bd8deadSopenharmony_ci the respective fragment colors. The draw buffer for fragment colors 14195bd8deadSopenharmony_ci beyond <n> is set to NONE. 14205bd8deadSopenharmony_ci 14215bd8deadSopenharmony_ci The maximum number of draw buffers is implementation dependent and 14225bd8deadSopenharmony_ci must be at least 1. The number of draw buffers supported can be 14235bd8deadSopenharmony_ci queried by calling GetIntegerv with the symbolic constant 14245bd8deadSopenharmony_ci MAX_DRAW_BUFFERS. An INVALID_VALUE error is generated if <n> is 14255bd8deadSopenharmony_ci greater than MAX_DRAW_BUFFERS. 14265bd8deadSopenharmony_ci 14275bd8deadSopenharmony_ci Except for NONE, a buffer may not appear more then once in the array 14285bd8deadSopenharmony_ci pointed to by <bufs>. Specifying a buffer more then once will 14295bd8deadSopenharmony_ci result in the error INVALID_OPERATION. 14305bd8deadSopenharmony_ci 14315bd8deadSopenharmony_ci If fixed-function fragment shading is being performed, DrawBuffers 14325bd8deadSopenharmony_ci specifies a set of draw buffers into which the fragment color is 14335bd8deadSopenharmony_ci written. 14345bd8deadSopenharmony_ci 14355bd8deadSopenharmony_ci If a fragment shader writes to "gl_FragColor", DrawBuffers specifies 14365bd8deadSopenharmony_ci a set of draw buffers into which the single fragment color defined 14375bd8deadSopenharmony_ci by "gl_FragColor" is written. If a fragment shader writes to 14385bd8deadSopenharmony_ci "gl_FragData", DrawBuffers specifies a set of draw buffers into which 14395bd8deadSopenharmony_ci each of the multiple fragment colors defined by "gl_FragData" are 14405bd8deadSopenharmony_ci separately written. If a fragment shader writes to neither 14415bd8deadSopenharmony_ci "gl_FragColor" nor "gl_FragData", the values of the fragment colors 14425bd8deadSopenharmony_ci following shader execution are undefined, and may differ for each 14435bd8deadSopenharmony_ci fragment color. 14445bd8deadSopenharmony_ci 14455bd8deadSopenharmony_ci For both the default framebuffer and framebuffer objects, 14465bd8deadSopenharmony_ci the constants FRONT, BACK, LEFT, RIGHT, and 14475bd8deadSopenharmony_ci FRONT_AND_BACK are not valid in the <bufs> array passed to 14485bd8deadSopenharmony_ci DrawBuffers, and will result in the error INVALID_OPERATION. This 14495bd8deadSopenharmony_ci restriction is because these constants may themselves refer to 14505bd8deadSopenharmony_ci multiple buffers, as shown in table 4.4. 14515bd8deadSopenharmony_ci 14525bd8deadSopenharmony_ci If the GL is bound to the default framebuffer and 14535bd8deadSopenharmony_ci DrawBuffers is supplied with a constant (other than NONE) that does 14545bd8deadSopenharmony_ci not indicate any of the color buffers allocated to the GL context by 14555bd8deadSopenharmony_ci the window system, the error INVALID_OPERATION will be generated. 14565bd8deadSopenharmony_ci 14575bd8deadSopenharmony_ci If the GL is bound to a framebuffer object and 14585bd8deadSopenharmony_ci DrawBuffers is supplied with a constant from table 11.nnn, or 14595bd8deadSopenharmony_ci COLOR_ATTACHMENTm where m is greater than or equal to the value of 14605bd8deadSopenharmony_ci MAX_COLOR_ATTACHMENTS, then the error INVALID_OPERATION results. 14615bd8deadSopenharmony_ci 14625bd8deadSopenharmony_ci Indicating a buffer or buffers using DrawBuffer or DrawBuffers 14635bd8deadSopenharmony_ci causes subsequent pixel color value writes to affect the indicated 14645bd8deadSopenharmony_ci buffers. 14655bd8deadSopenharmony_ci 14665bd8deadSopenharmony_ci Specifying NONE as the draw buffer for a fragment color will inhibit 14675bd8deadSopenharmony_ci that fragment color from being written to any buffer. 14685bd8deadSopenharmony_ci 14695bd8deadSopenharmony_ci Monoscopic contexts include only left buffers, while stereoscopic 14705bd8deadSopenharmony_ci contexts include both left and right buffers. Likewise, single 14715bd8deadSopenharmony_ci buffered contexts include only front buffers, while double buffered 14725bd8deadSopenharmony_ci contexts include both front and back buffers. The type of context 14735bd8deadSopenharmony_ci is selected at GL initialization. 14745bd8deadSopenharmony_ci 14755bd8deadSopenharmony_ci The state required to handle color buffer selection for each 14765bd8deadSopenharmony_ci framebuffer is an integer 14775bd8deadSopenharmony_ci for each supported fragment color. For the default 14785bd8deadSopenharmony_ci framebuffer, in the initial state, the draw 14795bd8deadSopenharmony_ci buffer for fragment color zero is FRONT if there are no back 14805bd8deadSopenharmony_ci buffers; otherwise it is BACK. For framebuffer 14815bd8deadSopenharmony_ci objects, in the initial state the draw buffer for fragment color zero is 14825bd8deadSopenharmony_ci COLOR_ATTACHMENT0. For both the default 14835bd8deadSopenharmony_ci framebuffer and framebuffers objects, the initial state 14845bd8deadSopenharmony_ci of draw buffers for fragment colors other then zero is NONE. 14855bd8deadSopenharmony_ci 14865bd8deadSopenharmony_ci The value of the draw buffer selected for fragment color <i> can be 14875bd8deadSopenharmony_ci queried by calling GetIntegerv with the symbolic constant DRAW_BUFFERi. 14885bd8deadSopenharmony_ci DRAW_BUFFER is equivalent to DRAW_BUFFER0." 14895bd8deadSopenharmony_ci 14905bd8deadSopenharmony_ci In section 4.2.2 "Fine Control of Buffer Updates", modify the beginning 14915bd8deadSopenharmony_ci of the paragraph defining <mask> for StencilMask and StencilMaskSeparate 14925bd8deadSopenharmony_ci as follows: 14935bd8deadSopenharmony_ci 14945bd8deadSopenharmony_ci Modify the second to last paragraph of section 4.2.4 "The Accumulation 14955bd8deadSopenharmony_ci Buffer" as follows: 14965bd8deadSopenharmony_ci 14975bd8deadSopenharmony_ci "If there is no accumulation buffer, or if the DRAW_FRAMEBUFFER 14985bd8deadSopenharmony_ci and READ_FRAMEBUFFER bindings (see section 4.4.4.2) do not refer to 14995bd8deadSopenharmony_ci the same object, or if the GL is in color index mode, Accum 15005bd8deadSopenharmony_ci generates the error INVALID_OPERATION." 15015bd8deadSopenharmony_ci 15025bd8deadSopenharmony_ci Replace section 4.3.1 "Writing to the Stencil Buffer" with the following: 15035bd8deadSopenharmony_ci 15045bd8deadSopenharmony_ci "4.3.1 Writing to the Stencil Buffer or to the Depth and Stencil 15055bd8deadSopenharmony_ci Buffers 15065bd8deadSopenharmony_ci 15075bd8deadSopenharmony_ci The operation of DrawPixels was described in section 3.6.4, except 15085bd8deadSopenharmony_ci if the <format> argument was STENCIL_INDEX or DEPTH_STENCIL. In 15095bd8deadSopenharmony_ci this case, all operations described for DrawPixels take place, but 15105bd8deadSopenharmony_ci window (x,y) coordinates, each with the corresponding stencil index, 15115bd8deadSopenharmony_ci or depth value and stencil index, are produced in lieu of fragments. 15125bd8deadSopenharmony_ci Each coordinate-data pair is sent directly to the per-fragment 15135bd8deadSopenharmony_ci operations, bypassing the texture, fog, and antialiasing application 15145bd8deadSopenharmony_ci stages of rasterization. Each pair is then treated as a fragment 15155bd8deadSopenharmony_ci for purposes of the pixel ownership and scissor tests; all other 15165bd8deadSopenharmony_ci per-fragment operations are bypassed. Finally, each stencil index 15175bd8deadSopenharmony_ci is written to its indicated location in the framebuffer, subject to 15185bd8deadSopenharmony_ci the current front stencil mask (set with StencilMask or 15195bd8deadSopenharmony_ci StencilMaskSeparate). If a depth component is present, and if the 15205bd8deadSopenharmony_ci setting of DepthMask is not FALSE, the depth component is also 15215bd8deadSopenharmony_ci written to the framebuffer; the setting of DepthTest is ignored. 15225bd8deadSopenharmony_ci 15235bd8deadSopenharmony_ci The error INVALID_OPERATION results if the <format> argument is 15245bd8deadSopenharmony_ci STENCIL_INDEX and there is no stencil buffer, or if <format> is 15255bd8deadSopenharmony_ci DEPTH_STENCIL and there is not both a depth buffer and a stencil 15265bd8deadSopenharmony_ci buffer." 15275bd8deadSopenharmony_ci 15285bd8deadSopenharmony_ci Add to 4.3.2 "Reading Pixels", right before the subsection titled 15295bd8deadSopenharmony_ci "Obtaining Pixels from the Framebuffer": 15305bd8deadSopenharmony_ci 15315bd8deadSopenharmony_ci "ReadPixels generates an INVALID_OPERATION error 15325bd8deadSopenharmony_ci if READ_FRAMEBUFFER_BINDING 15335bd8deadSopenharmony_ci (see section 4.4) is non-zero, the read framebuffer is framebuffer 15345bd8deadSopenharmony_ci complete, and the value of SAMPLE_BUFFERS for the read framebuffer 15355bd8deadSopenharmony_ci is greater than zero." 15365bd8deadSopenharmony_ci 15375bd8deadSopenharmony_ci In section 4.3.2 "Reading Pixels", add the following paragraph 15385bd8deadSopenharmony_ci after the second paragraph of the section "Obtaining Pixels from 15395bd8deadSopenharmony_ci the Framebuffer": 15405bd8deadSopenharmony_ci 15415bd8deadSopenharmony_ci "If the <format> is DEPTH_STENCIL, then values are taken from 15425bd8deadSopenharmony_ci both the depth buffer and the stencil buffer. If there is no depth 15435bd8deadSopenharmony_ci buffer or if there is no stencil buffer, then the error 15445bd8deadSopenharmony_ci INVALID_OPERATION occurs. If the <type> parameter is not 15455bd8deadSopenharmony_ci UNSIGNED_INT_24_8, then the error INVALID_ENUM occurs. 15465bd8deadSopenharmony_ci 15475bd8deadSopenharmony_ci If there is a multisample buffer, then values are obtained from the 15485bd8deadSopenharmony_ci depth and stencil samples in this buffer. It is recommended that the 15495bd8deadSopenharmony_ci depth and stencil values of the centermost sample be used, though 15505bd8deadSopenharmony_ci implementations may choose any function of the depth and stencil 15515bd8deadSopenharmony_ci sample values at each pixel." 15525bd8deadSopenharmony_ci 15535bd8deadSopenharmony_ci In section 4.3.2 "Reading Pixels" in the subsection "Obtaining Pixels 15545bd8deadSopenharmony_ci from the Framebuffer", modify the first two paragraphs of the 15555bd8deadSopenharmony_ci definition of ReadBuffer to read as follows: 15565bd8deadSopenharmony_ci 15575bd8deadSopenharmony_ci "The command 15585bd8deadSopenharmony_ci 15595bd8deadSopenharmony_ci void ReadBuffer( enum src ); 15605bd8deadSopenharmony_ci 15615bd8deadSopenharmony_ci takes a symbolic constant as argument. <src> must be one of the 15625bd8deadSopenharmony_ci values from tables 4.4 or 10.nnn. Otherwise, INVALID_ENUM is 15635bd8deadSopenharmony_ci generated. Further, the acceptable values for <src> depend on 15645bd8deadSopenharmony_ci whether the GL is using the default 15655bd8deadSopenharmony_ci framebuffer (i.e., READ_FRAMEBUFFER_BINDING is zero), or a 15665bd8deadSopenharmony_ci framebuffer object (i.e., 15675bd8deadSopenharmony_ci READ_FRAMEBUFFER_BINDING is non-zero). For more information about 15685bd8deadSopenharmony_ci framebuffer objects, see section 4.4. 15695bd8deadSopenharmony_ci 15705bd8deadSopenharmony_ci If the object bound to READ_FRAMEBUFFER_BINDING is not <framebuffer 15715bd8deadSopenharmony_ci complete> (as defined in section 4.4.4.2), then ReadPixels generates 15725bd8deadSopenharmony_ci the error INVALID_FRAMEBUFFER_OPERATION. If ReadBuffer is 15735bd8deadSopenharmony_ci supplied with a constant that is neither legal for the default 15745bd8deadSopenharmony_ci framebuffer, nor legal for a 15755bd8deadSopenharmony_ci framebuffer object, then the error INVALID_ENUM results. 15765bd8deadSopenharmony_ci 15775bd8deadSopenharmony_ci When READ_FRAMEBUFFER_BINDING is zero, i.e. the default framebuffer, 15785bd8deadSopenharmony_ci <src> must be one of the values listed in table 4.4, including NONE. 15795bd8deadSopenharmony_ci FRONT_AND_BACK, FRONT, and LEFT refer to the front left buffer, BACK 15805bd8deadSopenharmony_ci refers to the back left buffer, and RIGHT refers to the front right 15815bd8deadSopenharmony_ci buffer. The other constants correspond directly to the buffers that they 15825bd8deadSopenharmony_ci name. If the requested buffer is missing, then the error 15835bd8deadSopenharmony_ci INVALID_OPERATION is generated. For the default framebuffer, the initial 15845bd8deadSopenharmony_ci setting for ReadBuffer is FRONT if there is no back buffer and BACK 15855bd8deadSopenharmony_ci otherwise. 15865bd8deadSopenharmony_ci 15875bd8deadSopenharmony_ci When the GL is using a framebuffer object, <src> must be one of the 15885bd8deadSopenharmony_ci values listed in table 10.nnn, including NONE. In a manner analogous to 15895bd8deadSopenharmony_ci how the DRAW_BUFFERs state is handled, specifying COLOR_ATTACHMENTi 15905bd8deadSopenharmony_ci enables reading from the image attached to the framebuffer at 15915bd8deadSopenharmony_ci COLOR_ATTACHMENTi. For framebuffer objects, the initial setting for 15925bd8deadSopenharmony_ci ReadBuffer is COLOR_ATTACHMENT0. 15935bd8deadSopenharmony_ci 15945bd8deadSopenharmony_ci ReadPixels generates an INVALID_OPERATION error if it attempts to select 15955bd8deadSopenharmony_ci a color buffer while READ_BUFFER is NONE. 15965bd8deadSopenharmony_ci 15975bd8deadSopenharmony_ci ReadPixels obtains values from the selected buffer from each pixel 15985bd8deadSopenharmony_ci with lower left hand corner at (x+i, y+j) for (0 <= i < width) and 15995bd8deadSopenharmony_ci (0 <= j < height); this pixel is said to be the ith pixel in the jth 16005bd8deadSopenharmony_ci row. If any of these pixels lies outside of the window allocated to 16015bd8deadSopenharmony_ci the current GL context, or outside of the image attached to the 16025bd8deadSopenharmony_ci currently bound framebuffer object, then the values obtained for 16035bd8deadSopenharmony_ci those pixels are undefined. When READ_FRAMEBUFFER_BINDING is zero, 16045bd8deadSopenharmony_ci results are also undefined for individual pixels that are not owned 16055bd8deadSopenharmony_ci by the current context. Otherwise, ReadPixels obtains values from 16065bd8deadSopenharmony_ci the selected buffer, regardless of how those values were placed 16075bd8deadSopenharmony_ci there." 16085bd8deadSopenharmony_ci 16095bd8deadSopenharmony_ci In section 4.3.2 "Reading Pixels", modify the last paragraph of the 16105bd8deadSopenharmony_ci subsection "Obtaining Pixels from the Framebuffer", to say: 16115bd8deadSopenharmony_ci 16125bd8deadSopenharmony_ci "... If the GL is in color index mode, and <format> is not 16135bd8deadSopenharmony_ci DEPTH_COMPONENT, STENCIL_INDEX, or DEPTH_STENCIL, then the color 16145bd8deadSopenharmony_ci index is obtained at each pixel location." 16155bd8deadSopenharmony_ci 16165bd8deadSopenharmony_ci In section 4.3.2 "Reading Pixels", add a paragraph at the end of the 16175bd8deadSopenharmony_ci subsection "Obtaining Pixels from the Framebuffer" immediately before 16185bd8deadSopenharmony_ci "Conversion of RGBA values": 16195bd8deadSopenharmony_ci 16205bd8deadSopenharmony_ci "When READ_FRAMEBUFFER_BINDING is non-zero, the red, green, blue, and 16215bd8deadSopenharmony_ci alpha values are obtained by first reading the internal component 16225bd8deadSopenharmony_ci values of the corresponding value in the image attached to the 16235bd8deadSopenharmony_ci selected logical buffer. Internal components are converted to an 16245bd8deadSopenharmony_ci RGBA color by taking each R, G, B, and A component present according 16255bd8deadSopenharmony_ci to the base internal format of the buffer (as shown in table 3.15). 16265bd8deadSopenharmony_ci If G, B, or A values are not present in the internal format, they 16275bd8deadSopenharmony_ci are taken to be zero, zero, and one respectively. 16285bd8deadSopenharmony_ci 16295bd8deadSopenharmony_ci In section 4.3.2 "Reading Pixels", update the first sentence of the 16305bd8deadSopenharmony_ci subsection "Conversion of RGBA values" to say: 16315bd8deadSopenharmony_ci 16325bd8deadSopenharmony_ci "This step applies only if the GL is in RGBA mode, and then only if 16335bd8deadSopenharmony_ci <format> is neither STENCIL_INDEX, DEPTH_COMPONENT, nor 16345bd8deadSopenharmony_ci DEPTH_STENCIL." 16355bd8deadSopenharmony_ci 16365bd8deadSopenharmony_ci In section 4.3.2 "Reading Pixels", update the section "Conversion 16375bd8deadSopenharmony_ci of Depth values" to say: 16385bd8deadSopenharmony_ci 16395bd8deadSopenharmony_ci "This step applies only if <format> is DEPTH_COMPONENT or 16405bd8deadSopenharmony_ci DEPTH_STENCIL. Each element taken from the depth buffer is 16415bd8deadSopenharmony_ci taken to be a fixed-point value in [0,1] with m bits, where m is the 16425bd8deadSopenharmony_ci number of bits in the depth buffer (see section 2.11.1)." 16435bd8deadSopenharmony_ci 16445bd8deadSopenharmony_ci Add a row to Table 4.6, in section 4.3.2 "Reading Pixels": 16455bd8deadSopenharmony_ci 16465bd8deadSopenharmony_ci type Parameter Index Mask 16475bd8deadSopenharmony_ci ----------------- ---------- 16485bd8deadSopenharmony_ci ... ... 16495bd8deadSopenharmony_ci INT 2^31-1 16505bd8deadSopenharmony_ci UNSIGNED_INT_24_8 2^8-1 16515bd8deadSopenharmony_ci 16525bd8deadSopenharmony_ci Modify the first sentence of section 4.3.3 "Copying Pixels" as follows: 16535bd8deadSopenharmony_ci 16545bd8deadSopenharmony_ci "CopyPixels transfers a rectangle of pixel values from one region 16555bd8deadSopenharmony_ci of the read framebuffer to another in the draw framebuffer." 16565bd8deadSopenharmony_ci 16575bd8deadSopenharmony_ci In section 4.3.3 "Copying Pixels", update the second and third 16585bd8deadSopenharmony_ci paragraphs to say: 16595bd8deadSopenharmony_ci 16605bd8deadSopenharmony_ci "<type> is a symbolic constant that must be one of COLOR, STENCIL, 16615bd8deadSopenharmony_ci DEPTH, or DEPTH_STENCIL, indicating that the values to be 16625bd8deadSopenharmony_ci transferred are colors, stencil values, depth values, or 16635bd8deadSopenharmony_ci depth/stencil values, respectively. The first four arguments have the 16645bd8deadSopenharmony_ci same interpretation as the corresponding arguments to ReadPixels. 16655bd8deadSopenharmony_ci 16665bd8deadSopenharmony_ci Values are obtained from the framebuffer, converted (if 16675bd8deadSopenharmony_ci appropriate), then subjected to the pixel transfer operations 16685bd8deadSopenharmony_ci described in section 3.6.5, just as if ReadPixels were called with 16695bd8deadSopenharmony_ci the corresponding arguments. If the <type> is STENCIL or DEPTH, 16705bd8deadSopenharmony_ci then it is as if the <format> for ReadPixels were STENCIL_INDEX, or 16715bd8deadSopenharmony_ci DEPTH_COMPONENT, respectively. If the <type> is DEPTH_STENCIL, 16725bd8deadSopenharmony_ci then it is as if the <format> for ReadPixels were specified as 16735bd8deadSopenharmony_ci described in table 4.6b. If the <type> is COLOR, then if the GL is 16745bd8deadSopenharmony_ci in RGBA mode, it is as if the <format> were RGBA, while if the GL is 16755bd8deadSopenharmony_ci in color index mode, it is as if the <format> were COLOR_INDEX." 16765bd8deadSopenharmony_ci 16775bd8deadSopenharmony_ci Add Table 4.6b: 16785bd8deadSopenharmony_ci 16795bd8deadSopenharmony_ci DEPTH_BITS STENCIL_BITS format 16805bd8deadSopenharmony_ci ---------- ------------ --------------- 16815bd8deadSopenharmony_ci zero zero DEPTH_STENCIL 16825bd8deadSopenharmony_ci zero non-zero DEPTH_COMPONENT 16835bd8deadSopenharmony_ci non-zero zero STENCIL_INDEX 16845bd8deadSopenharmony_ci non-zero non-zero DEPTH_STENCIL 16855bd8deadSopenharmony_ci 16865bd8deadSopenharmony_ci Table 4.6b: Effective ReadPixels format for DEPTH_STENCIL 16875bd8deadSopenharmony_ci CopyPixels operation. 16885bd8deadSopenharmony_ci 16895bd8deadSopenharmony_ci Add a row to Table 4.7 (page 224): 16905bd8deadSopenharmony_ci 16915bd8deadSopenharmony_ci type Parameter GL Type Component Conversion ... 16925bd8deadSopenharmony_ci --------------------------- ------- --------------------------- 16935bd8deadSopenharmony_ci ... ... ... 16945bd8deadSopenharmony_ci UNSIGNED_INT_2_10_10_10_REV uint c = (2^N - 1)f 16955bd8deadSopenharmony_ci UNSIGNED_INT_24_8 uint c = (2^N - 1)f (depth only) 16965bd8deadSopenharmony_ci 16975bd8deadSopenharmony_ci Add the following text to section 4.3.3 "Copying Pixels", inside the 16985bd8deadSopenharmony_ci definition of CopyPixels: 16995bd8deadSopenharmony_ci 17005bd8deadSopenharmony_ci "Finally, the behavior of several GL operations is specified "as if 17015bd8deadSopenharmony_ci the arguments were passed to CopyPixels." These operations include: 17025bd8deadSopenharmony_ci CopyTex{Sub}Image*, CopyColor{Sub}Table, and CopyConvolutionFilter*. 17035bd8deadSopenharmony_ci An INVALID_FRAMEBUFFER_OPERATION error will be generated if an attempt is 17045bd8deadSopenharmony_ci made to execute one of these operations, or CopyPixels, while the 17055bd8deadSopenharmony_ci object bound to READ_FRAMEBUFFER_BINDING (see section 4.4) is not 17065bd8deadSopenharmony_ci "framebuffer complete" (as defined in section 4.4.4.2). 17075bd8deadSopenharmony_ci An INVALID_OPERATION error will be generated if the object bound to 17085bd8deadSopenharmony_ci READ_FRAMEBUFFER_BINDING is "framebuffer complete" and the value 17095bd8deadSopenharmony_ci of SAMPLE_BUFFERS is greater than zero. 17105bd8deadSopenharmony_ci 17115bd8deadSopenharmony_ci CopyPixels will generate an INVALID_FRAMEBUFFER_OPERATION error 17125bd8deadSopenharmony_ci if the object bound to DRAW_FRAMEBUFFER_BINDING (see section 17135bd8deadSopenharmony_ci 4.4) is not "framebuffer complete". 17145bd8deadSopenharmony_ci 17155bd8deadSopenharmony_ci Append to section 4.3.3 "Copying Pixels": 17165bd8deadSopenharmony_ci 17175bd8deadSopenharmony_ci "The command 17185bd8deadSopenharmony_ci 17195bd8deadSopenharmony_ci BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, 17205bd8deadSopenharmony_ci int dstX0, int dstY0, int dstX1, int dstY1, 17215bd8deadSopenharmony_ci bitfield mask, enum filter); 17225bd8deadSopenharmony_ci 17235bd8deadSopenharmony_ci transfers a rectangle of pixel values from one 17245bd8deadSopenharmony_ci region of the read framebuffer to another in the draw framebuffer. 17255bd8deadSopenharmony_ci There are some important distinctions from CopyPixels, as 17265bd8deadSopenharmony_ci described below. 17275bd8deadSopenharmony_ci 17285bd8deadSopenharmony_ci <mask> is the bitwise OR of a number of values indicating which 17295bd8deadSopenharmony_ci buffers are to be copied. The values are COLOR_BUFFER_BIT, 17305bd8deadSopenharmony_ci DEPTH_BUFFER_BIT, and STENCIL_BUFFER_BIT, which are described in 17315bd8deadSopenharmony_ci section 4.2.3. The pixels corresponding to these buffers are 17325bd8deadSopenharmony_ci copied from the source rectangle bounded by the locations (srcX0, 17335bd8deadSopenharmony_ci srcY0) and (srcX1, srcY1), to the destination rectangle bounded by 17345bd8deadSopenharmony_ci the locations (dstX0, dstY0) and (dstX1, dstY1). The lower bounds 17355bd8deadSopenharmony_ci of the rectangle are inclusive, while the upper bounds are 17365bd8deadSopenharmony_ci exclusive. 17375bd8deadSopenharmony_ci 17385bd8deadSopenharmony_ci When the color buffer is transferred, values are taken from the read 17395bd8deadSopenharmony_ci buffer of the read framebuffer and written to each of the draw buffers 17405bd8deadSopenharmony_ci of the draw framebuffer, just as with CopyPixels. 17415bd8deadSopenharmony_ci 17425bd8deadSopenharmony_ci The actual region taken from the read framebuffer is limited to the 17435bd8deadSopenharmony_ci intersection of the source buffers being transferred, which may include 17445bd8deadSopenharmony_ci the color buffer selected by the read buffer, the depth buffer, and/or 17455bd8deadSopenharmony_ci the stencil buffer depending on <mask>. 17465bd8deadSopenharmony_ci The actual region written to the draw framebuffer is limited to the 17475bd8deadSopenharmony_ci intersection of the destination buffers being written, which may include 17485bd8deadSopenharmony_ci multiple draw buffers, the depth buffer, and/or the stencil buffer 17495bd8deadSopenharmony_ci depending on <mask> 17505bd8deadSopenharmony_ci Whether or not the source or destination regions are altered due to 17515bd8deadSopenharmony_ci these limits, the scaling and offset applied to pixels being transferred 17525bd8deadSopenharmony_ci is performed as though no such limits were present. 17535bd8deadSopenharmony_ci 17545bd8deadSopenharmony_ci If the source and destination rectangle dimensions do not match, 17555bd8deadSopenharmony_ci the source image is stretched to fit the destination 17565bd8deadSopenharmony_ci rectangle. <filter> must be LINEAR or NEAREST and specifies the 17575bd8deadSopenharmony_ci method of interpolation to be applied if the image is 17585bd8deadSopenharmony_ci stretched. LINEAR filtering is allowed only for the color buffer; 17595bd8deadSopenharmony_ci if <mask> includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT, and 17605bd8deadSopenharmony_ci filter is not NEAREST, no copy is performed and an 17615bd8deadSopenharmony_ci INVALID_OPERATION error is generated. If the source and 17625bd8deadSopenharmony_ci destination dimensions are identical, no filtering is applied. If 17635bd8deadSopenharmony_ci either the source or destination rectangle specifies a negative 17645bd8deadSopenharmony_ci width or height (X1 < X0 or Y1 < Y0), 17655bd8deadSopenharmony_ci the image is reversed in the corresponding direction. 17665bd8deadSopenharmony_ci If both the source and destination rectangles specify a negative 17675bd8deadSopenharmony_ci dimension for the same direction, no reversal is performed. 17685bd8deadSopenharmony_ci If a linear filter is selected and the rules of LINEAR sampling 17695bd8deadSopenharmony_ci would require sampling outside the bounds of a source buffer, it is 17705bd8deadSopenharmony_ci as though CLAMP_TO_EDGE texture sampling were being performed. If a 17715bd8deadSopenharmony_ci linear filter is selected and sampling would be required outside the 17725bd8deadSopenharmony_ci bounds of the specified source region, but within the bounds of a 17735bd8deadSopenharmony_ci source buffer, the implementation may choose to clamp while sampling 17745bd8deadSopenharmony_ci or not. 17755bd8deadSopenharmony_ci 17765bd8deadSopenharmony_ci If the source and destination buffers are identical, and the 17775bd8deadSopenharmony_ci source and destination rectangles overlap, the result of the blit 17785bd8deadSopenharmony_ci operation is undefined. 17795bd8deadSopenharmony_ci 17805bd8deadSopenharmony_ci Blit operations bypass the fragment pipeline. The only fragment 17815bd8deadSopenharmony_ci operations which affect a blit are the pixel ownership test and 17825bd8deadSopenharmony_ci the scissor test. 17835bd8deadSopenharmony_ci 17845bd8deadSopenharmony_ci If a buffer is specified in <mask> and does not exist in both the 17855bd8deadSopenharmony_ci read and draw framebuffers, the corresponding bit is silently 17865bd8deadSopenharmony_ci ignored. 17875bd8deadSopenharmony_ci 17885bd8deadSopenharmony_ci If the color formats of the read and draw framebuffers do not 17895bd8deadSopenharmony_ci match, and <mask> includes COLOR_BUFFER_BIT, pixel groups are 17905bd8deadSopenharmony_ci converted to match the destination format as in CopyPixels. 17915bd8deadSopenharmony_ci However, no pixel transfer operations are applied, and clamping 17925bd8deadSopenharmony_ci behaves as if CLAMP_FRAGMENT_COLOR_ARB is set to FIXED_ONLY_ARB. 17935bd8deadSopenharmony_ci Format conversion is not supported for all data types. If the read 17945bd8deadSopenharmony_ci buffer contains floating-point values and any draw buffer does not 17955bd8deadSopenharmony_ci contain floating-point values, or if the read buffer contains 17965bd8deadSopenharmony_ci non-floating-point values and any draw buffer contains 17975bd8deadSopenharmony_ci floating-point values, an INVALID_OPERATION error is generated. 17985bd8deadSopenharmony_ci 17995bd8deadSopenharmony_ci Calling BlitFramebuffer will result in an 18005bd8deadSopenharmony_ci INVALID_FRAMEBUFFER_OPERATION error if the objects bound to 18015bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING and READ_FRAMEBUFFER_BINDING are 18025bd8deadSopenharmony_ci not "framebuffer complete" (see section 4.4.4.2)." 18035bd8deadSopenharmony_ci 18045bd8deadSopenharmony_ci Calling BlitFramebuffer will result in an INVALID_OPERATION 18055bd8deadSopenharmony_ci error if <mask> includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT 18065bd8deadSopenharmony_ci and the source and destination depth and stencil buffer formats do 18075bd8deadSopenharmony_ci not match. 18085bd8deadSopenharmony_ci 18095bd8deadSopenharmony_ci If SAMPLE_BUFFERS for the read framebuffer is greater than zero and 18105bd8deadSopenharmony_ci SAMPLE_BUFFERS for the draw framebuffer is zero, the samples 18115bd8deadSopenharmony_ci corresponding to each pixel location in the source are converted to 18125bd8deadSopenharmony_ci a single sample before being written to the destination. 18135bd8deadSopenharmony_ci 18145bd8deadSopenharmony_ci If SAMPLE_BUFFERS for the read framebuffer is zero and 18155bd8deadSopenharmony_ci SAMPLE_BUFFERS for the draw framebuffer is greater than zero, the 18165bd8deadSopenharmony_ci value of the source sample is replicated in each of the destination 18175bd8deadSopenharmony_ci samples. 18185bd8deadSopenharmony_ci 18195bd8deadSopenharmony_ci If SAMPLE_BUFFERS for both the read and draw framebuffers are 18205bd8deadSopenharmony_ci greater than zero, and the values of SAMPLES for the read and draw 18215bd8deadSopenharmony_ci framebuffers are identical, the samples are copied without 18225bd8deadSopenharmony_ci modification from the read framebuffer to the draw framebuffer. 18235bd8deadSopenharmony_ci Otherwise, no copy is performed and an INVALID_OPERATION error is 18245bd8deadSopenharmony_ci generated. Note that the samples in the draw buffer are not 18255bd8deadSopenharmony_ci guaranteed to be at the same sample location as the read buffer, 18265bd8deadSopenharmony_ci so rendering using this newly created buffer can potentially 18275bd8deadSopenharmony_ci have geometry cracks or incorrect antialiasing. This may occur 18285bd8deadSopenharmony_ci if the sizes of the framebuffers do not match, if the 18295bd8deadSopenharmony_ci formats differ, or if the source and destination rectangles are 18305bd8deadSopenharmony_ci not defined with the same (X0,Y0) and (X1,Y1) bounds. 18315bd8deadSopenharmony_ci 18325bd8deadSopenharmony_ci If SAMPLE_BUFFERS for either the read framebuffer or 18335bd8deadSopenharmony_ci draw framebuffer is greater than zero, no copy is performed and an 18345bd8deadSopenharmony_ci INVALID_OPERATION error is generated if the dimensions of the source 18355bd8deadSopenharmony_ci and destination rectangles provided to BlitFramebuffer are not 18365bd8deadSopenharmony_ci identical, or if the formats of the read and draw framebuffers are 18375bd8deadSopenharmony_ci not identical. 18385bd8deadSopenharmony_ci 18395bd8deadSopenharmony_ci 18405bd8deadSopenharmony_ci Add a new section "Framebuffer Objects" after section 4.3: 18415bd8deadSopenharmony_ci 18425bd8deadSopenharmony_ci "4.4 Framebuffer Objects 18435bd8deadSopenharmony_ci 18445bd8deadSopenharmony_ci As described in chapters 1 and 2, GL renders into (and reads values 18455bd8deadSopenharmony_ci from) a framebuffer. GL defines two classes of framebuffers: 18465bd8deadSopenharmony_ci window-system-provided framebuffers and application-created 18475bd8deadSopenharmony_ci framebuffers. For each GL context, there is a single framebuffer 18485bd8deadSopenharmony_ci provided by the window-system, and there may also be one or more 18495bd8deadSopenharmony_ci framebuffer objects created and managed by the application. 18505bd8deadSopenharmony_ci 18515bd8deadSopenharmony_ci By default, the GL uses the window-system-provided framebuffer. The 18525bd8deadSopenharmony_ci storage, dimensions, allocation, and format of the images attached 18535bd8deadSopenharmony_ci to this framebuffer are managed entirely by the window-system. 18545bd8deadSopenharmony_ci Consequently, the state of the window-system-provided framebuffer, 18555bd8deadSopenharmony_ci including its images, can not be changed by the GL, nor can the 18565bd8deadSopenharmony_ci window-system-provided framebuffer itself, or its images, be deleted 18575bd8deadSopenharmony_ci by the GL. 18585bd8deadSopenharmony_ci 18595bd8deadSopenharmony_ci The routines described in the following sections, however, can be 18605bd8deadSopenharmony_ci used to create, destroy, and modify the state and attachments of 18615bd8deadSopenharmony_ci application-created framebuffer objects. 18625bd8deadSopenharmony_ci 18635bd8deadSopenharmony_ci Application-created framebuffer objects encapsulate the state of a 18645bd8deadSopenharmony_ci framebuffer in a similar manner to the way texture objects 18655bd8deadSopenharmony_ci encapsulate the state of a texture. In particular, a framebuffer 18665bd8deadSopenharmony_ci object encapsulates state necessary to describe a collection of 18675bd8deadSopenharmony_ci color, depth, and stencil logical buffers (accumulation and 18685bd8deadSopenharmony_ci auxiliary buffers are not allowed). For each 18695bd8deadSopenharmony_ci logical buffer, a framebuffer-attachable image can be attached to 18705bd8deadSopenharmony_ci the framebuffer to store the rendered output for that logical 18715bd8deadSopenharmony_ci buffer. Examples of framebuffer-attachable images include texture 18725bd8deadSopenharmony_ci images and renderbuffer images. Renderbuffers are described further 18735bd8deadSopenharmony_ci in section 4.4.2.1 18745bd8deadSopenharmony_ci 18755bd8deadSopenharmony_ci By allowing the images of a renderbuffer to be attached to a 18765bd8deadSopenharmony_ci framebuffer, the GL provides a mechanism to support "off-screen" 18775bd8deadSopenharmony_ci rendering. Further, by allowing the images of a texture to be 18785bd8deadSopenharmony_ci attached to a framebuffer, the GL provides a mechanism to support 18795bd8deadSopenharmony_ci "render to texture". 18805bd8deadSopenharmony_ci 18815bd8deadSopenharmony_ci 4.4.1 Binding and Managing Framebuffer Objects 18825bd8deadSopenharmony_ci 18835bd8deadSopenharmony_ci The default framebuffer for rendering and readback operations is 18845bd8deadSopenharmony_ci provided by the window system. In addition, named framebuffer 18855bd8deadSopenharmony_ci objects can be created and operated upon. The namespace for 18865bd8deadSopenharmony_ci framebuffer objects is the unsigned integers, with zero reserved 18875bd8deadSopenharmony_ci by the GL for the default framebuffer. 18885bd8deadSopenharmony_ci 18895bd8deadSopenharmony_ci A framebuffer object is created by binding 18905bd8deadSopenharmony_ci a name returned by GenFramebuffers (see below) to 18915bd8deadSopenharmony_ci DRAW_FRAMEBUFFER or READ_FRAMEBUFFER. The binding is 18925bd8deadSopenharmony_ci effected by calling 18935bd8deadSopenharmony_ci 18945bd8deadSopenharmony_ci void BindFramebuffer(enum target, uint framebuffer); 18955bd8deadSopenharmony_ci 18965bd8deadSopenharmony_ci with <target> set to the desired framebuffer target and 18975bd8deadSopenharmony_ci <framebuffer> set to the framebuffer object name. 18985bd8deadSopenharmony_ci The resulting framebuffer 18995bd8deadSopenharmony_ci object is a new state vector, comprising all the state values 19005bd8deadSopenharmony_ci listed in table 4.nnn, as well as one set of the state values 19015bd8deadSopenharmony_ci listed in table 5.nnn for each attachment point of the 19025bd8deadSopenharmony_ci framebuffer, set to the same initial values. There are 19035bd8deadSopenharmony_ci MAX_COLOR_ATTACHMENTS color attachment points, plus one each 19045bd8deadSopenharmony_ci for the depth and stencil attachment points. 19055bd8deadSopenharmony_ci 19065bd8deadSopenharmony_ci BindFramebuffer may also be used to bind an existing 19075bd8deadSopenharmony_ci framebuffer object to DRAW_FRAMEBUFFER or 19085bd8deadSopenharmony_ci READ_FRAMEBUFFER. If the bind is successful no change is made 19095bd8deadSopenharmony_ci to the state of the bound framebuffer object, and any previous 19105bd8deadSopenharmony_ci binding to <target> is broken. 19115bd8deadSopenharmony_ci 19125bd8deadSopenharmony_ci BindFramebuffer fails and an INVALID_OPERATION error is generated if 19135bd8deadSopenharmony_ci <framebuffer> is not zero or a name returned from a previous call to 19145bd8deadSopenharmony_ci GenFramebuffers, or if such a name has since been deleted with 19155bd8deadSopenharmony_ci DeleteFramebuffers. 19165bd8deadSopenharmony_ci 19175bd8deadSopenharmony_ci If a framebuffer object is bound to DRAW_FRAMEBUFFER or 19185bd8deadSopenharmony_ci READ_FRAMEBUFFER, it becomes the target for rendering or 19195bd8deadSopenharmony_ci readback operations, respectively, until it is deleted or another 19205bd8deadSopenharmony_ci framebuffer is bound to the corresponding bind point. Calling 19215bd8deadSopenharmony_ci BindFramebuffer with <target> set to FRAMEBUFFER binds the 19225bd8deadSopenharmony_ci framebuffer to both the draw and read targets. 19235bd8deadSopenharmony_ci 19245bd8deadSopenharmony_ci While a framebuffer object is bound, GL operations on the target 19255bd8deadSopenharmony_ci to which it is bound affect the images attached to the bound 19265bd8deadSopenharmony_ci framebuffer object, and queries of the target to which it is bound 19275bd8deadSopenharmony_ci return state from the bound object. Queries of the values 19285bd8deadSopenharmony_ci specified in table 6.31 (Implementation Dependent Pixel Depths) 19295bd8deadSopenharmony_ci and table 8.nnn (Framebuffer-Dependent State Variables) are 19305bd8deadSopenharmony_ci derived from the framebuffer object bound to DRAW_FRAMEBUFFER. 19315bd8deadSopenharmony_ci 19325bd8deadSopenharmony_ci The initial state of DRAW_FRAMEBUFFER and READ_FRAMEBUFFER 19335bd8deadSopenharmony_ci refers to the default framebuffer. 19345bd8deadSopenharmony_ci In order that access to the default framebuffer is not 19355bd8deadSopenharmony_ci lost, it is treated as a framebuffer object with the name of zero. 19365bd8deadSopenharmony_ci The default framebuffer is therefore rendered to and read from 19375bd8deadSopenharmony_ci while zero is bound to the corresponding targets. On some 19385bd8deadSopenharmony_ci implementations, the properties of the default framebuffer can 19395bd8deadSopenharmony_ci change over time (e.g., in response to window system events 19405bd8deadSopenharmony_ci such as attaching the context to a new window system drawable.) 19415bd8deadSopenharmony_ci 19425bd8deadSopenharmony_ci Framebuffer objects (those with a non-zero 19435bd8deadSopenharmony_ci name) differ from the default framebuffer in 19445bd8deadSopenharmony_ci a few important ways. First and foremost, unlike the 19455bd8deadSopenharmony_ci default framebuffer, framebuffer objects 19465bd8deadSopenharmony_ci have modifiable attachment points for each logical buffer in the 19475bd8deadSopenharmony_ci framebuffer. Framebuffer-attachable images can be attached to and 19485bd8deadSopenharmony_ci detached from these attachment points, which are described further 19495bd8deadSopenharmony_ci in section 4.4.2. Also, the size and format of the images attached 19505bd8deadSopenharmony_ci to application-created framebuffers are controlled entirely within 19515bd8deadSopenharmony_ci the GL interface, and are not affected by window system events, such 19525bd8deadSopenharmony_ci as pixel format selection, window resizes, and display mode changes. 19535bd8deadSopenharmony_ci 19545bd8deadSopenharmony_ci Additionally, when rendering to or reading from an application 19555bd8deadSopenharmony_ci created-framebuffer object, 19565bd8deadSopenharmony_ci 19575bd8deadSopenharmony_ci - The pixel ownership test always succeeds. In other words, 19585bd8deadSopenharmony_ci framebuffer objects own all of their pixels. 19595bd8deadSopenharmony_ci 19605bd8deadSopenharmony_ci - There are no visible color buffer bitplanes. This means 19615bd8deadSopenharmony_ci there is no color buffer corresponding to the back, front, 19625bd8deadSopenharmony_ci left, or right color bitplanes. 19635bd8deadSopenharmony_ci 19645bd8deadSopenharmony_ci - The only color buffer bitplanes are the ones defined by the 19655bd8deadSopenharmony_ci framebuffer attachment points named COLOR_ATTACHMENT0 19665bd8deadSopenharmony_ci through COLOR_ATTACHMENTn. 19675bd8deadSopenharmony_ci 19685bd8deadSopenharmony_ci - The only depth buffer bitplanes are the ones defined by the 19695bd8deadSopenharmony_ci framebuffer attachment point DEPTH_ATTACHMENT. 19705bd8deadSopenharmony_ci 19715bd8deadSopenharmony_ci - The only stencil buffer bitplanes are the ones defined by 19725bd8deadSopenharmony_ci the framebuffer attachment point STENCIL_ATTACHMENT. 19735bd8deadSopenharmony_ci 19745bd8deadSopenharmony_ci - There are no accum buffer bitplanes, so the value of the 19755bd8deadSopenharmony_ci implementation-dependent state variables ACCUM_RED_BITS, 19765bd8deadSopenharmony_ci ACCUM_GREEN_BITS, ACCUM_BLUE_BITS, and ACCUM_ALPHA_BITS, are 19775bd8deadSopenharmony_ci all zero. 19785bd8deadSopenharmony_ci 19795bd8deadSopenharmony_ci - There are no AUX buffer bitplanes, so the value of the 19805bd8deadSopenharmony_ci implementation-dependent state variable AUX_BUFFERS is zero. 19815bd8deadSopenharmony_ci 19825bd8deadSopenharmony_ci - If the attachment sizes are not all identical, rendering will be 19835bd8deadSopenharmony_ci limited to the largest area that can fit in all of the 19845bd8deadSopenharmony_ci attachments (i.e. an intersection of rectangles having a lower 19855bd8deadSopenharmony_ci left of (0,0) and an upper right of (width,height) for each 19865bd8deadSopenharmony_ci attachment) 19875bd8deadSopenharmony_ci 19885bd8deadSopenharmony_ci - If the attachment sizes are not all identical, the values of 19895bd8deadSopenharmony_ci pixels outside the common intersection area after rendering are 19905bd8deadSopenharmony_ci undefined. 19915bd8deadSopenharmony_ci 19925bd8deadSopenharmony_ci Framebuffer objects are deleted by calling 19935bd8deadSopenharmony_ci 19945bd8deadSopenharmony_ci void DeleteFramebuffers(sizei n, uint *framebuffers); 19955bd8deadSopenharmony_ci 19965bd8deadSopenharmony_ci <framebuffers> contains <n> names of framebuffer objects to be 19975bd8deadSopenharmony_ci deleted. After a framebuffer object is deleted, it has no 19985bd8deadSopenharmony_ci attachments, and its name is again unused. If a framebuffer that 19995bd8deadSopenharmony_ci is currently bound to one or more of the targets 20005bd8deadSopenharmony_ci DRAW_FRAMEBUFFER or READ_FRAMEBUFFER is deleted, it is as 20015bd8deadSopenharmony_ci though BindFramebuffer had been executed with the corresponding 20025bd8deadSopenharmony_ci <target> and <framebuffer> zero. Unused names in 20035bd8deadSopenharmony_ci <framebuffers> are silently ignored, as is the value zero. 20045bd8deadSopenharmony_ci 20055bd8deadSopenharmony_ci The command 20065bd8deadSopenharmony_ci 20075bd8deadSopenharmony_ci void GenFramebuffers(sizei n, uint *ids); 20085bd8deadSopenharmony_ci 20095bd8deadSopenharmony_ci returns <n> previously unused framebuffer object names in <ids>. 20105bd8deadSopenharmony_ci These names are marked as used, for the purposes of 20115bd8deadSopenharmony_ci GenFramebuffers only, but they acquire state and type only when 20125bd8deadSopenharmony_ci they are first bound, just as if they were unused. 20135bd8deadSopenharmony_ci 20145bd8deadSopenharmony_ci The names bound to the draw and read framebuffer bindings can be 20155bd8deadSopenharmony_ci queried by calling GetIntegerv with the symbolic constants 20165bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING and READ_FRAMEBUFFER_BINDING 20175bd8deadSopenharmony_ci respectively. FRAMEBUFFER_BINDING is equivalent to 20185bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING. 20195bd8deadSopenharmony_ci 20205bd8deadSopenharmony_ci 4.4.2 Attaching Images to Framebuffer Objects 20215bd8deadSopenharmony_ci 20225bd8deadSopenharmony_ci Framebuffer-attachable images may be attached to, and detached from, 20235bd8deadSopenharmony_ci framebuffer objects. In contrast, the image 20245bd8deadSopenharmony_ci attachments of the default framebuffer may not be 20255bd8deadSopenharmony_ci changed by the GL. 20265bd8deadSopenharmony_ci 20275bd8deadSopenharmony_ci A single framebuffer-attachable image may be attached to multiple 20285bd8deadSopenharmony_ci framebuffer objects, potentially avoiding some 20295bd8deadSopenharmony_ci data copies, and possibly decreasing memory consumption. 20305bd8deadSopenharmony_ci 20315bd8deadSopenharmony_ci For each logical buffer, a framebuffer object stores a set of 20325bd8deadSopenharmony_ci state which defines the logical buffer's <attachment point>. The 20335bd8deadSopenharmony_ci attachment point state contains enough information to identify the 20345bd8deadSopenharmony_ci single image attached to the attachment point, or to indicate that 20355bd8deadSopenharmony_ci no image is attached. The per-logical buffer attachment point 20365bd8deadSopenharmony_ci state is listed in table 5.nnn 20375bd8deadSopenharmony_ci 20385bd8deadSopenharmony_ci There are two types of framebuffer-attachable images: the image of a 20395bd8deadSopenharmony_ci renderbuffer object, and an image of a texture object. 20405bd8deadSopenharmony_ci 20415bd8deadSopenharmony_ci 4.4.2.1 Renderbuffer Objects 20425bd8deadSopenharmony_ci 20435bd8deadSopenharmony_ci A renderbuffer is a data storage object containing a single image of 20445bd8deadSopenharmony_ci a renderable internal format. GL provides the methods described 20455bd8deadSopenharmony_ci below to allocate and delete a renderbuffer's image, and to attach a 20465bd8deadSopenharmony_ci renderbuffer's image to a framebuffer object. 20475bd8deadSopenharmony_ci 20485bd8deadSopenharmony_ci The name space for renderbuffer objects is the unsigned integers, 20495bd8deadSopenharmony_ci with zero reserved for the GL. A renderbuffer object is created by 20505bd8deadSopenharmony_ci binding a name returned by GenRenderbuffers (see below) 20515bd8deadSopenharmony_ci to RENDERBUFFER. The binding is effected by calling 20525bd8deadSopenharmony_ci 20535bd8deadSopenharmony_ci void BindRenderbuffer( enum target, uint renderbuffer ); 20545bd8deadSopenharmony_ci 20555bd8deadSopenharmony_ci with <target> set to RENDERBUFFER and <renderbuffer> set to the 20565bd8deadSopenharmony_ci unused name. If <renderbuffer> is not zero, then the resulting 20575bd8deadSopenharmony_ci renderbuffer object is a new state vector, initialized with a 20585bd8deadSopenharmony_ci zero-sized memory buffer, and comprising the state values listed in 20595bd8deadSopenharmony_ci Table 8.nnn. Any previous binding to <target> is broken. 20605bd8deadSopenharmony_ci 20615bd8deadSopenharmony_ci BindRenderbuffer may also be used to bind an existing 20625bd8deadSopenharmony_ci renderbuffer object. If the bind is successful, no change is made 20635bd8deadSopenharmony_ci to the state of the newly bound renderbuffer object, and any 20645bd8deadSopenharmony_ci previous binding to <target> is broken. 20655bd8deadSopenharmony_ci 20665bd8deadSopenharmony_ci While a renderbuffer object is bound, GL operations on the target to 20675bd8deadSopenharmony_ci which it is bound affect the bound renderbuffer object, and queries 20685bd8deadSopenharmony_ci of the target to which a renderbuffer object is bound return state 20695bd8deadSopenharmony_ci from the bound object. 20705bd8deadSopenharmony_ci 20715bd8deadSopenharmony_ci The name zero is reserved. A renderbuffer object cannot be created 20725bd8deadSopenharmony_ci with the name zero. If <renderbuffer> is zero, then any previous 20735bd8deadSopenharmony_ci binding to <target> is broken and the <target> binding is restored 20745bd8deadSopenharmony_ci to the initial state. 20755bd8deadSopenharmony_ci 20765bd8deadSopenharmony_ci In the initial state, the reserved name zero is bound to 20775bd8deadSopenharmony_ci RENDERBUFFER. There is no renderbuffer object corresponding to 20785bd8deadSopenharmony_ci the name zero, so client attempts to modify or query renderbuffer 20795bd8deadSopenharmony_ci state for the target RENDERBUFFER while zero is bound will 20805bd8deadSopenharmony_ci generate GL errors, as described in section 6.1.3. 20815bd8deadSopenharmony_ci 20825bd8deadSopenharmony_ci The current RENDERBUFFER binding can be determined by calling 20835bd8deadSopenharmony_ci GetIntegerv with the symbolic constant RENDERBUFFER_BINDING. 20845bd8deadSopenharmony_ci 20855bd8deadSopenharmony_ci BindRenderbuffer fails and an INVALID_OPERATION error is generated 20865bd8deadSopenharmony_ci if <renderbuffer> is not a name returned from a previous call to 20875bd8deadSopenharmony_ci GenRenderbuffers, or if such a name has since been deleted with 20885bd8deadSopenharmony_ci DeleteRenderbuffers. 20895bd8deadSopenharmony_ci 20905bd8deadSopenharmony_ci Renderbuffer objects are deleted by calling 20915bd8deadSopenharmony_ci 20925bd8deadSopenharmony_ci void DeleteRenderbuffers( sizei n, const uint *renderbuffers ); 20935bd8deadSopenharmony_ci 20945bd8deadSopenharmony_ci where <renderbuffers> contains <n> names of renderbuffer objects to be 20955bd8deadSopenharmony_ci deleted. After a renderbuffer object is deleted, it has no 20965bd8deadSopenharmony_ci contents, and its name is again unused. If a renderbuffer that is 20975bd8deadSopenharmony_ci currently bound to RENDERBUFFER is deleted, it is as though 20985bd8deadSopenharmony_ci BindRenderbuffer had been executed with the <target> 20995bd8deadSopenharmony_ci RENDERBUFFER and <name> of zero. Additionally, special care 21005bd8deadSopenharmony_ci must be taken when deleting a renderbuffer if the image of the 21015bd8deadSopenharmony_ci renderbuffer is attached to a framebuffer object (see section 21025bd8deadSopenharmony_ci 4.4.2.2 for details). Unused names in <renderbuffers> are silently 21035bd8deadSopenharmony_ci ignored, as is the value zero. 21045bd8deadSopenharmony_ci 21055bd8deadSopenharmony_ci The command 21065bd8deadSopenharmony_ci 21075bd8deadSopenharmony_ci void GenRenderbuffers( sizei n, uint *renderbuffers ); 21085bd8deadSopenharmony_ci 21095bd8deadSopenharmony_ci returns <n> previously unused renderbuffer object names in 21105bd8deadSopenharmony_ci <renderbuffers>. These names are marked as used, for the purposes 21115bd8deadSopenharmony_ci of GenRenderbuffers only, but they acquire renderbuffer state 21125bd8deadSopenharmony_ci only when they are first bound, just as if they were unused. 21135bd8deadSopenharmony_ci 21145bd8deadSopenharmony_ci The command 21155bd8deadSopenharmony_ci 21165bd8deadSopenharmony_ci void RenderbufferStorageMultisample(enum target, sizei samples, 21175bd8deadSopenharmony_ci enum internalformat, 21185bd8deadSopenharmony_ci sizei width, sizei height); 21195bd8deadSopenharmony_ci 21205bd8deadSopenharmony_ci establishes the data storage, format, dimensions, and number of 21215bd8deadSopenharmony_ci samples of a renderbuffer object's image. <target> must be 21225bd8deadSopenharmony_ci RENDERBUFFER. <internalformat> must be color-renderable, depth- 21235bd8deadSopenharmony_ci renderable, or stencil-renderable (as defined in section 4.4.4). 21245bd8deadSopenharmony_ci <width> and <height> are the dimensions in pixels of the renderbuffer. 21255bd8deadSopenharmony_ci If either <width> or <height> is greater than MAX_RENDERBUFFER_SIZE, 21265bd8deadSopenharmony_ci or if <samples> is greater than MAX_SAMPLES, 21275bd8deadSopenharmony_ci then the error INVALID_VALUE is 21285bd8deadSopenharmony_ci generated. If the GL is unable to create a data store of the 21295bd8deadSopenharmony_ci requested size, the error OUT_OF_MEMORY is generated. 21305bd8deadSopenharmony_ci 21315bd8deadSopenharmony_ci Upon success, RenderbufferStorageMultisample deletes any existing 21325bd8deadSopenharmony_ci data store for the renderbuffer image and the contents of the data 21335bd8deadSopenharmony_ci store after calling RenderbufferStorageMultisample are undefined. 21345bd8deadSopenharmony_ci RENDERBUFFER_WIDTH is set to <width>, RENDERBUFFER_HEIGHT is 21355bd8deadSopenharmony_ci set to <height>, and RENDERBUFFER_INTERNAL_FORMAT is set to 21365bd8deadSopenharmony_ci <internalformat>. 21375bd8deadSopenharmony_ci 21385bd8deadSopenharmony_ci If <samples> is zero, then RENDERBUFFER_SAMPLES is set to zero. 21395bd8deadSopenharmony_ci Otherwise <samples> represents a request for a desired minimum 21405bd8deadSopenharmony_ci number of samples. Since different implementations may support 21415bd8deadSopenharmony_ci different sample counts for multisampled rendering, the actual 21425bd8deadSopenharmony_ci number of samples allocated for the renderbuffer image is 21435bd8deadSopenharmony_ci implementation dependent. However, the resulting value for 21445bd8deadSopenharmony_ci RENDERBUFFER_SAMPLES is guaranteed to be greater than or equal 21455bd8deadSopenharmony_ci to <samples> and no more than the next larger sample count supported 21465bd8deadSopenharmony_ci by the implementation. 21475bd8deadSopenharmony_ci 21485bd8deadSopenharmony_ci Sized Base S 21495bd8deadSopenharmony_ci Internal Format Internal format Bits 21505bd8deadSopenharmony_ci --------------- --------------- ---- 21515bd8deadSopenharmony_ci STENCIL_INDEX1 STENCIL_INDEX 1 21525bd8deadSopenharmony_ci STENCIL_INDEX4 STENCIL_INDEX 4 21535bd8deadSopenharmony_ci STENCIL_INDEX8 STENCIL_INDEX 8 21545bd8deadSopenharmony_ci STENCIL_INDEX16 STENCIL_INDEX 16 21555bd8deadSopenharmony_ci ---------------------------------------------------------------- 21565bd8deadSopenharmony_ci Table 2.nnn Desired component resolution for each sized internal 21575bd8deadSopenharmony_ci format that can be used only with renderbuffers. 21585bd8deadSopenharmony_ci 21595bd8deadSopenharmony_ci A GL implementation may vary its allocation of internal component 21605bd8deadSopenharmony_ci resolution based on any RenderbufferStorage parameter (except 21615bd8deadSopenharmony_ci target), but the allocation and chosen internal format must not be a 21625bd8deadSopenharmony_ci function of any other state and cannot be changed once they are 21635bd8deadSopenharmony_ci established. 21645bd8deadSopenharmony_ci 21655bd8deadSopenharmony_ci The command 21665bd8deadSopenharmony_ci 21675bd8deadSopenharmony_ci void RenderbufferStorage(enum target, enum internalformat, 21685bd8deadSopenharmony_ci sizei width, sizei height); 21695bd8deadSopenharmony_ci 21705bd8deadSopenharmony_ci is equivalent to calling RenderbufferStorageMultisample with 21715bd8deadSopenharmony_ci <samples> equal to zero." 21725bd8deadSopenharmony_ci 21735bd8deadSopenharmony_ci 4.4.2.2 Attaching Renderbuffer Images to a Framebuffer 21745bd8deadSopenharmony_ci 21755bd8deadSopenharmony_ci A renderbuffer can be attached as one of the logical buffers of the 21765bd8deadSopenharmony_ci currently bound framebuffer object by calling 21775bd8deadSopenharmony_ci 21785bd8deadSopenharmony_ci void FramebufferRenderbuffer(enum target, 21795bd8deadSopenharmony_ci enum attachment, 21805bd8deadSopenharmony_ci enum renderbuffertarget, 21815bd8deadSopenharmony_ci uint renderbuffer); 21825bd8deadSopenharmony_ci 21835bd8deadSopenharmony_ci <target> must be DRAW_FRAMEBUFFER, READ_FRAMEBUFFER, or 21845bd8deadSopenharmony_ci FRAMEBUFFER. FRAMEBUFFER is equivalent to 21855bd8deadSopenharmony_ci DRAW_FRAMEBUFFER. 21865bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if the value of the 21875bd8deadSopenharmony_ci corresponding binding is zero. <attachment> should be set to 21885bd8deadSopenharmony_ci one of the attachment points of the framebuffer listed in table 21895bd8deadSopenharmony_ci 1.nnn. <renderbuffertarget> must be RENDERBUFFER and 21905bd8deadSopenharmony_ci <renderbuffer> should be set to the name of the renderbuffer object 21915bd8deadSopenharmony_ci to be attached to the framebuffer. <renderbuffer> must be either 21925bd8deadSopenharmony_ci zero or the name of an existing renderbuffer object of type 21935bd8deadSopenharmony_ci <renderbuffertarget>, otherwise an INVALID_OPERATION error is 21945bd8deadSopenharmony_ci generated. If <renderbuffer> is zero, then the value of 21955bd8deadSopenharmony_ci <renderbuffertarget> is ignored. 21965bd8deadSopenharmony_ci 21975bd8deadSopenharmony_ci If <renderbuffer> is not zero and if FramebufferRenderbuffer is 21985bd8deadSopenharmony_ci successful, then the renderbuffer named <renderbuffer> will be used 21995bd8deadSopenharmony_ci as the logical buffer identified by <attachment> of the framebuffer 22005bd8deadSopenharmony_ci currently bound to <target>. The value of 22015bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for the specified attachment 22025bd8deadSopenharmony_ci point is set to RENDERBUFFER and the value of 22035bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is set to <renderbuffer>. All 22045bd8deadSopenharmony_ci other state values of the attachment point specified by <attachment> 22055bd8deadSopenharmony_ci are set to their default values listed in table 5.nnn. No change is 22065bd8deadSopenharmony_ci made to the state of the renderbuffer object and any previous 22075bd8deadSopenharmony_ci attachment to the <attachment> logical buffer of the framebuffer 22085bd8deadSopenharmony_ci object bound to framebuffer <target> is broken. If 22095bd8deadSopenharmony_ci the attachment is not successful, then no change is made to 22105bd8deadSopenharmony_ci the state of either the renderbuffer object or the framebuffer 22115bd8deadSopenharmony_ci object. 22125bd8deadSopenharmony_ci 22135bd8deadSopenharmony_ci Calling FramebufferRenderbuffer with the <renderbuffer> name zero 22145bd8deadSopenharmony_ci will detach the image, if any, identified by <attachment>, in the 22155bd8deadSopenharmony_ci framebuffer currently bound to <target>. All state values of the 22165bd8deadSopenharmony_ci attachment point specified by <attachment> in the object bound to 22175bd8deadSopenharmony_ci <target> are set to their default values listed in table 5.nnn. 22185bd8deadSopenharmony_ci 22195bd8deadSopenharmony_ci Setting <attachment> to the value DEPTH_STENCIL_ATTACHMENT is a 22205bd8deadSopenharmony_ci special case causing both the depth and stencil attachments of the 22215bd8deadSopenharmony_ci framebuffer object to be set to <renderbuffer>, which should have 22225bd8deadSopenharmony_ci base internal format DEPTH_STENCIL. 22235bd8deadSopenharmony_ci 22245bd8deadSopenharmony_ci If a renderbuffer object is deleted while its image is attached to 22255bd8deadSopenharmony_ci one or more attachment points in the currently bound framebuffer, 22265bd8deadSopenharmony_ci then it is as if FramebufferRenderbuffer had been called, with 22275bd8deadSopenharmony_ci a <renderbuffer> of 0, for each attachment point to which this image 22285bd8deadSopenharmony_ci was attached in the currently bound framebuffer. In other words, 22295bd8deadSopenharmony_ci this renderbuffer image is first detached from all attachment points 22305bd8deadSopenharmony_ci in the currently bound framebuffer. Note that the renderbuffer 22315bd8deadSopenharmony_ci image is specifically *not* detached from any non-bound 22325bd8deadSopenharmony_ci framebuffers. Detaching the image from any non-bound framebuffers 22335bd8deadSopenharmony_ci is the responsibility of the application. 22345bd8deadSopenharmony_ci 22355bd8deadSopenharmony_ci Name of attachment 22365bd8deadSopenharmony_ci ----------------------------------------------------- 22375bd8deadSopenharmony_ci COLOR_ATTACHMENTi (see caption) 22385bd8deadSopenharmony_ci DEPTH_ATTACHMENT 22395bd8deadSopenharmony_ci STENCIL_ATTACHMENT 22405bd8deadSopenharmony_ci DEPTH_STENCIL_ATTACHMENT 22415bd8deadSopenharmony_ci ----------------------------------------------------- 22425bd8deadSopenharmony_ci Table 1.nnn: Framebuffer attachment points. <i> in 22435bd8deadSopenharmony_ci COLOR_ATTACHMENTi may range from zero to the value of 22445bd8deadSopenharmony_ci MAX_COLOR_ATTACHMENTS - 1. 22455bd8deadSopenharmony_ci 22465bd8deadSopenharmony_ci 4.4.2.3 Attaching Texture Images to a Framebuffer 22475bd8deadSopenharmony_ci 22485bd8deadSopenharmony_ci GL supports copying the rendered contents of the framebuffer into 22495bd8deadSopenharmony_ci the images of a texture object through the use of the routines 22505bd8deadSopenharmony_ci CopyTexImage{1D|2D}, and CopyTexSubImage{1D|2D|3D}. Additionally, 22515bd8deadSopenharmony_ci GL supports rendering directly into the images of a texture object. 22525bd8deadSopenharmony_ci 22535bd8deadSopenharmony_ci To render directly into a texture image, a specified image from a 22545bd8deadSopenharmony_ci texture object can be attached as one of the logical buffers of the 22555bd8deadSopenharmony_ci currently bound framebuffer object by calling one of the following 22565bd8deadSopenharmony_ci routines, depending on the type of the texture: 22575bd8deadSopenharmony_ci 22585bd8deadSopenharmony_ci void FramebufferTexture1D(enum target, enum attachment, 22595bd8deadSopenharmony_ci enum textarget, uint texture, 22605bd8deadSopenharmony_ci int level); 22615bd8deadSopenharmony_ci void FramebufferTexture2D(enum target, enum attachment, 22625bd8deadSopenharmony_ci enum textarget, uint texture, 22635bd8deadSopenharmony_ci int level); 22645bd8deadSopenharmony_ci void FramebufferTexture3D(enum target, enum attachment, 22655bd8deadSopenharmony_ci enum textarget, uint texture, 22665bd8deadSopenharmony_ci int level, int layer); 22675bd8deadSopenharmony_ci 22685bd8deadSopenharmony_ci In all three routines, <target> must be DRAW_FRAMEBUFFER, 22695bd8deadSopenharmony_ci READ_FRAMEBUFFER or FRAMEBUFFER. FRAMEBUFFER is 22705bd8deadSopenharmony_ci equivalent to DRAW_FRAMEBUFFER. 22715bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if the 22725bd8deadSopenharmony_ci value of the corresponding binding is zero. 22735bd8deadSopenharmony_ci <attachment> must be one of the attachment points of the 22745bd8deadSopenharmony_ci framebuffer listed in table 1.nnn. 22755bd8deadSopenharmony_ci 22765bd8deadSopenharmony_ci If <texture> is zero, the image identified by <attachment>, if 22775bd8deadSopenharmony_ci any, will be detached from the framebuffer currently bound to 22785bd8deadSopenharmony_ci <target>. <textarget>, <level>, and <layer> are ignored. All 22795bd8deadSopenharmony_ci state values of the attachment point specified by <attachment> are 22805bd8deadSopenharmony_ci set to their default values listed in table 5.nnn. 22815bd8deadSopenharmony_ci 22825bd8deadSopenharmony_ci If <texture> is not zero, then <texture> must either name an existing 22835bd8deadSopenharmony_ci texture object with a target of <textarget>, or <texture> must name an 22845bd8deadSopenharmony_ci existing cube map texture and <textarget> must be one of 22855bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, 22865bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_X, 22875bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_NEGATIVE_Y, or TEXTURE_CUBE_MAP_NEGATIVE_Z. Otherwise, 22885bd8deadSopenharmony_ci an INVALID_OPERATION error is generated. 22895bd8deadSopenharmony_ci 22905bd8deadSopenharmony_ci <level> specifies the mipmap level of the texture image to be 22915bd8deadSopenharmony_ci attached to the framebuffer. 22925bd8deadSopenharmony_ci 22935bd8deadSopenharmony_ci If <textarget> is TEXTURE_RECTANGLE_ARB, then <level> must be zero. 22945bd8deadSopenharmony_ci If <textarget> is TEXTURE_3D, then <level> must be greater than or 22955bd8deadSopenharmony_ci equal to zero and less than or equal to log base 2 of the value of 22965bd8deadSopenharmony_ci MAX_3D_TEXTURE_SIZE. If <textarget> is one of 22975bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, 22985bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_X, 22995bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_NEGATIVE_Y, or TEXTURE_CUBE_MAP_NEGATIVE_Z, then 23005bd8deadSopenharmony_ci <level> must be greater than or equal to zero and less than or equal 23015bd8deadSopenharmony_ci to log base 2 of the value of MAX_CUBE_MAP_TEXTURE_SIZE. For all other 23025bd8deadSopenharmony_ci values of <textarget>, <level> must be greater than or equal to zero and 23035bd8deadSopenharmony_ci no larger than log base 2 of the value of MAX_TEXTURE_SIZE. Otherwise, 23045bd8deadSopenharmony_ci an INVALID_VALUE error is generated. 23055bd8deadSopenharmony_ci 23065bd8deadSopenharmony_ci <layer> specifies the layer of a 2-dimensional image within a 23075bd8deadSopenharmony_ci 3-dimensional texture. An INVALID_VALUE error is generated if 23085bd8deadSopenharmony_ci <layer> is larger than the value of MAX_3D_TEXTURE_SIZE-1. 23095bd8deadSopenharmony_ci 23105bd8deadSopenharmony_ci For FramebufferTexture1D, if <texture> is not zero, then 23115bd8deadSopenharmony_ci <textarget> must be TEXTURE_1D. 23125bd8deadSopenharmony_ci 23135bd8deadSopenharmony_ci For FramebufferTexture2D, if <texture> is not zero, then 23145bd8deadSopenharmony_ci <textarget> must be one of TEXTURE_2D, TEXTURE_RECTANGLE_ARB, 23155bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, 23165bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_X, 23175bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_NEGATIVE_Y, or TEXTURE_CUBE_MAP_NEGATIVE_Z. 23185bd8deadSopenharmony_ci 23195bd8deadSopenharmony_ci For FramebufferTexture3D, if <texture> is not zero, then 23205bd8deadSopenharmony_ci <textarget> must be TEXTURE_3D. 23215bd8deadSopenharmony_ci 23225bd8deadSopenharmony_ci If <texture> is not zero, and if FramebufferTexture{1D|2D|3D} is 23235bd8deadSopenharmony_ci successful, then the specified texture image will be used as the 23245bd8deadSopenharmony_ci logical buffer identified by <attachment> of the framebuffer 23255bd8deadSopenharmony_ci currently bound to <target>. The value of 23265bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for the specified attachment 23275bd8deadSopenharmony_ci point is set to TEXTURE and the value of 23285bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is set to <texture>. 23295bd8deadSopenharmony_ci Additionally, the value of FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL for 23305bd8deadSopenharmony_ci the named attachment point is set to <level>. If <texture> is a 23315bd8deadSopenharmony_ci cube map texture, then the value of 23325bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE the named attachment 23335bd8deadSopenharmony_ci point is set to <textarget>. If <texture> is a 3D texture, then the 23345bd8deadSopenharmony_ci value of FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER for the named 23355bd8deadSopenharmony_ci attachment point is set to <layer>. All other state values of the 23365bd8deadSopenharmony_ci attachment point specified by <attachment> are set to their default 23375bd8deadSopenharmony_ci values listed in table 5.nnn. No change is made to the state of the 23385bd8deadSopenharmony_ci texture object, and any previous attachment to the <attachment> 23395bd8deadSopenharmony_ci logical buffer of the framebuffer object bound to framebuffer 23405bd8deadSopenharmony_ci <target> is broken. If the attachment is not 23415bd8deadSopenharmony_ci successful, then no change is made to the state of either the 23425bd8deadSopenharmony_ci texture object or the framebuffer object. 23435bd8deadSopenharmony_ci 23445bd8deadSopenharmony_ci Setting <attachment> to the value DEPTH_STENCIL_ATTACHMENT is a 23455bd8deadSopenharmony_ci special case causing both the depth and stencil attachments of the 23465bd8deadSopenharmony_ci framebuffer object to be set to <texture>. <texture> must have base 23475bd8deadSopenharmony_ci internal format DEPTH_STENCIL, or the depth and stencil 23485bd8deadSopenharmony_ci framebuffer attachments will be incomplete (see section 4.4.4.1). 23495bd8deadSopenharmony_ci 23505bd8deadSopenharmony_ci The command 23515bd8deadSopenharmony_ci 23525bd8deadSopenharmony_ci void FramebufferTextureLayer(enum target,enum attachment, 23535bd8deadSopenharmony_ci uint texture,int level,int layer); 23545bd8deadSopenharmony_ci 23555bd8deadSopenharmony_ci operates identically to FramebufferTexture3D, except that it 23565bd8deadSopenharmony_ci attaches a single layer of a three-dimensional texture, or one- or 23575bd8deadSopenharmony_ci two-dimensional array texture. <layer> is an integer indicating the 23585bd8deadSopenharmony_ci layer number, and is treated identically to the <layer> parameter in 23595bd8deadSopenharmony_ci FramebufferTexture3D. The error INVALID_VALUE is generated if 23605bd8deadSopenharmony_ci <layer> is negative. The error INVALID_OPERATION is generated if 23615bd8deadSopenharmony_ci <texture> is non-zero and is not the name of a three dimensional 23625bd8deadSopenharmony_ci texture, or one- or two-dimensional array texture. 23635bd8deadSopenharmony_ci 23645bd8deadSopenharmony_ci Unlike FramebufferTexture3D, no <textarget> parameter is accepted. 23655bd8deadSopenharmony_ci 23665bd8deadSopenharmony_ci If <texture> is non-zero and the command does not result in an 23675bd8deadSopenharmony_ci error, the framebuffer attachment state corresponding to 23685bd8deadSopenharmony_ci <attachment> is updated as in the other FramebufferTexture commands, 23695bd8deadSopenharmony_ci except that FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is set to 23705bd8deadSopenharmony_ci <layer>. 23715bd8deadSopenharmony_ci 23725bd8deadSopenharmony_ci If a texture object is deleted while its image is attached to one or 23735bd8deadSopenharmony_ci more attachment points in the currently bound framebuffer, then it 23745bd8deadSopenharmony_ci is as if FramebufferTexture* had been called, with a <texture> of 23755bd8deadSopenharmony_ci zero, for each attachment point to which this image was attached in 23765bd8deadSopenharmony_ci the currently bound framebuffer. In other words, this texture image 23775bd8deadSopenharmony_ci is first detached from all attachment points in the currently bound 23785bd8deadSopenharmony_ci framebuffer. Note that the texture image is specifically *not* 23795bd8deadSopenharmony_ci detached from any other framebuffer objects. Detaching the texture 23805bd8deadSopenharmony_ci image from any other framebuffer objects is the responsibility of 23815bd8deadSopenharmony_ci the application. 23825bd8deadSopenharmony_ci 23835bd8deadSopenharmony_ci 4.4.3 Rendering When an Image of a Bound Texture Object is Also 23845bd8deadSopenharmony_ci Attached to the Framebuffer 23855bd8deadSopenharmony_ci 23865bd8deadSopenharmony_ci The mechanisms for attaching textures to a framebuffer object do not 23875bd8deadSopenharmony_ci prevent a one- or two-dimensional texture level, a face of a cube 23885bd8deadSopenharmony_ci map texture level, or a layer of a two-dimensional array or 23895bd8deadSopenharmony_ci three-dimensional texture from being attached to the draw 23905bd8deadSopenharmony_ci framebuffer while the same texture is bound to a texture unit. While 23915bd8deadSopenharmony_ci any of these conditions hold, texturing operations accessing that 23925bd8deadSopenharmony_ci image will produce undefined results, as described at the end of 23935bd8deadSopenharmony_ci section 3.8.8. Conditions resulting in such undefined behavior are 23945bd8deadSopenharmony_ci defined in more detail below. Such undefined texturing operations 23955bd8deadSopenharmony_ci are likely to leave the final results of the shader or 23965bd8deadSopenharmony_ci fixed-function fragment processing operations undefined, and should 23975bd8deadSopenharmony_ci be avoided. 23985bd8deadSopenharmony_ci 23995bd8deadSopenharmony_ci Special precautions need to be taken to avoid attaching a texture 24005bd8deadSopenharmony_ci image to the currently bound framebuffer while the texture object is 24015bd8deadSopenharmony_ci currently bound and enabled for texturing. Doing so could lead to 24025bd8deadSopenharmony_ci the creation of a <feedback loop> between the writing of pixels by 24035bd8deadSopenharmony_ci the GL's rendering operations and the simultaneous reading of those 24045bd8deadSopenharmony_ci same pixels when used as texels in the currently bound texture. In 24055bd8deadSopenharmony_ci this scenario, the framebuffer will be considered framebuffer 24065bd8deadSopenharmony_ci complete (see section 4.4.4), but the values of fragments rendered 24075bd8deadSopenharmony_ci while in this state will be undefined. The values of texture 24085bd8deadSopenharmony_ci samples may be undefined as well, as described at the end of the 24095bd8deadSopenharmony_ci "Scale Factor and Level of Detail" subsection of section 3.8.8. 24105bd8deadSopenharmony_ci 24115bd8deadSopenharmony_ci Specifically, the values of rendered fragments are undefined if all 24125bd8deadSopenharmony_ci of the following conditions are true: 24135bd8deadSopenharmony_ci 24145bd8deadSopenharmony_ci - an image from texture object <T> is attached to the currently 24155bd8deadSopenharmony_ci bound framebuffer at attachment point <A>, and 24165bd8deadSopenharmony_ci 24175bd8deadSopenharmony_ci - the texture object <T> is currently bound to a texture unit 24185bd8deadSopenharmony_ci <U>, and 24195bd8deadSopenharmony_ci 24205bd8deadSopenharmony_ci - the current fixed-function texture state or programmable 24215bd8deadSopenharmony_ci vertex and/or fragment processing state makes it possible(*) 24225bd8deadSopenharmony_ci to sample from the texture object <T> bound to texture unit 24235bd8deadSopenharmony_ci <U> 24245bd8deadSopenharmony_ci 24255bd8deadSopenharmony_ci while either of the following conditions are true: 24265bd8deadSopenharmony_ci 24275bd8deadSopenharmony_ci - the value of TEXTURE MIN FILTER for texture object <T> is 24285bd8deadSopenharmony_ci NEAREST or LINEAR, and the value of 24295bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL for attachment point 24305bd8deadSopenharmony_ci <A> is equal to the value of TEXTURE_BASE_LEVEL for the 24315bd8deadSopenharmony_ci texture object <T>, or 24325bd8deadSopenharmony_ci 24335bd8deadSopenharmony_ci - the value of TEXTURE_MIN_FILTER for texture object <T> is one 24345bd8deadSopenharmony_ci of NEAREST_MIPMAP_NEAREST, NEAREST_MIPMAP LINEAR, LINEAR 24355bd8deadSopenharmony_ci MIPMAP_NEAREST, or LINEAR_MIPMAP_LINEAR, and the value of 24365bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL for attachment point 24375bd8deadSopenharmony_ci <A> is within the range specified by the current values of 24385bd8deadSopenharmony_ci TEXTURE_BASE_LEVEL to q, inclusive, for the texture object 24395bd8deadSopenharmony_ci <T>. (q is defined in the Mipmapping discussion of section 24405bd8deadSopenharmony_ci 3.8.8), 24415bd8deadSopenharmony_ci 24425bd8deadSopenharmony_ci (*) For the purpose of this discussion, it is <possible> 24435bd8deadSopenharmony_ci to sample from the texture object <T> bound to texture unit <U> 24445bd8deadSopenharmony_ci if any of the following are true: 24455bd8deadSopenharmony_ci 24465bd8deadSopenharmony_ci - Programmable vertex and fragment processing is disabled 24475bd8deadSopenharmony_ci and the target of texture object <T> is enabled according 24485bd8deadSopenharmony_ci to the texture target precedence rules of section 3.8.15 24495bd8deadSopenharmony_ci - FRAGMENT_PROGRAM_ARB is enabled and the currently bound 24505bd8deadSopenharmony_ci fragment program contains any instructions that 24515bd8deadSopenharmony_ci sample from the texture object <T> bound to <U> 24525bd8deadSopenharmony_ci - The active fragment or vertex shader contains any instructions 24535bd8deadSopenharmony_ci that might sample from the texture object <T> bound to <U> if even 24545bd8deadSopenharmony_ci those instructions might only be executed conditionally. 24555bd8deadSopenharmony_ci 24565bd8deadSopenharmony_ci Note that if TEXTURE_BASE_LEVEL and TEXTURE_MAX_LEVEL exclude any 24575bd8deadSopenharmony_ci levels containing image(s) attached to the currently bound 24585bd8deadSopenharmony_ci framebuffer, then the above conditions will not be met, (i.e., the 24595bd8deadSopenharmony_ci above rule will not cause the values of rendered fragments to be 24605bd8deadSopenharmony_ci undefined.) 24615bd8deadSopenharmony_ci 24625bd8deadSopenharmony_ci 4.4.4 Framebuffer Completeness 24635bd8deadSopenharmony_ci 24645bd8deadSopenharmony_ci A framebuffer must be <framebuffer complete> to effectively be used 24655bd8deadSopenharmony_ci as the draw or read framebuffer of the GL. 24665bd8deadSopenharmony_ci 24675bd8deadSopenharmony_ci The default framebuffer is always complete if it exists; however, if no 24685bd8deadSopenharmony_ci default framebuffer exists (no window system-provided drawable is 24695bd8deadSopenharmony_ci associated with the GL context), it is deemed to be incomplete. 24705bd8deadSopenharmony_ci 24715bd8deadSopenharmony_ci A framebuffer object is said to be framebuffer complete if all of 24725bd8deadSopenharmony_ci its attached images, and all framebuffer parameters required to 24735bd8deadSopenharmony_ci utilize the framebuffer for rendering and reading, are consistently 24745bd8deadSopenharmony_ci defined and meet the requirements defined below. The rules of 24755bd8deadSopenharmony_ci framebuffer completeness are dependent on the properties of the 24765bd8deadSopenharmony_ci attached images, and on certain implementation dependent 24775bd8deadSopenharmony_ci restrictions. 24785bd8deadSopenharmony_ci 24795bd8deadSopenharmony_ci The internal formats of the attached images can affect the 24805bd8deadSopenharmony_ci completeness of the framebuffer, so it is useful to first define the 24815bd8deadSopenharmony_ci relationship between the internal format of an image and the 24825bd8deadSopenharmony_ci attachment points to which it can be attached. 24835bd8deadSopenharmony_ci 24845bd8deadSopenharmony_ci * The following base internal formats from table 3.15 are 24855bd8deadSopenharmony_ci <color-renderable>: ALPHA, LUMINANCE, LUMINANCE_ALPHA, 24865bd8deadSopenharmony_ci INTENSITY, RED, RG, RGB, RGBA, FLOAT_R_NV, FLOAT_RG_NV, 24875bd8deadSopenharmony_ci FLOAT_RGB_NV, and FLOAT_RGBA_NV. The sized 24885bd8deadSopenharmony_ci internal formats from table 3.16 that have a color-renderable 24895bd8deadSopenharmony_ci base internal format are also color-renderable. No other 24905bd8deadSopenharmony_ci formats, including compressed internal formats, are 24915bd8deadSopenharmony_ci color-renderable. 24925bd8deadSopenharmony_ci 24935bd8deadSopenharmony_ci * An internal format is <depth-renderable> if it is 24945bd8deadSopenharmony_ci DEPTH_COMPONENT or one of the formats from table 3.16 whose 24955bd8deadSopenharmony_ci base internal format is DEPTH_COMPONENT or DEPTH_STENCIL. 24965bd8deadSopenharmony_ci No other formats are depth-renderable. 24975bd8deadSopenharmony_ci 24985bd8deadSopenharmony_ci * An internal format is <stencil-renderable> if it is 24995bd8deadSopenharmony_ci STENCIL_INDEX or DEPTH_STENCIL, if it is one of the 25005bd8deadSopenharmony_ci STENCIL_INDEX formats from table 2.nnn, or if it is one of the 25015bd8deadSopenharmony_ci formats from table 3.16 whose base internal format is 25025bd8deadSopenharmony_ci DEPTH_STENCIL. No other formats are stencil-renderable." 25035bd8deadSopenharmony_ci 25045bd8deadSopenharmony_ci 4.4.4.1 Framebuffer Attachment Completeness 25055bd8deadSopenharmony_ci 25065bd8deadSopenharmony_ci If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for the 25075bd8deadSopenharmony_ci framebuffer attachment point <attachment> is not NONE, then it is 25085bd8deadSopenharmony_ci said that a framebuffer-attachable image, named <image>, is attached 25095bd8deadSopenharmony_ci to the framebuffer at the attachment point. <image> is identified 25105bd8deadSopenharmony_ci by the state in <attachment> as described in section 4.4.2. 25115bd8deadSopenharmony_ci 25125bd8deadSopenharmony_ci The framebuffer attachment point <attachment> is said to be 25135bd8deadSopenharmony_ci <framebuffer attachment complete> if the value of 25145bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for <attachment> is NONE 25155bd8deadSopenharmony_ci (i.e., no image is attached), or if all of the following conditions 25165bd8deadSopenharmony_ci are true: 25175bd8deadSopenharmony_ci 25185bd8deadSopenharmony_ci * <image> is a component of an existing object with the name 25195bd8deadSopenharmony_ci specified by FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, and of the 25205bd8deadSopenharmony_ci type specified by FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE. 25215bd8deadSopenharmony_ci 25225bd8deadSopenharmony_ci * The width and height of <image> must be non-zero. 25235bd8deadSopenharmony_ci 25245bd8deadSopenharmony_ci * If FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is TEXTURE and 25255bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_NAME names a 3-dimensional 25265bd8deadSopenharmony_ci texture, then FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER must be 25275bd8deadSopenharmony_ci smaller than the depth of the texture. 25285bd8deadSopenharmony_ci 25295bd8deadSopenharmony_ci * If <attachment> is COLOR_ATTACHMENTi, then <image> must have 25305bd8deadSopenharmony_ci a color-renderable internal format. 25315bd8deadSopenharmony_ci 25325bd8deadSopenharmony_ci * If <attachment> is DEPTH_ATTACHMENT, then <image> must have 25335bd8deadSopenharmony_ci a depth-renderable internal format. 25345bd8deadSopenharmony_ci 25355bd8deadSopenharmony_ci * If <attachment> is STENCIL_ATTACHMENT, then <image> must 25365bd8deadSopenharmony_ci have a stencil-renderable internal format. 25375bd8deadSopenharmony_ci 25385bd8deadSopenharmony_ci 4.4.4.2 Whole Framebuffer Completeness 25395bd8deadSopenharmony_ci 25405bd8deadSopenharmony_ci Each rule below is followed by an error enum enclosed in { brackets }. 25415bd8deadSopenharmony_ci The meaning of these errors is explained below and under ``Effects of 25425bd8deadSopenharmony_ci Framebuffer Completeness on Framebuffer Operations'' later in section 25435bd8deadSopenharmony_ci 4.4.4. 25445bd8deadSopenharmony_ci 25455bd8deadSopenharmony_ci The framebuffer object <target> is said to be "framebuffer complete" if 25465bd8deadSopenharmony_ci all the following conditions are true: 25475bd8deadSopenharmony_ci 25485bd8deadSopenharmony_ci * <target> is the default framebuffer, and the default framebuffer 25495bd8deadSopenharmony_ci exists. 25505bd8deadSopenharmony_ci { FRAMEBUFFER_UNDEFINED } 25515bd8deadSopenharmony_ci 25525bd8deadSopenharmony_ci * All framebuffer attachment points are framebuffer attachment 25535bd8deadSopenharmony_ci complete. 25545bd8deadSopenharmony_ci { FRAMEBUFFER_INCOMPLETE_ATTACHMENT } 25555bd8deadSopenharmony_ci 25565bd8deadSopenharmony_ci * There is at least one image attached to the framebuffer. 25575bd8deadSopenharmony_ci { FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT } 25585bd8deadSopenharmony_ci 25595bd8deadSopenharmony_ci * The value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE must not be 25605bd8deadSopenharmony_ci NONE for any color attachment point(s) named by DRAW_BUFFERi. 25615bd8deadSopenharmony_ci { FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER } 25625bd8deadSopenharmony_ci 25635bd8deadSopenharmony_ci * If READ_BUFFER is not NONE, then the value of 25645bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE must not be NONE for the 25655bd8deadSopenharmony_ci color attachment point named by READ_BUFFER. 25665bd8deadSopenharmony_ci { FRAMEBUFFER_INCOMPLETE_READ_BUFFER } 25675bd8deadSopenharmony_ci 25685bd8deadSopenharmony_ci * The combination of internal formats of the attached 25695bd8deadSopenharmony_ci images does not violate an implementation-dependent set of 25705bd8deadSopenharmony_ci restrictions. 25715bd8deadSopenharmony_ci { FRAMEBUFFER_UNSUPPORTED } 25725bd8deadSopenharmony_ci 25735bd8deadSopenharmony_ci * The value of RENDERBUFFER_SAMPLES is the same for all attached 25745bd8deadSopenharmony_ci images. 25755bd8deadSopenharmony_ci { FRAMEBUFFER_INCOMPLETE_MULTISAMPLE } 25765bd8deadSopenharmony_ci 25775bd8deadSopenharmony_ci 25785bd8deadSopenharmony_ci The token in { brackets } after each clause of the framebuffer 25795bd8deadSopenharmony_ci completeness rules specifies the return value of 25805bd8deadSopenharmony_ci CheckFramebufferStatus (see below) that is generated when that 25815bd8deadSopenharmony_ci clause is violated. If more than one clause is violated, it is 25825bd8deadSopenharmony_ci implementation-dependent exactly which value will be returned by 25835bd8deadSopenharmony_ci CheckFramebufferStatus. 25845bd8deadSopenharmony_ci 25855bd8deadSopenharmony_ci Performing any of the following actions may change whether the 25865bd8deadSopenharmony_ci framebuffer is considered complete or incomplete. 25875bd8deadSopenharmony_ci 25885bd8deadSopenharmony_ci - Binding to a different framebuffer with BindFramebuffer. 25895bd8deadSopenharmony_ci 25905bd8deadSopenharmony_ci - Attaching an image to the framebuffer with 25915bd8deadSopenharmony_ci FramebufferTexture{1D|2D|3D} or FramebufferRenderbuffer. 25925bd8deadSopenharmony_ci 25935bd8deadSopenharmony_ci - Detaching an image from the framebuffer with 25945bd8deadSopenharmony_ci FramebufferTexture{1D|2D|3D} or FramebufferRenderbuffer. 25955bd8deadSopenharmony_ci 25965bd8deadSopenharmony_ci - Changing the internal format of a texture image that is attached 25975bd8deadSopenharmony_ci to the framebuffer by calling {Copy|Compressed}TexImage{1D|2D|3D}. 25985bd8deadSopenharmony_ci 25995bd8deadSopenharmony_ci - Changing the internal format of a renderbuffer that is attached 26005bd8deadSopenharmony_ci to the framebuffer by calling RenderbufferStorage. 26015bd8deadSopenharmony_ci 26025bd8deadSopenharmony_ci - Deleting, with DeleteTextures or DeleteRenderbuffers, an object 26035bd8deadSopenharmony_ci containing an image that is attached to a framebuffer object 26045bd8deadSopenharmony_ci that is bound to the framebuffer. 26055bd8deadSopenharmony_ci 26065bd8deadSopenharmony_ci - Changing READ_BUFFER or one of the DRAW_BUFFERS. 26075bd8deadSopenharmony_ci 26085bd8deadSopenharmony_ci - Associating a different window system-provided drawable, or no 26095bd8deadSopenharmony_ci drawable, with the default framebuffer using a window system binding 26105bd8deadSopenharmony_ci API such as GLX, WGL, CGL, or EGL. 26115bd8deadSopenharmony_ci 26125bd8deadSopenharmony_ci Although GL defines a wide variety of internal formats for 26135bd8deadSopenharmony_ci framebuffer-attachable images, such as texture images and 26145bd8deadSopenharmony_ci renderbuffer images, some implementations may not support rendering 26155bd8deadSopenharmony_ci to particular combinations of internal formats. If the combination 26165bd8deadSopenharmony_ci of formats of the images attached to a framebuffer object are not 26175bd8deadSopenharmony_ci supported by the implementation, then the framebuffer is not 26185bd8deadSopenharmony_ci complete under the clause labeled FRAMEBUFFER_UNSUPPORTED. There 26195bd8deadSopenharmony_ci must exist, however, at least one combination of internal formats 26205bd8deadSopenharmony_ci for which the framebuffer cannot be FRAMEBUFFER_UNSUPPORTED. 26215bd8deadSopenharmony_ci 26225bd8deadSopenharmony_ci Because of the <implementation-dependent> clause of the framebuffer 26235bd8deadSopenharmony_ci completeness test in particular, and because framebuffer 26245bd8deadSopenharmony_ci completeness can change when the set of attached images is modified, 26255bd8deadSopenharmony_ci it is strongly advised, though is not required, that an application 26265bd8deadSopenharmony_ci check to see if the framebuffer is complete prior to rendering. The 26275bd8deadSopenharmony_ci status of the framebuffer object currently bound to <target> can be 26285bd8deadSopenharmony_ci queried by calling 26295bd8deadSopenharmony_ci 26305bd8deadSopenharmony_ci enum CheckFramebufferStatus(enum target); 26315bd8deadSopenharmony_ci 26325bd8deadSopenharmony_ci <target> must be DRAW_FRAMEBUFFER, READ_FRAMEBUFFER or 26335bd8deadSopenharmony_ci FRAMEBUFFER. FRAMEBUFFER is equivalent to DRAW_FRAMEBUFFER. 26345bd8deadSopenharmony_ci If CheckFramebufferStatus is called within a Begin/End pair, 26355bd8deadSopenharmony_ci an INVALID_OPERATION error is generated. If 26365bd8deadSopenharmony_ci CheckFramebufferStatus generates an error, 0 is returned. 26375bd8deadSopenharmony_ci 26385bd8deadSopenharmony_ci Otherwise, an enum is returned that identifies whether 26395bd8deadSopenharmony_ci or not the framebuffer bound to <target> is complete, and if not 26405bd8deadSopenharmony_ci complete the enum identifies one of the rules of framebuffer 26415bd8deadSopenharmony_ci completeness that is violated. If the framebuffer is complete, then 26425bd8deadSopenharmony_ci FRAMEBUFFER_COMPLETE is returned. 26435bd8deadSopenharmony_ci 26445bd8deadSopenharmony_ci The values of SAMPLE_BUFFERS and SAMPLES are derived from the 26455bd8deadSopenharmony_ci attachments of the currently bound framebuffer object. If the 26465bd8deadSopenharmony_ci current DRAW_FRAMEBUFFER_BINDING is not framebuffer complete, 26475bd8deadSopenharmony_ci then both SAMPLE_BUFFERS and SAMPLES are undefined. Otherwise, 26485bd8deadSopenharmony_ci SAMPLES is equal to the value of RENDERBUFFER_SAMPLES for the 26495bd8deadSopenharmony_ci attached images (which all must have the same value for 26505bd8deadSopenharmony_ci RENDERBUFFER_SAMPLES). Further, SAMPLE_BUFFERS is one if 26515bd8deadSopenharmony_ci SAMPLES is non-zero. Otherwise, SAMPLE_BUFFERS is zero. 26525bd8deadSopenharmony_ci 26535bd8deadSopenharmony_ci 4.4.4.3 Effects of Framebuffer Completeness on Framebuffer Operations 26545bd8deadSopenharmony_ci 26555bd8deadSopenharmony_ci Attempting to render to or read from a framebuffer which is not 26565bd8deadSopenharmony_ci framebuffer complete will generate an INVALID_FRAMEBUFFER_OPERATION 26575bd8deadSopenharmony_ci error. This means that rendering commands such as Begin, 26585bd8deadSopenharmony_ci RasterPos, any command that performs an implicit Begin, as well as 26595bd8deadSopenharmony_ci commands that read the framebuffer such as ReadPixels and 26605bd8deadSopenharmony_ci CopyTex{Sub}Image will generate the error 26615bd8deadSopenharmony_ci INVALID_FRAMEBUFFER_OPERATION if called while the framebuffer is 26625bd8deadSopenharmony_ci not framebuffer complete. 26635bd8deadSopenharmony_ci 26645bd8deadSopenharmony_ci 4.4.5 Effects of Framebuffer State on Framebuffer Dependent Values 26655bd8deadSopenharmony_ci 26665bd8deadSopenharmony_ci The values of the state variables listed in table 9.nnn (Framebuffer 26675bd8deadSopenharmony_ci Dependent Values) may change when a change is made to 26685bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING, to the state of the currently bound 26695bd8deadSopenharmony_ci framebuffer object, or to an image attached to the currently bound 26705bd8deadSopenharmony_ci framebuffer object. 26715bd8deadSopenharmony_ci 26725bd8deadSopenharmony_ci When DRAW_FRAMEBUFFER_BINDING is zero, the values of the state 26735bd8deadSopenharmony_ci variables listed in table 9.nnn are implementation defined. 26745bd8deadSopenharmony_ci 26755bd8deadSopenharmony_ci When DRAW_FRAMEBUFFER_BINDING is non-zero, if the currently bound 26765bd8deadSopenharmony_ci framebuffer object is not framebuffer complete, then the values of 26775bd8deadSopenharmony_ci the state variables listed in table 9.nnn are undefined. 26785bd8deadSopenharmony_ci 26795bd8deadSopenharmony_ci When DRAW_FRAMEBUFFER_BINDING is non-zero and the currently bound 26805bd8deadSopenharmony_ci framebuffer object is framebuffer complete, then the values of the 26815bd8deadSopenharmony_ci state variables listed in table 9.nnn are completely determined by 26825bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING, the state of the currently bound 26835bd8deadSopenharmony_ci framebuffer object, and the state of the images attached to the 26845bd8deadSopenharmony_ci currently bound framebuffer object. 26855bd8deadSopenharmony_ci The values of RED_BITS, GREEN_BITS, BLUE_BITS, and ALPHA_BITS are 26865bd8deadSopenharmony_ci defined only if all color attachments of the draw framebuffer have 26875bd8deadSopenharmony_ci identical formats, in which case the color component depths of color 26885bd8deadSopenharmony_ci attachment zero are returned. The values returned for DEPTH_BITS and 26895bd8deadSopenharmony_ci STENCIL_BITS are the depth or stencil component depth of the 26905bd8deadSopenharmony_ci corresponding attachment of the draw framebuffer, respectively. The 26915bd8deadSopenharmony_ci actual sizes of the color, depth, or stencil bit planes can be 26925bd8deadSopenharmony_ci obtained by querying an attachment point using 26935bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv, 26945bd8deadSopenharmony_ci or querying the object attached at that point. If the value of 26955bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE at a particular attachment 26965bd8deadSopenharmony_ci point is RENDERBUFFER, the sizes may be determined by calling 26975bd8deadSopenharmony_ci GetRenderbufferParameteriv as described in section 6.1.3. If 26985bd8deadSopenharmony_ci the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE at a particular 26995bd8deadSopenharmony_ci attachment point is TEXTURE, the sizes may be determined by calling 27005bd8deadSopenharmony_ci GetTexParameter, as described in section 6.1.3. 27015bd8deadSopenharmony_ci 27025bd8deadSopenharmony_ci 27035bd8deadSopenharmony_ci 4.4.6 Mapping between Pixel and Element in Attached Image 27045bd8deadSopenharmony_ci 27055bd8deadSopenharmony_ci When DRAW_FRAMEBUFFER_BINDING is non-zero, an operation that writes 27065bd8deadSopenharmony_ci to the framebuffer modifies the image attached to the selected 27075bd8deadSopenharmony_ci logical buffer, and an operation that reads from the framebuffer 27085bd8deadSopenharmony_ci reads from the image attached to the selected logical buffer. 27095bd8deadSopenharmony_ci 27105bd8deadSopenharmony_ci If the attached image is a renderbuffer image, then the window 27115bd8deadSopenharmony_ci coordinates (x[w], y[w]) corresponds to the value in the 27125bd8deadSopenharmony_ci renderbuffer image at the same coordinates. 27135bd8deadSopenharmony_ci 27145bd8deadSopenharmony_ci If the attached image is a texture image, then the window 27155bd8deadSopenharmony_ci coordinates (x[w], y[w]) correspond to the texel (i, j, k), from 27165bd8deadSopenharmony_ci figure 3.10 as follows: 27175bd8deadSopenharmony_ci 27185bd8deadSopenharmony_ci i = (x[w] - b) 27195bd8deadSopenharmony_ci 27205bd8deadSopenharmony_ci j = (y[w] - b) 27215bd8deadSopenharmony_ci 27225bd8deadSopenharmony_ci k = (layer - b) 27235bd8deadSopenharmony_ci 27245bd8deadSopenharmony_ci where <b> is the texture image's border width, and <layer> is the 27255bd8deadSopenharmony_ci value of FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER for the selected 27265bd8deadSopenharmony_ci logical buffer. For a two-dimensional texture, <k> and <layer> are 27275bd8deadSopenharmony_ci irrelevant; for a one-dimensional texture, <j>, <k>, and <layer> are 27285bd8deadSopenharmony_ci both irrelevant. 27295bd8deadSopenharmony_ci 27305bd8deadSopenharmony_ci (x[w], y[w]) corresponds to a border texel if x[w], y[w], or 27315bd8deadSopenharmony_ci <layer> is less than the border width, or if x[w], y[w], or <layer> 27325bd8deadSopenharmony_ci is greater than or equal to the border width plus the width or height or 27335bd8deadSopenharmony_ci depth, respectively, of the texture image. 27345bd8deadSopenharmony_ci 27355bd8deadSopenharmony_ci Conversion to Framebuffer-Attachable Image Components 27365bd8deadSopenharmony_ci 27375bd8deadSopenharmony_ci When an enabled color value is written to the framebuffer while the 27385bd8deadSopenharmony_ci draw framebuffer binding is non-zero, for each draw buffer the R, G, B, 27395bd8deadSopenharmony_ci and A values are converted to internal components as described in 27405bd8deadSopenharmony_ci table 3.15, according to the table row corresponding to the internal 27415bd8deadSopenharmony_ci format of the framebuffer-attachable image attached to the selected 27425bd8deadSopenharmony_ci logical buffer, and the resulting internal components are written to 27435bd8deadSopenharmony_ci the image attached to logical buffer. The masking operations 27445bd8deadSopenharmony_ci described in section 4.2.2 are also effective. 27455bd8deadSopenharmony_ci 27465bd8deadSopenharmony_ci Conversion to RGBA Values 27475bd8deadSopenharmony_ci 27485bd8deadSopenharmony_ci When a color value is read or is used as the source of a logical 27495bd8deadSopenharmony_ci operation or blending while the read framebuffer binding is non-zero, 27505bd8deadSopenharmony_ci the components of the framebuffer-attachable image that is attached to 27515bd8deadSopenharmony_ci the logical buffer selected by READ_BUFFER are first converted to R, G, 27525bd8deadSopenharmony_ci B, and A values according to table 3.21 and the internal format of the 27535bd8deadSopenharmony_ci attached image." 27545bd8deadSopenharmony_ci 27555bd8deadSopenharmony_ci 27565bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 2.1 Specification (Special Functions) 27575bd8deadSopenharmony_ci 27585bd8deadSopenharmony_ci Added to section 5.4, as part of the discussion of which commands 27595bd8deadSopenharmony_ci are not compiled into display lists: 27605bd8deadSopenharmony_ci 27615bd8deadSopenharmony_ci "Certain commands, when called while compiling a display list, are 27625bd8deadSopenharmony_ci not compiled into the display list but are executed immediately. 27635bd8deadSopenharmony_ci These are: ..., GenFramebuffers, BindFramebuffer, 27645bd8deadSopenharmony_ci DeleteFramebuffers, CheckFramebufferStatus, 27655bd8deadSopenharmony_ci GenRenderbuffers, BindRenderbuffer, DeleteRenderbuffers, 27665bd8deadSopenharmony_ci RenderbufferStorage, RenderbufferStorageMultisample, 27675bd8deadSopenharmony_ci FramebufferTexture1D, FramebufferTexture2D, 27685bd8deadSopenharmony_ci FramebufferTexture3D, FramebufferRenderbuffer, BlitFramebuffer, 27695bd8deadSopenharmony_ci GenerateMipmap..." 27705bd8deadSopenharmony_ci 27715bd8deadSopenharmony_ci 27725bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.1 Specification (State and State 27735bd8deadSopenharmony_ciRequests) 27745bd8deadSopenharmony_ci 27755bd8deadSopenharmony_ci In section 6.1.3 "Enumerated Queries", modify the seventh paragraph 27765bd8deadSopenharmony_ci to say: 27775bd8deadSopenharmony_ci 27785bd8deadSopenharmony_ci "For texture images with uncompressed internal formats, queries of 27795bd8deadSopenharmony_ci <value> of TEXTURE_RED_SIZE, TEXTURE_GREEN_SIZE, TEXTURE_BLUE_SIZE, 27805bd8deadSopenharmony_ci TEXTURE_ALPHA_SIZE, TEXTURE_LUMINANCE_SIZE, TEXTURE_INTENSITY_SIZE, 27815bd8deadSopenharmony_ci TEXTURE_DEPTH_SIZE, and TEXTURE_STENCIL_SIZE return the actual 27825bd8deadSopenharmony_ci resolutions of the stored image array components..." 27835bd8deadSopenharmony_ci 27845bd8deadSopenharmony_ci Section 6.1.4 "Texture Queries", in the second paragraph, replace 27855bd8deadSopenharmony_ci the first second and third sentences as follows: 27865bd8deadSopenharmony_ci 27875bd8deadSopenharmony_ci "Calling GetTexImage with a color format (one of RED, GREEN, 27885bd8deadSopenharmony_ci BLUE, ALPHA, RGB, BGR, RGBA, BGRA, LUMINANCE, or 27895bd8deadSopenharmony_ci LUMINANCE_ALPHA) when the internal format of the texture image 27905bd8deadSopenharmony_ci is not a color format causes the error INVALID_OPERATION. 27915bd8deadSopenharmony_ci 27925bd8deadSopenharmony_ci Calling GetTexImage with a <format> of DEPTH_COMPONENT when the 27935bd8deadSopenharmony_ci base internal format of the texture image is not DEPTH_COMPONENT 27945bd8deadSopenharmony_ci or DEPTH_STENCIL causes the error INVALID_OPERATION. 27955bd8deadSopenharmony_ci 27965bd8deadSopenharmony_ci Calling GetTexImage with a <format> of DEPTH_STENCIL when 27975bd8deadSopenharmony_ci the base internal format of the texture image is not 27985bd8deadSopenharmony_ci DEPTH_STENCIL causes the error INVALID_OPERATION. 27995bd8deadSopenharmony_ci 28005bd8deadSopenharmony_ci GetTexImage obtains component groups from a texture image with 28015bd8deadSopenharmony_ci the indicated level-of-detail. If <format> is a color format, 28025bd8deadSopenharmony_ci then the components are assigned among R, G, B, and A according 28035bd8deadSopenharmony_ci to Table 6.1, starting with the first group in the first row, 28045bd8deadSopenharmony_ci and continuing by obtaining groups in order from each row and 28055bd8deadSopenharmony_ci proceeding from the first row to the last, and from the first 28065bd8deadSopenharmony_ci image to the last for three-dimensional textures. If <format> 28075bd8deadSopenharmony_ci is DEPTH_COMPONENT, then each depth component is assigned with 28085bd8deadSopenharmony_ci the same ordering of rows and images. If <format> is 28095bd8deadSopenharmony_ci DEPTH_STENCIL, then each depth component and each stencil 28105bd8deadSopenharmony_ci index is assigned with the same ordering of rows and images." 28115bd8deadSopenharmony_ci 28125bd8deadSopenharmony_ci After section 6.1.14 and before section 6.1.15 (which should be 28135bd8deadSopenharmony_ci renumbered 6.1.17), add two new sections: 28145bd8deadSopenharmony_ci 28155bd8deadSopenharmony_ci "6.1.15 Framebuffer Object Queries 28165bd8deadSopenharmony_ci 28175bd8deadSopenharmony_ci The command 28185bd8deadSopenharmony_ci 28195bd8deadSopenharmony_ci boolean IsFramebuffer( uint framebuffer ); 28205bd8deadSopenharmony_ci 28215bd8deadSopenharmony_ci returns TRUE if <framebuffer> is the name of a framebuffer 28225bd8deadSopenharmony_ci object. If <framebuffer> is zero, or if <framebuffer> is a 28235bd8deadSopenharmony_ci non-zero value that is not the name of a framebuffer object, 28245bd8deadSopenharmony_ci IsFramebuffer return FALSE. 28255bd8deadSopenharmony_ci 28265bd8deadSopenharmony_ci The command 28275bd8deadSopenharmony_ci 28285bd8deadSopenharmony_ci void GetFramebufferAttachmentParameteriv(enum target, 28295bd8deadSopenharmony_ci enum attachment, 28305bd8deadSopenharmony_ci enum pname, 28315bd8deadSopenharmony_ci int *params); 28325bd8deadSopenharmony_ci 28335bd8deadSopenharmony_ci returns information about attachments of a bound framebuffer object. 28345bd8deadSopenharmony_ci <target> must be DRAW_FRAMEBUFFER, READ_FRAMEBUFFER or FRAMEBUFFER. 28355bd8deadSopenharmony_ci FRAMEBUFFER is equivalent to DRAW_FRAMEBUFFER. 28365bd8deadSopenharmony_ci 28375bd8deadSopenharmony_ci If the default framebuffer is bound to <target>, then <attachment> 28385bd8deadSopenharmony_ci must be one of FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, BACK_RIGHT, or 28395bd8deadSopenharmony_ci AUXi, identifying a color buffer; DEPTH, identifying the depth 28405bd8deadSopenharmony_ci buffer; or STENCIL, identifying the stencil buffer. 28415bd8deadSopenharmony_ci 28425bd8deadSopenharmony_ci If a framebuffer object is bound to <target>, then <attachment> must 28435bd8deadSopenharmony_ci be one of the attachment points of the framebuffer listed in table 28445bd8deadSopenharmony_ci 1.nnn. 28455bd8deadSopenharmony_ci 28465bd8deadSopenharmony_ci If <attachment> is DEPTH_STENCIL_ATTACHMENT, and different objects 28475bd8deadSopenharmony_ci are bound to the depth and stencil attachment points of <target>, 28485bd8deadSopenharmony_ci the query will fail and generate an INVALID_OPERATION error. If the 28495bd8deadSopenharmony_ci same object is bound to both attachment points, information about 28505bd8deadSopenharmony_ci that object will be returned. 28515bd8deadSopenharmony_ci 28525bd8deadSopenharmony_ci Upon successful return from GetFramebufferAttachmentParameteriv, if 28535bd8deadSopenharmony_ci <pname> is FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, then <param> will 28545bd8deadSopenharmony_ci contain one of NONE, FRAMEBUFFER_DEFAULT, TEXTURE, or RENDERBUFFER, 28555bd8deadSopenharmony_ci identifying the type of object which contains the attached image. 28565bd8deadSopenharmony_ci Other values accepted for <pname> depend on the type of object, as 28575bd8deadSopenharmony_ci described below. 28585bd8deadSopenharmony_ci 28595bd8deadSopenharmony_ci If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is 28605bd8deadSopenharmony_ci NONE, no framebuffer is bound to <target>. In this case 28615bd8deadSopenharmony_ci querying <pname> FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 28625bd8deadSopenharmony_ci will return zero, and all other queries will generate an 28635bd8deadSopenharmony_ci INVALID_OPERATION error. 28645bd8deadSopenharmony_ci 28655bd8deadSopenharmony_ci If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is not 28665bd8deadSopenharmony_ci NONE, these queries apply to all other framebuffer types: 28675bd8deadSopenharmony_ci 28685bd8deadSopenharmony_ci * If <pname> is FRAMEBUFFER_ATTACHMENT_RED_SIZE, 28695bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, 28705bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, 28715bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, 28725bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, or 28735bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, then <param> will contain 28745bd8deadSopenharmony_ci the number of bits in the corresponding red, green, blue, alpha, 28755bd8deadSopenharmony_ci depth, or stencil component of the specified <attachment>. Zero 28765bd8deadSopenharmony_ci is returned if the requested component is not present in 28775bd8deadSopenharmony_ci <attachment>. 28785bd8deadSopenharmony_ci 28795bd8deadSopenharmony_ci * If <pname> is FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, <param> 28805bd8deadSopenharmony_ci will contain the format of components of the specified 28815bd8deadSopenharmony_ci attachment, one of FLOAT, INT, UNSIGNED_INT, UNSIGNED_NORMALIZED 28825bd8deadSopenharmony_ci or INDEX for floating-point, signed integer, unsigned integer, 28835bd8deadSopenharmony_ci unsigned fixed-point, or index components respectively. Only 28845bd8deadSopenharmony_ci color buffers may have index or integer components. 28855bd8deadSopenharmony_ci 28865bd8deadSopenharmony_ci * If <pname> is FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, <param> 28875bd8deadSopenharmony_ci will contain the encoding of components of the specified 28885bd8deadSopenharmony_ci attachment, one of LINEAR or SRGB for linear or sRGB-encoded 28895bd8deadSopenharmony_ci components, respectively. Only color buffer components may be 28905bd8deadSopenharmony_ci sRGB-encoded; such components are treated as described in 28915bd8deadSopenharmony_ci sections 4.1.8 "Blending" and 4.1.X "sRGB Conversion" (as 28925bd8deadSopenharmony_ci modified by ARB_framebuffer_sRGB). For the default framebuffer, 28935bd8deadSopenharmony_ci color encoding is determined by the implementation. For 28945bd8deadSopenharmony_ci framebuffer objects, components are sRGB-encoded if the internal 28955bd8deadSopenharmony_ci format of a color attachment is one of the color-renderable SRGB 28965bd8deadSopenharmony_ci formats described in section 3.8.15 "sRGB Texture Color 28975bd8deadSopenharmony_ci Conversion". 28985bd8deadSopenharmony_ci 28995bd8deadSopenharmony_ci If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is RENDERBUFFER, 29005bd8deadSopenharmony_ci then 29015bd8deadSopenharmony_ci 29025bd8deadSopenharmony_ci * If <pname> is FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, <params> will 29035bd8deadSopenharmony_ci contain the name of the renderbuffer object which contains the 29045bd8deadSopenharmony_ci attached image. 29055bd8deadSopenharmony_ci 29065bd8deadSopenharmony_ci If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is TEXTURE, then 29075bd8deadSopenharmony_ci 29085bd8deadSopenharmony_ci * If <pname> is FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, then <params> 29095bd8deadSopenharmony_ci will contain the name of the texture object which contains the 29105bd8deadSopenharmony_ci attached image. 29115bd8deadSopenharmony_ci 29125bd8deadSopenharmony_ci * If <pname> is FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, then 29135bd8deadSopenharmony_ci <params> will contain the mipmap level of the texture object 29145bd8deadSopenharmony_ci which contains the attached image. 29155bd8deadSopenharmony_ci 29165bd8deadSopenharmony_ci * If <pname> is FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE and 29175bd8deadSopenharmony_ci the texture object named FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is a 29185bd8deadSopenharmony_ci cube map texture, then <params> will contain the cube map face 29195bd8deadSopenharmony_ci of the cubemap texture object which contains the attached image. 29205bd8deadSopenharmony_ci Otherwise <params> will contain the value zero. 29215bd8deadSopenharmony_ci 29225bd8deadSopenharmony_ci * If <pname> is FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER and the 29235bd8deadSopenharmony_ci texture object named FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is a 29245bd8deadSopenharmony_ci three-dimensional texture, then <params> will contain the layer 29255bd8deadSopenharmony_ci of the 2D image of the 3D texture object which contains the 29265bd8deadSopenharmony_ci attached image. Otherwise <params> will contain the value zero. 29275bd8deadSopenharmony_ci 29285bd8deadSopenharmony_ci Any combinations of framebuffer type and <pname> not described above 29295bd8deadSopenharmony_ci will generate an INVALID_ENUM error." 29305bd8deadSopenharmony_ci 29315bd8deadSopenharmony_ci 29325bd8deadSopenharmony_ci 6.1.16 Renderbuffer Object Queries 29335bd8deadSopenharmony_ci 29345bd8deadSopenharmony_ci "The command 29355bd8deadSopenharmony_ci 29365bd8deadSopenharmony_ci boolean IsRenderbuffer( uint renderbuffer ); 29375bd8deadSopenharmony_ci 29385bd8deadSopenharmony_ci returns TRUE if <renderbuffer> is the name of a renderbuffer 29395bd8deadSopenharmony_ci object. If <renderbuffer> is zero, or if <renderbuffer> is a 29405bd8deadSopenharmony_ci non-zero value that is not the name of a renderbuffer object, 29415bd8deadSopenharmony_ci IsRenderbuffer return FALSE. 29425bd8deadSopenharmony_ci 29435bd8deadSopenharmony_ci The command 29445bd8deadSopenharmony_ci 29455bd8deadSopenharmony_ci void GetRenderbufferParameteriv(enum target, enum pname, 29465bd8deadSopenharmony_ci int* params); 29475bd8deadSopenharmony_ci 29485bd8deadSopenharmony_ci returns information about a bound renderbuffer object. <target> must 29495bd8deadSopenharmony_ci be RENDERBUFFER and <pname> must be one of the symbolic values in 29505bd8deadSopenharmony_ci table 8.nnn. If the renderbuffer currently bound to <target> is 29515bd8deadSopenharmony_ci zero, then an INVALID_OPERATION error is generated. 29525bd8deadSopenharmony_ci 29535bd8deadSopenharmony_ci Upon successful return from GetRenderbufferParameteriv, if <pname> 29545bd8deadSopenharmony_ci is RENDERBUFFER_WIDTH, RENDERBUFFER_HEIGHT, 29555bd8deadSopenharmony_ci RENDERBUFFER_INTERNAL_FORMAT, or RENDERBUFFER_SAMPLES, then <params> 29565bd8deadSopenharmony_ci will contain the width in pixels, height in pixels, internal format, 29575bd8deadSopenharmony_ci or number of samples, respectively, of the image of the renderbuffer 29585bd8deadSopenharmony_ci currently bound to <target>. 29595bd8deadSopenharmony_ci 29605bd8deadSopenharmony_ci If <pname> is RENDERBUFFER_RED_SIZE, RENDERBUFFER_GREEN_SIZE, 29615bd8deadSopenharmony_ci RENDERBUFFER_BLUE_SIZE, RENDERBUFFER_ALPHA_SIZE, 29625bd8deadSopenharmony_ci RENDERBUFFER_DEPTH_SIZE, or RENDERBUFFER_STENCIL_SIZE, then <params> 29635bd8deadSopenharmony_ci will contain the actual resolutions, (not the resolutions specified 29645bd8deadSopenharmony_ci when the image array was defined), for the red, green, blue, alpha 29655bd8deadSopenharmony_ci depth, or stencil components, respectively, of the image of the 29665bd8deadSopenharmony_ci renderbuffer currently bound to <target>. 29675bd8deadSopenharmony_ci 29685bd8deadSopenharmony_ci Otherwise, an INVALID_ENUM error is generated." 29695bd8deadSopenharmony_ci 29705bd8deadSopenharmony_ci In section 6.2 "State Tables", add a row to table 6.18 "Textures 29715bd8deadSopenharmony_ci (state per texture image)": 29725bd8deadSopenharmony_ci 29735bd8deadSopenharmony_ci Get value Type Get Cmd IV Description Sec. 29745bd8deadSopenharmony_ci ------------------ ------ -------------------- --- ---------------------------------- ----- 29755bd8deadSopenharmony_ci ... ... ... ... ... ... 29765bd8deadSopenharmony_ci TEXTURE_STENCIL_SIZE n x Z+ GetTexLevelParameter 0 texture image's stencil resolution 3.8.3 29775bd8deadSopenharmony_ci 29785bd8deadSopenharmony_ci 29795bd8deadSopenharmony_ciErrors 29805bd8deadSopenharmony_ci 29815bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if DRAW_FRAMEBUFFER_BINDING 29825bd8deadSopenharmony_ci is zero and DrawBuffer or DrawBuffers is called with a <buf> 29835bd8deadSopenharmony_ci constant (other than NONE) that does not correspond to a buffer 29845bd8deadSopenharmony_ci allocated to the GL by the window-system, including the constants 29855bd8deadSopenharmony_ci COLOR_ATTACHMENT0 through COLOR_ATTACHMENTn, where n is 29865bd8deadSopenharmony_ci MAX_COLOR_ATTACHMENTS - 1. 29875bd8deadSopenharmony_ci 29885bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if DRAW_FRAMEBUFFER_BINDING 29895bd8deadSopenharmony_ci is non-zero and DrawBuffer or DrawBuffer is called 29905bd8deadSopenharmony_ci with a <buf> constant (other than NONE) that is not in the range 29915bd8deadSopenharmony_ci COLOR_ATTACHMENT0 through COLOR_ATTACHMENTn, where n is 29925bd8deadSopenharmony_ci MAX_COLOR_ATTACHMENTS - 1. 29935bd8deadSopenharmony_ci 29945bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if READ_FRAMEBUFFER_BINDING 29955bd8deadSopenharmony_ci is non-zero and ReadBuffer is called 29965bd8deadSopenharmony_ci with a <buf> constant (other than NONE) that is not in the range 29975bd8deadSopenharmony_ci COLOR_ATTACHMENT0 through COLOR_ATTACHMENTn, where n is 29985bd8deadSopenharmony_ci MAX_COLOR_ATTACHMENTS - 1. 29995bd8deadSopenharmony_ci 30005bd8deadSopenharmony_ci The error INVALID_ENUM is generated if DrawBuffer or ReadBuffer is 30015bd8deadSopenharmony_ci called with a <buf> constant that is not listed in table 4.4 or 30025bd8deadSopenharmony_ci 10.nnn. 30035bd8deadSopenharmony_ci 30045bd8deadSopenharmony_ci The error INVALID_ENUM is generated if DrawBuffers is called with a 30055bd8deadSopenharmony_ci <buf> constant that is not listed in table 10.nnn or 11.nnn. 30065bd8deadSopenharmony_ci 30075bd8deadSopenharmony_ci The error INVALID_FRAMEBUFFER_OPERATION is generated if 30085bd8deadSopenharmony_ci BlitFramebuffer, DrawPixels, or CopyPixels is called while the 30095bd8deadSopenharmony_ci draw framebuffer is not framebuffer complete. 30105bd8deadSopenharmony_ci 30115bd8deadSopenharmony_ci The error INVALID_FRAMEBUFFER_OPERATION is generated if 30125bd8deadSopenharmony_ci BlitFramebuffer, ReadPixels, CopyPixels, CopyTex{Sub}Image*, 30135bd8deadSopenharmony_ci CopyColor{Sub}Table, or CopyConvolutionFilter* is called while the 30145bd8deadSopenharmony_ci read framebuffer is not framebuffer complete. 30155bd8deadSopenharmony_ci 30165bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if 30175bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv is called while the value of 30185bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING is zero. 30195bd8deadSopenharmony_ci 30205bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if 30215bd8deadSopenharmony_ci FramebufferRenderbuffer or FramebufferTexture{1D|2D|3D} is 30225bd8deadSopenharmony_ci called while the value of DRAW_FRAMEBUFFER_BINDING is zero. 30235bd8deadSopenharmony_ci 30245bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if RenderbufferStorage 30255bd8deadSopenharmony_ci or GetRenderbufferParameteriv is called while the value of 30265bd8deadSopenharmony_ci RENDERBUFFER_BINDING is zero. 30275bd8deadSopenharmony_ci 30285bd8deadSopenharmony_ci The error INVALID_ENUM is generated if 30295bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv is called with an 30305bd8deadSopenharmony_ci <attachment> other than COLOR_ATTACHMENT0 through 30315bd8deadSopenharmony_ci COLOR_ATTACHMENTn, where n is MAX_COLOR_ATTACHMENTS - 1. 30325bd8deadSopenharmony_ci 30335bd8deadSopenharmony_ci The error INVALID_ENUM is generated if 30345bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv is called with a <pname> 30355bd8deadSopenharmony_ci other than FRAMEBUFFER_ATTACHMENT_OBJECT_NAME when the type of 30365bd8deadSopenharmony_ci the attached object at the named attachment point is 30375bd8deadSopenharmony_ci RENDERBUFFER. 30385bd8deadSopenharmony_ci 30395bd8deadSopenharmony_ci The error INVALID_ENUM is generated if 30405bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv is called with a <pname> 30415bd8deadSopenharmony_ci other than FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 30425bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, 30435bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, or 30445bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER when the type of the 30455bd8deadSopenharmony_ci attached object at the named attachment point is TEXTURE. 30465bd8deadSopenharmony_ci 30475bd8deadSopenharmony_ci The error INVALID_ENUM is generated if GetRenderbufferParameteriv 30485bd8deadSopenharmony_ci is called with a <pname> other than RENDERBUFFER_WIDTH, 30495bd8deadSopenharmony_ci RENDERBUFFER_HEIGHT, or RENDERBUFFER_INTERNAL_FORMAT, 30505bd8deadSopenharmony_ci RENDERBUFFER_RED_SIZE, RENDERBUFFER_GREEN_SIZE, 30515bd8deadSopenharmony_ci RENDERBUFFER_BLUE_SIZE, RENDERBUFFER_ALPHA_SIZE, 30525bd8deadSopenharmony_ci RENDERBUFFER_DEPTH_SIZE, or RENDERBUFFER_STENCIL_SIZE. 30535bd8deadSopenharmony_ci 30545bd8deadSopenharmony_ci The error INVALID_VALUE is generated if RenderbufferStorage is 30555bd8deadSopenharmony_ci called with a <width> or <height> that is greater than 30565bd8deadSopenharmony_ci MAX_RENDERBUFFER_SIZE. 30575bd8deadSopenharmony_ci 30585bd8deadSopenharmony_ci The error INVALID_ENUM is generated if RenderbufferStorage is 30595bd8deadSopenharmony_ci called with an <internalformat> that is not RGB, RGBA, 30605bd8deadSopenharmony_ci DEPTH_COMPONENT, STENCIL_INDEX, DEPTH_STENCIL, or one of the 30615bd8deadSopenharmony_ci internal formats from table 3.16 or table 2.nnn that has a base 30625bd8deadSopenharmony_ci internal format of RGB, RGBA, DEPTH_COMPONENT, STENCIL_INDEX, r 30635bd8deadSopenharmony_ci DEPTH_STENCIL. 30645bd8deadSopenharmony_ci 30655bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if 30665bd8deadSopenharmony_ci FramebufferRenderbuffer is called and <renderbuffer> is not the 30675bd8deadSopenharmony_ci name of a renderbuffer object. 30685bd8deadSopenharmony_ci 30695bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if 30705bd8deadSopenharmony_ci FramebufferTexture{1D|2D|3D} is called and <texture> is not the 30715bd8deadSopenharmony_ci name of a texture object. 30725bd8deadSopenharmony_ci 30735bd8deadSopenharmony_ci The error INVALID_VALUE is generated if 30745bd8deadSopenharmony_ci FramebufferTexture{1D|2D|3D} is called with a <level> that is 30755bd8deadSopenharmony_ci less than zero. 30765bd8deadSopenharmony_ci 30775bd8deadSopenharmony_ci The error INVALID_VALUE is generated if FramebufferTexture2D is 30785bd8deadSopenharmony_ci called with a <level> that is not zero and <textarget> is 30795bd8deadSopenharmony_ci TEXTURE_RECTANGLE_ARB. 30805bd8deadSopenharmony_ci 30815bd8deadSopenharmony_ci The error INVALID_VALUE is generated if FramebufferTexture{1D|2D} 30825bd8deadSopenharmony_ci is called with a <level> that is greater than the log base 2 of 30835bd8deadSopenharmony_ci MAX_TEXTURE_SIZE and <texture> is a 1D or 2D texture. 30845bd8deadSopenharmony_ci 30855bd8deadSopenharmony_ci The error INVALID_VALUE is generated if FramebufferTexture2D 30865bd8deadSopenharmony_ci is called with a <level> that is greater than the log base 2 of 30875bd8deadSopenharmony_ci MAX_CUBE_MAP_TEXTURE_SIZE and <texture> is a cubemap texture. 30885bd8deadSopenharmony_ci 30895bd8deadSopenharmony_ci The error INVALID_VALUE is generated if FramebufferTexture3D is 30905bd8deadSopenharmony_ci called with a <level> greater than the log base 2 of the 30915bd8deadSopenharmony_ci MAX_3D_TEXTURE_SIZE. 30925bd8deadSopenharmony_ci 30935bd8deadSopenharmony_ci The error INVALID_VALUE is generated if FramebufferTexture3D is 30945bd8deadSopenharmony_ci called with a <layer> that is larger than MAX_3D_TEXTURE_SIZE-1. 30955bd8deadSopenharmony_ci 30965bd8deadSopenharmony_ci The error INVALID_VALUE is generated by BlitFramebuffer if 30975bd8deadSopenharmony_ci <mask> has any bits set other than those named by 30985bd8deadSopenharmony_ci COLOR_BUFFER_BIT, DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT. 30995bd8deadSopenharmony_ci 31005bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if BlitFramebuffer is 31015bd8deadSopenharmony_ci called and <mask> includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT 31025bd8deadSopenharmony_ci and <filter> is not NEAREST. 31035bd8deadSopenharmony_ci 31045bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if BlitFramebuffer is 31055bd8deadSopenharmony_ci called and <mask> includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT 31065bd8deadSopenharmony_ci and the source and destination depth or stencil buffer formats do 31075bd8deadSopenharmony_ci not match. 31085bd8deadSopenharmony_ci 31095bd8deadSopenharmony_ci The error INVALID_ENUM is generated by BlitFramebuffer if 31105bd8deadSopenharmony_ci <filter> is not LINEAR or NEAREST. 31115bd8deadSopenharmony_ci 31125bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if BlitFramebuffer 31135bd8deadSopenharmony_ci is called within a Begin/End pair. 31145bd8deadSopenharmony_ci 31155bd8deadSopenharmony_ci The error INVALID_ENUM is generated if BindFramebuffer, 31165bd8deadSopenharmony_ci CheckFramebufferStatus, FramebufferTexture{1D|2D|3D}, 31175bd8deadSopenharmony_ci FramebufferRenderbuffer, or 31185bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv is called and <target> is 31195bd8deadSopenharmony_ci not DRAW_FRAMEBUFFER, READ_FRAMEBUFFER or FRAMEBUFFER. 31205bd8deadSopenharmony_ci 31215bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if 31225bd8deadSopenharmony_ci CheckFramebufferStatus is called within a Begin/End pair. 31235bd8deadSopenharmony_ci 31245bd8deadSopenharmony_ci The error OUT_OF_MEMORY is generated if the GL is unable to create a 31255bd8deadSopenharmony_ci data store of the required size when calling RenderbufferStorage. 31265bd8deadSopenharmony_ci 31275bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if GenerateMipmap is 31285bd8deadSopenharmony_ci called with a <target> of TEXTURE_CUBE_MAP and the texture object 31295bd8deadSopenharmony_ci currently bound to TEXTURE_CUBE_MAP is not "cube complete" as 31305bd8deadSopenharmony_ci defined in section 3.8.10 31315bd8deadSopenharmony_ci 31325bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if ReadPixels, 31335bd8deadSopenharmony_ci CopyPixels, CopyTex{Sub}Image*, CopyColor{Sub}Table, or 31345bd8deadSopenharmony_ci CopyConvolutionFilter* is called while READ_FRAMEBUFFER_BINDING 31355bd8deadSopenharmony_ci is non-zero, the read framebuffer is framebuffer complete, and the 31365bd8deadSopenharmony_ci value of SAMPLE_BUFFERS for the read framebuffer is greater than 31375bd8deadSopenharmony_ci zero. 31385bd8deadSopenharmony_ci 31395bd8deadSopenharmony_ci The error OUT_OF_MEMORY is generated when 31405bd8deadSopenharmony_ci RenderbufferStorageMultisample cannot create storage of the 31415bd8deadSopenharmony_ci specified size. 31425bd8deadSopenharmony_ci 31435bd8deadSopenharmony_ci If both the draw and read framebuffers are framebuffer complete and 31445bd8deadSopenharmony_ci both have a value of SAMPLE_BUFFERS that is greater than zero, then 31455bd8deadSopenharmony_ci the error INVALID_OPERATION is generated if BlitFramebuffer is 31465bd8deadSopenharmony_ci called and the values of SAMPLES for the draw and read framebuffers 31475bd8deadSopenharmony_ci do not match. 31485bd8deadSopenharmony_ci 31495bd8deadSopenharmony_ci If both the draw and read framebuffers are framebuffer complete and 31505bd8deadSopenharmony_ci either has a value of SAMPLE_BUFFERS that is greater than zero, then 31515bd8deadSopenharmony_ci the error INVALID_OPERATION is generated if BlitFramebuffer is 31525bd8deadSopenharmony_ci called and the formats of the draw and read framebuffers are not 31535bd8deadSopenharmony_ci identical. 31545bd8deadSopenharmony_ci 31555bd8deadSopenharmony_ci If either the draw or read framebuffer is framebuffer complete and 31565bd8deadSopenharmony_ci has a value of SAMPLE_BUFFERS that is greater than zero, then the 31575bd8deadSopenharmony_ci error INVALID_OPERATION is generated if BlitFramebuffer is called 31585bd8deadSopenharmony_ci and the specified source and destination dimensions are not 31595bd8deadSopenharmony_ci identical. 31605bd8deadSopenharmony_ci 31615bd8deadSopenharmony_ci If RenderbufferStorageMultisample is called with a value of 31625bd8deadSopenharmony_ci <samples> that is greater than MAX_SAMPLES, then the error 31635bd8deadSopenharmony_ci INVALID_VALUE is generated. 31645bd8deadSopenharmony_ci 31655bd8deadSopenharmony_ci The error INVALID_ENUM is generated if DrawPixels or ReadPixels is 31665bd8deadSopenharmony_ci called where format is DEPTH_STENCIL and type is not 31675bd8deadSopenharmony_ci UNSIGNED_INT_24_8. 31685bd8deadSopenharmony_ci 31695bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if DrawPixels or ReadPixels 31705bd8deadSopenharmony_ci is called where type is UNSIGNED_INT_24_8 and format is not 31715bd8deadSopenharmony_ci DEPTH_STENCIL. 31725bd8deadSopenharmony_ci 31735bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if DrawPixels or ReadPixels 31745bd8deadSopenharmony_ci is called where format is DEPTH_STENCIL and there is not both a 31755bd8deadSopenharmony_ci depth buffer and a stencil buffer. 31765bd8deadSopenharmony_ci 31775bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if CopyPixels is called 31785bd8deadSopenharmony_ci where type is DEPTH_STENCIL and there is not both a depth buffer 31795bd8deadSopenharmony_ci and a stencil buffer. 31805bd8deadSopenharmony_ci 31815bd8deadSopenharmony_ci 31825bd8deadSopenharmony_ciNew State 31835bd8deadSopenharmony_ci 31845bd8deadSopenharmony_ci (add new table 3.nnn, "Framebuffer (state per framebuffer target binding point)") 31855bd8deadSopenharmony_ci 31865bd8deadSopenharmony_ci Get Value Type Get Command Initial Value Description Section Attribute 31875bd8deadSopenharmony_ci ------------------------ ---- ----------- -------------- ------------------- ------------ --------- 31885bd8deadSopenharmony_ci DRAW_FRAMEBUFFER_BINDING Z+ GetIntegerv 0 Framebuffer object bound 4.4.1 - 31895bd8deadSopenharmony_ci to DRAW_FRAMEBUFFER 31905bd8deadSopenharmony_ci READ_FRAMEBUFFER_BINDING Z+ GetIntegerv 0 Framebuffer object 4.4.1 - 31915bd8deadSopenharmony_ci to READ_FRAMEBUFFER 31925bd8deadSopenharmony_ci 31935bd8deadSopenharmony_ci (insert new table 4.nnn, "Framebuffer (state per framebuffer object)") 31945bd8deadSopenharmony_ci 31955bd8deadSopenharmony_ci Get Value Type Get Command Initial Value Description Section Attribute 31965bd8deadSopenharmony_ci ---------------- ------ ------------- ------------- -------------------- ------------ --------- 31975bd8deadSopenharmony_ci DRAW_BUFFERi [1] 1 + xZ(10*) GetIntegerv see 4.2.1 Draw buffer selected 4.2.1 color-buffer 31985bd8deadSopenharmony_ci for color output i 31995bd8deadSopenharmony_ci READ_BUFFER [2] Z(3) GetIntegerv see 4.3.2 Read source buffer 4.3.2 pixel 32005bd8deadSopenharmony_ci 32015bd8deadSopenharmony_ci [1] prior to this extension, the DRAW_BUFFERi state was 32025bd8deadSopenharmony_ci described in table 6.21 "Framebuffer Control" of the OpenGL 32035bd8deadSopenharmony_ci 2.0 specification. 32045bd8deadSopenharmony_ci [2] prior to this extension, the READ_BUFFER state was described 32055bd8deadSopenharmony_ci in table 6.26 "Pixel" of the OpenGL 2.0 specification. 32065bd8deadSopenharmony_ci 32075bd8deadSopenharmony_ci 32085bd8deadSopenharmony_ci 32095bd8deadSopenharmony_ci (insert new table 5.nnn, "Framebuffer (state per framebuffer object attachment point)") 32105bd8deadSopenharmony_ci 32115bd8deadSopenharmony_ci Get Value Type Get Command Initial Value Description Section Attribute 32125bd8deadSopenharmony_ci -------------------------------------------- ---- -------------------------------------- ------------- -------------------- ------------ --------- 32135bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE Z GetFramebufferAttachmentParameteriv NONE type of 4.4.2.2 and - 32145bd8deadSopenharmony_ci image attached to 4.4.2.3 32155bd8deadSopenharmony_ci framebuffer attachment 32165bd8deadSopenharmony_ci point 32175bd8deadSopenharmony_ci 32185bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_OBJECT_NAME Z GetFramebufferAttachmentParameteriv 0 name of object 4.4.2.2 and - 32195bd8deadSopenharmony_ci attached to 4.4.2.3 32205bd8deadSopenharmony_ci framebuffer attachment 32215bd8deadSopenharmony_ci point 32225bd8deadSopenharmony_ci 32235bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL Z GetFramebufferAttachmentParameteriv 0 mipmap level of 4.4.2.2 and - 32245bd8deadSopenharmony_ci texture image 4.4.2.3 32255bd8deadSopenharmony_ci attached, if object 32265bd8deadSopenharmony_ci attached is texture. 32275bd8deadSopenharmony_ci 32285bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE Z+ GetFramebufferAttachmentParameteriv NONE cubemap face of 4.4.2.2 and - 32295bd8deadSopenharmony_ci texture image 4.4.2.3 32305bd8deadSopenharmony_ci attached, if object 32315bd8deadSopenharmony_ci attached is cubemap 32325bd8deadSopenharmony_ci texture. 32335bd8deadSopenharmony_ci 32345bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER Z GetFramebufferAttachmentParameteriv 0 layer of 4.4.2.2 and - 32355bd8deadSopenharmony_ci texture image 4.4.2.3 32365bd8deadSopenharmony_ci attached, if object 32375bd8deadSopenharmony_ci attached is 3D texture. 32385bd8deadSopenharmony_ci 32395bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING Z_2 GetFramebufferAttachmentParameteriv - Encoding of components 6.1.3 - 32405bd8deadSopenharmony_ci in the attached image 32415bd8deadSopenharmony_ci 32425bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE Z_4 GetFramebufferAttachmentParameteriv - Data type of components 6.1.3 - 32435bd8deadSopenharmony_ci in the attached image 32445bd8deadSopenharmony_ci 32455bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_RED_SIZE Z+ GetFramebufferAttachmentParameteriv - Size in bits of att. 6.1.3 - 32465bd8deadSopenharmony_ci image's red component 32475bd8deadSopenharmony_ci 32485bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_GREEN_SIZE Z+ GetFramebufferAttachmentParameteriv - Size in bits of att. 6.1.3 - 32495bd8deadSopenharmony_ci image's green component 32505bd8deadSopenharmony_ci 32515bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_BLUE_SIZE Z+ GetFramebufferAttachmentParameteriv - Size in bits of att. 6.1.3 - 32525bd8deadSopenharmony_ci image's blue component 32535bd8deadSopenharmony_ci 32545bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE Z+ GetFramebufferAttachmentParameteriv - Size in bits of att. 6.1.3 - 32555bd8deadSopenharmony_ci image's alpha component 32565bd8deadSopenharmony_ci 32575bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE Z+ GetFramebufferAttachmentParameteriv - Size in bits of att. 6.1.3 - 32585bd8deadSopenharmony_ci image's depth component 32595bd8deadSopenharmony_ci 32605bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE Z+ GetFramebufferAttachmentParameteriv - Size in bits of att. 6.1.3 - 32615bd8deadSopenharmony_ci image's stencil component 32625bd8deadSopenharmony_ci 32635bd8deadSopenharmony_ci 32645bd8deadSopenharmony_ci 32655bd8deadSopenharmony_ci 32665bd8deadSopenharmony_ci (insert new table 7.nnn, "Renderbuffers (state per renderbuffer target and binding point)") 32675bd8deadSopenharmony_ci 32685bd8deadSopenharmony_ci Get Value Type Get Command Initial Value Description Section Attribute 32695bd8deadSopenharmony_ci ---------------------------- ------ ------------- ------------- -------------------- ------------ --------- 32705bd8deadSopenharmony_ci RENDERBUFFER_BINDING Z GetIntegerv 0 renderbuffer object 4.4.2.1 - 32715bd8deadSopenharmony_ci bound to RENDERBUFFER 32725bd8deadSopenharmony_ci 32735bd8deadSopenharmony_ci 32745bd8deadSopenharmony_ci (insert new table 8.nnn, "Renderbuffers (state per renderbuffer object)") 32755bd8deadSopenharmony_ci 32765bd8deadSopenharmony_ci Get Value Type Get Command Initial Value Description Section Attribute 32775bd8deadSopenharmony_ci ---------------------------- ------ ------------- ------------- -------------------- ------------ --------- 32785bd8deadSopenharmony_ci RENDERBUFFER_WIDTH Z GetRenderbufferParameteriv 0 width of renderbuffer 4.4.2.1 - 32795bd8deadSopenharmony_ci 32805bd8deadSopenharmony_ci RENDERBUFFER_HEIGHT Z GetRenderbufferParameteriv 0 height of renderbuffer 4.4.2.1 - 32815bd8deadSopenharmony_ci 32825bd8deadSopenharmony_ci RENDERBUFFER_INTERNAL_FORMAT Z+ GetRenderbufferParameteriv RGBA internal format 4.4.2.1 - 32835bd8deadSopenharmony_ci of renderbuffer 32845bd8deadSopenharmony_ci 32855bd8deadSopenharmony_ci RENDERBUFFER_RED_SIZE Z GetRenderbufferParameteriv 0 size in bits of 4.4.2.1 - 32865bd8deadSopenharmony_ci renderbuffer image's 32875bd8deadSopenharmony_ci red component 32885bd8deadSopenharmony_ci 32895bd8deadSopenharmony_ci RENDERBUFFER_GREEN_SIZE Z GetRenderbufferParameteriv 0 size in bits of 4.4.2.1 - 32905bd8deadSopenharmony_ci renderbuffer image's 32915bd8deadSopenharmony_ci green component 32925bd8deadSopenharmony_ci 32935bd8deadSopenharmony_ci RENDERBUFFER_BLUE_SIZE Z GetRenderbufferParameteriv 0 size in bits of 4.4.2.1 - 32945bd8deadSopenharmony_ci renderbuffer image's 32955bd8deadSopenharmony_ci blue component 32965bd8deadSopenharmony_ci 32975bd8deadSopenharmony_ci RENDERBUFFER_ALPHA_SIZE Z GetRenderbufferParameteriv 0 size in bits of 4.4.2.1 - 32985bd8deadSopenharmony_ci renderbuffer image's 32995bd8deadSopenharmony_ci alpha component 33005bd8deadSopenharmony_ci 33015bd8deadSopenharmony_ci RENDERBUFFER_DEPTH_SIZE Z GetRenderbufferParameteriv 0 size in bits of 4.4.2.1 - 33025bd8deadSopenharmony_ci renderbuffer image's 33035bd8deadSopenharmony_ci depth component 33045bd8deadSopenharmony_ci 33055bd8deadSopenharmony_ci RENDERBUFFER_STENCIL_SIZE Z GetRenderbufferParameteriv 0 size in bits of 4.4.2.1 - 33065bd8deadSopenharmony_ci renderbuffer image's 33075bd8deadSopenharmony_ci stencil component 33085bd8deadSopenharmony_ci 33095bd8deadSopenharmony_ci RENDERBUFFER_SAMPLES Z+ GetRenderbufferParameteriv 0 number of samples 4.4.2.1 - 33105bd8deadSopenharmony_ci 33115bd8deadSopenharmony_ci 33125bd8deadSopenharmony_ci 33135bd8deadSopenharmony_ci 33145bd8deadSopenharmony_ci 33155bd8deadSopenharmony_ciMove the following existing state from "Implementation Dependent 33165bd8deadSopenharmony_ciValues", tables 6.33-6.37 to into a new table called "Framebuffer 33175bd8deadSopenharmony_ciDependent Values", table 9.nnn. 33185bd8deadSopenharmony_ci 33195bd8deadSopenharmony_ci Get Value 33205bd8deadSopenharmony_ci --------- 33215bd8deadSopenharmony_ci AUX_BUFFERS 33225bd8deadSopenharmony_ci MAX_DRAW_BUFFERS 33235bd8deadSopenharmony_ci RGBA_MODE 33245bd8deadSopenharmony_ci INDEX_MODE 33255bd8deadSopenharmony_ci DOUBLEBUFFER 33265bd8deadSopenharmony_ci STEREO 33275bd8deadSopenharmony_ci SAMPLE_BUFFERS 33285bd8deadSopenharmony_ci SAMPLES 33295bd8deadSopenharmony_ci RED_BITS 33305bd8deadSopenharmony_ci GREEN_BITS 33315bd8deadSopenharmony_ci BLUE_BITS 33325bd8deadSopenharmony_ci ALPHA_BITS 33335bd8deadSopenharmony_ci INDEX_BITS 33345bd8deadSopenharmony_ci DEPTH_BITS 33355bd8deadSopenharmony_ci STENCIL_BITS 33365bd8deadSopenharmony_ci ACCUM_RED_BITS 33375bd8deadSopenharmony_ci ACCUM_GREEN_BITS 33385bd8deadSopenharmony_ci ACCUM_BLUE_BITS 33395bd8deadSopenharmony_ci ACCUM_ALPHA_BITS 33405bd8deadSopenharmony_ci 33415bd8deadSopenharmony_ciTo the same table called "Framebuffer Dependent Values", table 9.nnn 33425bd8deadSopenharmony_ciadd the following new framebuffer dependent state. 33435bd8deadSopenharmony_ci 33445bd8deadSopenharmony_ci Get Value Type Get Command Minimum Value Description Section Attribute 33455bd8deadSopenharmony_ci --------- ---- ----------- ------------- ------------------- ------- --------- 33465bd8deadSopenharmony_ci MAX_COLOR_ATTACHMENTS Z+ GetIntegerv 1 Maximum number of 4.4.2.2 - 33475bd8deadSopenharmony_ci attachment points 33485bd8deadSopenharmony_ci for color buffers 33495bd8deadSopenharmony_ci when using framebuffer 33505bd8deadSopenharmony_ci objects 33515bd8deadSopenharmony_ci 33525bd8deadSopenharmony_ci MAX_SAMPLES Z+ GetIntegerv 0 Maximum number of 4.4.2.1 - 33535bd8deadSopenharmony_ci samples supported 33545bd8deadSopenharmony_ci for multisampling 33555bd8deadSopenharmony_ci 33565bd8deadSopenharmony_ciNew Implementation Dependent State 33575bd8deadSopenharmony_ci 33585bd8deadSopenharmony_ci Get Value Type Get Command Minimum Value Description Section Attribute 33595bd8deadSopenharmony_ci --------- ---- ----------- ------------- ------------------- ------- --------- 33605bd8deadSopenharmony_ci MAX_RENDERBUFFER_SIZE Z+ GetIntegerv 64 Maximum width and 4.4.2.1 - 33615bd8deadSopenharmony_ci height of 33625bd8deadSopenharmony_ci renderbuffers 33635bd8deadSopenharmony_ci supported by 33645bd8deadSopenharmony_ci the implementation 33655bd8deadSopenharmony_ci 33665bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications and dependencies on 33675bd8deadSopenharmony_ciWGL_ARB_make_current_read, GLX_SGI_make_current_read, and GLX 1.3 33685bd8deadSopenharmony_ci 33695bd8deadSopenharmony_ci The color, depth, stencil, aux, and accum logical buffers defined by 33705bd8deadSopenharmony_ci the <draw> and <read> drawables passed to glXMakeContextCurrent, 33715bd8deadSopenharmony_ci glXMakeCurrent, and glXMakeCurrentRead are ignored while the value 33725bd8deadSopenharmony_ci of DRAW_FRAMEBUFFER_BINDING is non-zero. 33735bd8deadSopenharmony_ci 33745bd8deadSopenharmony_ciDependencies on ATI_draw_buffers and ARB_draw_buffers 33755bd8deadSopenharmony_ci 33765bd8deadSopenharmony_ci If neither ATI_draw_buffers nor ARB_draw_buffers are supported, then 33775bd8deadSopenharmony_ci all discussions of DrawBuffers should be ignored. 33785bd8deadSopenharmony_ci 33795bd8deadSopenharmony_ci In addition, the language describing DrawBuffers are derived from a 33805bd8deadSopenharmony_ci combination of the ARB_draw_buffers specification and section 4.2.1 33815bd8deadSopenharmony_ci of the OpenGL 2.0 specification. 33825bd8deadSopenharmony_ci 33835bd8deadSopenharmony_ciDependencies on ARB_fragment_program, ARB_fragment_shader, and 33845bd8deadSopenharmony_ciARB_vertex_shader 33855bd8deadSopenharmony_ci 33865bd8deadSopenharmony_ci If ARB_fragment_program, ARB_fragment_shader, and ARB_vertex_shader 33875bd8deadSopenharmony_ci are all not supported, then all references to the currently bound 33885bd8deadSopenharmony_ci program or shader should be ignored. 33895bd8deadSopenharmony_ci 33905bd8deadSopenharmony_ciDependencies on ARB_texture_rectangle 33915bd8deadSopenharmony_ci 33925bd8deadSopenharmony_ci If ARB_texture_rectangle is not supported, then all references to 33935bd8deadSopenharmony_ci TEXTURE_RECTANGLE_ARB should be ignored. 33945bd8deadSopenharmony_ci 33955bd8deadSopenharmony_ciDependencies on ARB_color_buffer_float 33965bd8deadSopenharmony_ci 33975bd8deadSopenharmony_ci The reference to CLAMP_FRAGMENT_COLOR_ARB in section 4.3.3 applies 33985bd8deadSopenharmony_ci only if ARB_color_buffer_float is supported. 33995bd8deadSopenharmony_ci 34005bd8deadSopenharmony_ciDependencies on ARB_texture_rg 34015bd8deadSopenharmony_ci 34025bd8deadSopenharmony_ci If ARB_texture_rg is not supported, delete the references to RED and 34035bd8deadSopenharmony_ci RG from the list of color-renderable base internal formats from 34045bd8deadSopenharmony_ci section 4.4.4. 34055bd8deadSopenharmony_ci 34065bd8deadSopenharmony_ciDependencies on NV_float_buffer 34075bd8deadSopenharmony_ci 34085bd8deadSopenharmony_ci If NV_float_buffer is not supported, delete the references to 34095bd8deadSopenharmony_ci FLOAT_R_NV, FLOAT_RG_NV, FLOAT_RGB_NV and FLOAT_RGBA_NV from the list 34105bd8deadSopenharmony_ci of color-renderable base internal formats from section 4.4.4 34115bd8deadSopenharmony_ci 34125bd8deadSopenharmony_ciDependencies on EXT_framebuffer_object 34135bd8deadSopenharmony_ci 34145bd8deadSopenharmony_ci Framebuffer objects created with the commands defined by the 34155bd8deadSopenharmony_ci GL_EXT_framebuffer_object extension are defined to be shared, while 34165bd8deadSopenharmony_ci FBOs created with commands defined by the OpenGL core or 34175bd8deadSopenharmony_ci GL_ARB_framebuffer_object extension are defined *not* to be shared. 34185bd8deadSopenharmony_ci However, the following functions are viewed as aliases (in particular 34195bd8deadSopenharmony_ci the opcodes for X are also the same) between the functions of 34205bd8deadSopenharmony_ci GL_EXT_framebuffer_object and GL_ARB_framebuffer_object: 34215bd8deadSopenharmony_ci 34225bd8deadSopenharmony_ci IsRenderbufferEXT / IsRenderbuffer 34235bd8deadSopenharmony_ci DeleteRenderbuffersEXT / DeleteRenderbuffers 34245bd8deadSopenharmony_ci GenRenderbuffersEXT / GenRenderbuffers 34255bd8deadSopenharmony_ci RenderbufferStorageEXT / RenderbufferStorage 34265bd8deadSopenharmony_ci GetRenderbufferParameterivEXT / GetRenderbufferParameteriv 34275bd8deadSopenharmony_ci IsFramebufferEXT / IsFramebuffer 34285bd8deadSopenharmony_ci DeleteFramebuffersEXT / DeleteFramebuffers 34295bd8deadSopenharmony_ci GenFramebuffersEXT / GenFramebuffers 34305bd8deadSopenharmony_ci CheckFramebufferStatusEXT / CheckFramebufferStatus 34315bd8deadSopenharmony_ci FramebufferTexture1DEXT / FramebufferTexture1D 34325bd8deadSopenharmony_ci FramebufferTexture2DEXT / FramebufferTexture2D 34335bd8deadSopenharmony_ci FramebufferRenderbufferEXT / FramebufferRenderbuffer 34345bd8deadSopenharmony_ci GenerateMipmapEXT / GenerateMipmap 34355bd8deadSopenharmony_ci GetFramebufferAttachmentParameterivEXT / GetFramebufferAttachmentParameteriv 34365bd8deadSopenharmony_ci 34375bd8deadSopenharmony_ci Since the above pairs are aliases, the functions of a pair are 34385bd8deadSopenharmony_ci equivalent. Note that the functions BindFramebuffer and 34395bd8deadSopenharmony_ci BindFramebufferEXT are not aliases and neither are the functions 34405bd8deadSopenharmony_ci BindRenderbuffer and BindRenderbufferEXT. Because object creation 34415bd8deadSopenharmony_ci occurs when the framebuffer object is bound for the first time, a 34425bd8deadSopenharmony_ci framebuffer object can be shared across contexts only if it was first 34435bd8deadSopenharmony_ci bound with BindFramebufferEXT. Framebuffers first bound with 34445bd8deadSopenharmony_ci BindFramebuffer may not be shared across contexts. Framebuffer 34455bd8deadSopenharmony_ci objects created with BindFramebufferEXT may subsequently be bound 34465bd8deadSopenharmony_ci using BindFramebuffer. Framebuffer objects created with 34475bd8deadSopenharmony_ci BindFramebuffer may be bound with BindFramebufferEXT provided they are 34485bd8deadSopenharmony_ci bound to the same context they were created on. 34495bd8deadSopenharmony_ci 34505bd8deadSopenharmony_ciDependencies on EXT_texture_array 34515bd8deadSopenharmony_ci 34525bd8deadSopenharmony_ci If EXT_texture_array is not supported, delete all references to 34535bd8deadSopenharmony_ci one- and two-dimensional array textures. 34545bd8deadSopenharmony_ci 34555bd8deadSopenharmony_ciDependencies on EXT_texture_integer 34565bd8deadSopenharmony_ci 34575bd8deadSopenharmony_ci If EXT_texture_integer is not supported, the following changes should 34585bd8deadSopenharmony_ci be made: 34595bd8deadSopenharmony_ci 34605bd8deadSopenharmony_ci The definition of GetFramebufferAttachmentParameteriv should be 34615bd8deadSopenharmony_ci modified to remove any references to signed and unsigned integer 34625bd8deadSopenharmony_ci components for color buffers and the values of INT and UNSIGNED_INT 34635bd8deadSopenharmony_ci should be removed from the list of possible values for <param> when 34645bd8deadSopenharmony_ci <pname> is FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE. 34655bd8deadSopenharmony_ci 34665bd8deadSopenharmony_ciDependencies on ARB_framebuffer_sRGB 34675bd8deadSopenharmony_ci 34685bd8deadSopenharmony_ci If ARB_framebuffer_sRGB is not supported, the following changes should 34695bd8deadSopenharmony_ci be made: 34705bd8deadSopenharmony_ci 34715bd8deadSopenharmony_ci The definition of GetFramebufferAttachmentParameteriv should be 34725bd8deadSopenharmony_ci modified to remove any reference to sRGB-encoded components or 34735bd8deadSopenharmony_ci color buffers and sRGB conversion. The value of SRGB should be 34745bd8deadSopenharmony_ci removed from the list of possible values for <param> when <pname> is 34755bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING. 34765bd8deadSopenharmony_ci 34775bd8deadSopenharmony_ciGLX Protocol 34785bd8deadSopenharmony_ci 34795bd8deadSopenharmony_ci Nineteen new GL commands are added. 34805bd8deadSopenharmony_ci 34815bd8deadSopenharmony_ci The following thirteen rendering commands are sent to the server 34825bd8deadSopenharmony_ci as part of a glXRender request: 34835bd8deadSopenharmony_ci 34845bd8deadSopenharmony_ci BindRenderbuffer 34855bd8deadSopenharmony_ci 2 12 rendering command length 34865bd8deadSopenharmony_ci 2 235 rendering command opcode 34875bd8deadSopenharmony_ci 4 ENUM target 34885bd8deadSopenharmony_ci 4 CARD32 renderbuffer 34895bd8deadSopenharmony_ci 34905bd8deadSopenharmony_ci DeleteRenderbuffer 34915bd8deadSopenharmony_ci 2 8+n*4 rendering command length 34925bd8deadSopenharmony_ci 2 4317 rendering command opcode 34935bd8deadSopenharmony_ci 4 CARD32 n 34945bd8deadSopenharmony_ci n*4 LISTofCARD32 renderbuffers 34955bd8deadSopenharmony_ci 34965bd8deadSopenharmony_ci RenderbufferStorage 34975bd8deadSopenharmony_ci 2 20 rendering command length 34985bd8deadSopenharmony_ci 2 4318 rendering command opcode 34995bd8deadSopenharmony_ci 4 ENUM target 35005bd8deadSopenharmony_ci 4 ENUM internalFormat 35015bd8deadSopenharmony_ci 4 CARD32 width 35025bd8deadSopenharmony_ci 4 CARD32 height 35035bd8deadSopenharmony_ci 35045bd8deadSopenharmony_ci RenderbufferStorageMultisample 35055bd8deadSopenharmony_ci 35065bd8deadSopenharmony_ci 2 24 rendering command length 35075bd8deadSopenharmony_ci 2 4331 rendering command opcode 35085bd8deadSopenharmony_ci 4 ENUM target 35095bd8deadSopenharmony_ci 4 CARD32 samples 35105bd8deadSopenharmony_ci 4 ENUM internalformat 35115bd8deadSopenharmony_ci 4 CARD32 width 35125bd8deadSopenharmony_ci 4 CARD32 height 35135bd8deadSopenharmony_ci 35145bd8deadSopenharmony_ci BindFramebuffer 35155bd8deadSopenharmony_ci 2 12 rendering command length 35165bd8deadSopenharmony_ci 2 236 rendering command opcode 35175bd8deadSopenharmony_ci 4 ENUM target 35185bd8deadSopenharmony_ci 4 CARD32 framebuffer 35195bd8deadSopenharmony_ci 35205bd8deadSopenharmony_ci DeleteFramebuffer 35215bd8deadSopenharmony_ci 2 8+n*4 rendering command length 35225bd8deadSopenharmony_ci 2 4320 rendering command opcode 35235bd8deadSopenharmony_ci 4 CARD32 n 35245bd8deadSopenharmony_ci n*4 LISTofCARD32 framebuffers 35255bd8deadSopenharmony_ci 35265bd8deadSopenharmony_ci FramebufferTexture1D 35275bd8deadSopenharmony_ci 2 24 rendering command length 35285bd8deadSopenharmony_ci 2 4321 rendering command opcode 35295bd8deadSopenharmony_ci 4 ENUM target 35305bd8deadSopenharmony_ci 4 ENUM attachment 35315bd8deadSopenharmony_ci 4 ENUM textarget 35325bd8deadSopenharmony_ci 4 CARD32 texture 35335bd8deadSopenharmony_ci 4 CARD32 level 35345bd8deadSopenharmony_ci 35355bd8deadSopenharmony_ci FramebufferTexture2D 35365bd8deadSopenharmony_ci 2 24 rendering command length 35375bd8deadSopenharmony_ci 2 4322 rendering command opcode 35385bd8deadSopenharmony_ci 4 ENUM target 35395bd8deadSopenharmony_ci 4 ENUM attachment 35405bd8deadSopenharmony_ci 4 ENUM textarget 35415bd8deadSopenharmony_ci 4 CARD32 texture 35425bd8deadSopenharmony_ci 4 CARD32 level 35435bd8deadSopenharmony_ci 35445bd8deadSopenharmony_ci FramebufferTexture3D 35455bd8deadSopenharmony_ci 2 28 rendering command length 35465bd8deadSopenharmony_ci 2 4323 rendering command opcode 35475bd8deadSopenharmony_ci 4 ENUM target 35485bd8deadSopenharmony_ci 4 ENUM attachment 35495bd8deadSopenharmony_ci 4 ENUM textarget 35505bd8deadSopenharmony_ci 4 CARD32 texture 35515bd8deadSopenharmony_ci 4 CARD32 level 35525bd8deadSopenharmony_ci 4 CARD32 layer 35535bd8deadSopenharmony_ci 35545bd8deadSopenharmony_ci FramebufferTextureLayer 35555bd8deadSopenharmony_ci 2 24 rendering command length 35565bd8deadSopenharmony_ci 2 237 rendering command opcode 35575bd8deadSopenharmony_ci 4 ENUM target 35585bd8deadSopenharmony_ci 4 ENUM attachment 35595bd8deadSopenharmony_ci 4 CARD32 texture 35605bd8deadSopenharmony_ci 4 CARD32 level 35615bd8deadSopenharmony_ci 4 CARD32 layer 35625bd8deadSopenharmony_ci 35635bd8deadSopenharmony_ci FramebufferRenderbuffer 35645bd8deadSopenharmony_ci 2 20 rendering command length 35655bd8deadSopenharmony_ci 2 4324 rendering command opcode 35665bd8deadSopenharmony_ci 4 ENUM target 35675bd8deadSopenharmony_ci 4 ENUM attachment 35685bd8deadSopenharmony_ci 4 ENUM renderbuffertarget 35695bd8deadSopenharmony_ci 4 CARD32 renderbuffer 35705bd8deadSopenharmony_ci 35715bd8deadSopenharmony_ci BlitFramebuffer 35725bd8deadSopenharmony_ci 2 44 rendering command length 35735bd8deadSopenharmony_ci 2 4330 rendering command opcode 35745bd8deadSopenharmony_ci 4 CARD32 source X0 35755bd8deadSopenharmony_ci 4 CARD32 source Y0 35765bd8deadSopenharmony_ci 4 CARD32 source X1 35775bd8deadSopenharmony_ci 4 CARD32 source Y1 35785bd8deadSopenharmony_ci 4 CARD32 destination X0 35795bd8deadSopenharmony_ci 4 CARD32 destination Y0 35805bd8deadSopenharmony_ci 4 CARD32 destination X1 35815bd8deadSopenharmony_ci 4 CARD32 destination Y1 35825bd8deadSopenharmony_ci 4 CARD32 mask 35835bd8deadSopenharmony_ci 4 ENUM filter 35845bd8deadSopenharmony_ci 35855bd8deadSopenharmony_ci GenerateMipmap 35865bd8deadSopenharmony_ci 2 8 rendering command length 35875bd8deadSopenharmony_ci 2 4325 rendering command opcode 35885bd8deadSopenharmony_ci 4 ENUM target 35895bd8deadSopenharmony_ci 35905bd8deadSopenharmony_ci The remaining seven commands are non-rendering commands. These 35915bd8deadSopenharmony_ci commands are sent separately (i.e., not as part of a glXRender or 35925bd8deadSopenharmony_ci glXRenderLarge request), using the glXVendorPrivateWithReply 35935bd8deadSopenharmony_ci request: 35945bd8deadSopenharmony_ci 35955bd8deadSopenharmony_ci IsRenderbuffer 35965bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 35975bd8deadSopenharmony_ci 1 17 GLX opcode (X_GLXVendorPrivateWithReply) 35985bd8deadSopenharmony_ci 2 4 request length 35995bd8deadSopenharmony_ci 4 1422 vendor specific opcode 36005bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 36015bd8deadSopenharmony_ci 4 CARD32 renderbuffer 36025bd8deadSopenharmony_ci => 36035bd8deadSopenharmony_ci 1 1 reply 36045bd8deadSopenharmony_ci 1 unused 36055bd8deadSopenharmony_ci 2 CARD16 sequence number 36065bd8deadSopenharmony_ci 4 0 reply length 36075bd8deadSopenharmony_ci 4 BOOL32 return value 36085bd8deadSopenharmony_ci 20 unused 36095bd8deadSopenharmony_ci 36105bd8deadSopenharmony_ci GenRenderbuffers 36115bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 36125bd8deadSopenharmony_ci 1 17 GLX opcode (X_GLXVendorPrivateWithReply) 36135bd8deadSopenharmony_ci 2 4 request length 36145bd8deadSopenharmony_ci 4 1423 vendor specific opcode 36155bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 36165bd8deadSopenharmony_ci 4 CARD32 n 36175bd8deadSopenharmony_ci => 36185bd8deadSopenharmony_ci 1 1 reply 36195bd8deadSopenharmony_ci 1 unused 36205bd8deadSopenharmony_ci 2 CARD16 sequence number 36215bd8deadSopenharmony_ci 4 m reply length 36225bd8deadSopenharmony_ci 4 unused 36235bd8deadSopenharmony_ci 4 CARD32 n 36245bd8deadSopenharmony_ci 16 unused 36255bd8deadSopenharmony_ci n*4 LISTofCARD32 renderbuffers 36265bd8deadSopenharmony_ci 36275bd8deadSopenharmony_ci GetRenderbufferParameteriv 36285bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 36295bd8deadSopenharmony_ci 1 17 GLX opcode (X_GLXVendorPrivateWithReply) 36305bd8deadSopenharmony_ci 2 5 request length 36315bd8deadSopenharmony_ci 4 1424 vendor specific opcode 36325bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 36335bd8deadSopenharmony_ci 4 ENUM target 36345bd8deadSopenharmony_ci 4 ENUM pname 36355bd8deadSopenharmony_ci => 36365bd8deadSopenharmony_ci 1 1 reply 36375bd8deadSopenharmony_ci 1 unused 36385bd8deadSopenharmony_ci 2 CARD16 sequence number 36395bd8deadSopenharmony_ci 4 m reply length, m = (n == 1 ? 0 : n) 36405bd8deadSopenharmony_ci 4 unused 36415bd8deadSopenharmony_ci 4 CARD32 n 36425bd8deadSopenharmony_ci 36435bd8deadSopenharmony_ci if (n = 1) this follows: 36445bd8deadSopenharmony_ci 36455bd8deadSopenharmony_ci 4 CARD32 params 36465bd8deadSopenharmony_ci 12 unused 36475bd8deadSopenharmony_ci 36485bd8deadSopenharmony_ci otherwise this follows: 36495bd8deadSopenharmony_ci 36505bd8deadSopenharmony_ci 16 unused 36515bd8deadSopenharmony_ci n*4 LISTofCARD32 params 36525bd8deadSopenharmony_ci 36535bd8deadSopenharmony_ci IsFramebuffer 36545bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 36555bd8deadSopenharmony_ci 1 17 GLX opcode (X_GLXVendorPrivateWithReply) 36565bd8deadSopenharmony_ci 2 4 request length 36575bd8deadSopenharmony_ci 4 1425 vendor specific opcode 36585bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 36595bd8deadSopenharmony_ci 4 CARD32 framebuffer 36605bd8deadSopenharmony_ci => 36615bd8deadSopenharmony_ci 1 1 reply 36625bd8deadSopenharmony_ci 1 unused 36635bd8deadSopenharmony_ci 2 CARD16 sequence number 36645bd8deadSopenharmony_ci 4 0 reply length 36655bd8deadSopenharmony_ci 4 BOOL32 return value 36665bd8deadSopenharmony_ci 20 unused 36675bd8deadSopenharmony_ci 36685bd8deadSopenharmony_ci GenFramebuffers 36695bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 36705bd8deadSopenharmony_ci 1 17 GLX opcode (X_GLXVendorPrivateWithReply) 36715bd8deadSopenharmony_ci 2 4 request length 36725bd8deadSopenharmony_ci 4 1426 vendor specific opcode 36735bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 36745bd8deadSopenharmony_ci 4 CARD32 n 36755bd8deadSopenharmony_ci => 36765bd8deadSopenharmony_ci 1 1 reply 36775bd8deadSopenharmony_ci 1 unused 36785bd8deadSopenharmony_ci 2 CARD16 sequence number 36795bd8deadSopenharmony_ci 4 n reply length 36805bd8deadSopenharmony_ci 4 unused 36815bd8deadSopenharmony_ci 4 CARD32 n 36825bd8deadSopenharmony_ci 16 unused 36835bd8deadSopenharmony_ci n*4 LISTofCARD32 framebuffers 36845bd8deadSopenharmony_ci 36855bd8deadSopenharmony_ci CheckFramebufferStatus 36865bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 36875bd8deadSopenharmony_ci 1 17 GLX opcode (X_GLXVendorPrivateWithReply) 36885bd8deadSopenharmony_ci 2 4 request length 36895bd8deadSopenharmony_ci 4 1427 vendor specific opcode 36905bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 36915bd8deadSopenharmony_ci 4 ENUM target 36925bd8deadSopenharmony_ci => 36935bd8deadSopenharmony_ci 1 1 reply 36945bd8deadSopenharmony_ci 1 unused 36955bd8deadSopenharmony_ci 2 CARD16 sequence number 36965bd8deadSopenharmony_ci 4 0 reply length 36975bd8deadSopenharmony_ci 4 ENUM return value 36985bd8deadSopenharmony_ci 20 unused 36995bd8deadSopenharmony_ci 37005bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv 37015bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 37025bd8deadSopenharmony_ci 1 17 GLX opcode (X_GLXVendorPrivateWithReply) 37035bd8deadSopenharmony_ci 2 6 request length 37045bd8deadSopenharmony_ci 4 1428 vendor specific opcode 37055bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 37065bd8deadSopenharmony_ci 4 ENUM target 37075bd8deadSopenharmony_ci 4 ENUM attachment 37085bd8deadSopenharmony_ci 4 ENUM pname 37095bd8deadSopenharmony_ci => 37105bd8deadSopenharmony_ci 1 1 reply 37115bd8deadSopenharmony_ci 1 unused 37125bd8deadSopenharmony_ci 2 CARD16 sequence number 37135bd8deadSopenharmony_ci 4 m reply length, m = (n == 1 ? 0 : n) 37145bd8deadSopenharmony_ci 4 unused 37155bd8deadSopenharmony_ci 4 CARD32 n 37165bd8deadSopenharmony_ci 37175bd8deadSopenharmony_ci if (n = 1) this follows: 37185bd8deadSopenharmony_ci 37195bd8deadSopenharmony_ci 4 CARD32 params 37205bd8deadSopenharmony_ci 12 unused 37215bd8deadSopenharmony_ci 37225bd8deadSopenharmony_ci otherwise this follows: 37235bd8deadSopenharmony_ci 37245bd8deadSopenharmony_ci 16 unused 37255bd8deadSopenharmony_ci n*4 LISTofCARD32 params 37265bd8deadSopenharmony_ci 37275bd8deadSopenharmony_ci 37285bd8deadSopenharmony_ciUsage Examples 37295bd8deadSopenharmony_ci 37305bd8deadSopenharmony_ci The following examples use a helper macro for 37315bd8deadSopenharmony_ci CHECK_FRAMEBUFFER_STATUS, defined below. 37325bd8deadSopenharmony_ci 37335bd8deadSopenharmony_ci Example (6) gives a (very slightly) more robust example of handling 37345bd8deadSopenharmony_ci the possible return values for glCheckFramebufferStatus. 37355bd8deadSopenharmony_ci 37365bd8deadSopenharmony_ci #define CHECK_FRAMEBUFFER_STATUS() \ 37375bd8deadSopenharmony_ci { \ 37385bd8deadSopenharmony_ci GLenum status; \ 37395bd8deadSopenharmony_ci status = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); \ 37405bd8deadSopenharmony_ci switch(status) { \ 37415bd8deadSopenharmony_ci case GL_FRAMEBUFFER_COMPLETE: \ 37425bd8deadSopenharmony_ci break; \ 37435bd8deadSopenharmony_ci case GL_FRAMEBUFFER_UNSUPPORTED: \ 37445bd8deadSopenharmony_ci /* choose different formats */ \ 37455bd8deadSopenharmony_ci break; \ 37465bd8deadSopenharmony_ci default: \ 37475bd8deadSopenharmony_ci /* programming error; will fail on all hardware */ \ 37485bd8deadSopenharmony_ci assert(0); \ 37495bd8deadSopenharmony_ci } 37505bd8deadSopenharmony_ci } 37515bd8deadSopenharmony_ci 37525bd8deadSopenharmony_ci (1) Render to 2D texture with a depth buffer 37535bd8deadSopenharmony_ci 37545bd8deadSopenharmony_ci // Given: color_tex - TEXTURE_2D color texture object 37555bd8deadSopenharmony_ci // depth_rb - GL_DEPTH renderbuffer object 37565bd8deadSopenharmony_ci // fb - framebuffer object 37575bd8deadSopenharmony_ci 37585bd8deadSopenharmony_ci // Enable render-to-texture 37595bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb); 37605bd8deadSopenharmony_ci 37615bd8deadSopenharmony_ci // Set up color_tex and depth_rb for render-to-texture 37625bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 37635bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT0, 37645bd8deadSopenharmony_ci GL_TEXTURE_2D, color_tex, 0); 37655bd8deadSopenharmony_ci glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, 37665bd8deadSopenharmony_ci GL_DEPTH_ATTACHMENT, 37675bd8deadSopenharmony_ci GL_RENDERBUFFER, depth_rb); 37685bd8deadSopenharmony_ci 37695bd8deadSopenharmony_ci // Check framebuffer completeness at the end of initialization. 37705bd8deadSopenharmony_ci CHECK_FRAMEBUFFER_STATUS(); 37715bd8deadSopenharmony_ci 37725bd8deadSopenharmony_ci <draw to the texture and renderbuffer> 37735bd8deadSopenharmony_ci 37745bd8deadSopenharmony_ci // Re-enable rendering to the window 37755bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); 37765bd8deadSopenharmony_ci 37775bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, color_tex); 37785bd8deadSopenharmony_ci <draw to the window, reading from the color_tex> 37795bd8deadSopenharmony_ci 37805bd8deadSopenharmony_ci 37815bd8deadSopenharmony_ci (2) Application that supports both RBBCTT (render back buffer, copy to 37825bd8deadSopenharmony_ci texture) and RTT (render to texture). The migration path from RBBCTT 37835bd8deadSopenharmony_ci to RTT is easy. 37845bd8deadSopenharmony_ci 37855bd8deadSopenharmony_ci if (useFramebuffer) { 37865bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb); 37875bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 37885bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT0, 37895bd8deadSopenharmony_ci GL_TEXTURE_2D, color_tex, 0); 37905bd8deadSopenharmony_ci CHECK_FRAMEBUFFER_STATUS(); 37915bd8deadSopenharmony_ci } 37925bd8deadSopenharmony_ci 37935bd8deadSopenharmony_ci draw_to_texture(); 37945bd8deadSopenharmony_ci 37955bd8deadSopenharmony_ci glBindTexture (GL_TEXTURE_2D, color_tex); 37965bd8deadSopenharmony_ci if (useFramebuffer) { 37975bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); 37985bd8deadSopenharmony_ci } else { // copy tex path 37995bd8deadSopenharmony_ci glCopyTexSubImage(...); 38005bd8deadSopenharmony_ci } 38015bd8deadSopenharmony_ci 38025bd8deadSopenharmony_ci 38035bd8deadSopenharmony_ci (3) Simple render-to-texture loop with initialization. Create an 38045bd8deadSopenharmony_ci RGB8 texture, a 24-bit depth renderbuffer, and a stencil 38055bd8deadSopenharmony_ci renderbuffer. In a loop, alternate between rendering to, and 38065bd8deadSopenharmony_ci texturing out of, the color texture. 38075bd8deadSopenharmony_ci 38085bd8deadSopenharmony_ci glGenFramebuffers(1, &fb); 38095bd8deadSopenharmony_ci glGenTextures(1, &color_tex); 38105bd8deadSopenharmony_ci glGenRenderbuffers(1, &depth_rb); 38115bd8deadSopenharmony_ci glGenRenderbuffers(1, &stencil_rb); 38125bd8deadSopenharmony_ci 38135bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb); 38145bd8deadSopenharmony_ci 38155bd8deadSopenharmony_ci // initialize color texture 38165bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, color_tex); 38175bd8deadSopenharmony_ci glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 38185bd8deadSopenharmony_ci glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 512, 512, 0, 38195bd8deadSopenharmony_ci GL_RGB, GL_INT, NULL); 38205bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 38215bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT0, 38225bd8deadSopenharmony_ci GL_TEXTURE_2D, color_tex, 0); 38235bd8deadSopenharmony_ci 38245bd8deadSopenharmony_ci // initialize depth renderbuffer 38255bd8deadSopenharmony_ci glBindRenderbuffer(GL_RENDERBUFFER, depth_rb); 38265bd8deadSopenharmony_ci glRenderbufferStorage(GL_RENDERBUFFER, 38275bd8deadSopenharmony_ci GL_DEPTH_COMPONENT24, 512, 512); 38285bd8deadSopenharmony_ci glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, 38295bd8deadSopenharmony_ci GL_DEPTH_ATTACHMENT, 38305bd8deadSopenharmony_ci GL_RENDERBUFFER, depth_rb); 38315bd8deadSopenharmony_ci 38325bd8deadSopenharmony_ci // initialize stencil renderbuffer 38335bd8deadSopenharmony_ci glBindRenderbuffer(GL_RENDERBUFFER, stencil_rb); 38345bd8deadSopenharmony_ci glRenderbufferStorage(GL_RENDERBUFFER, 38355bd8deadSopenharmony_ci GL_STENCIL_INDEX, 512, 512); 38365bd8deadSopenharmony_ci glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, 38375bd8deadSopenharmony_ci GL_STENCIL_ATTACHMENT, 38385bd8deadSopenharmony_ci GL_RENDERBUFFER, stencil_rb); 38395bd8deadSopenharmony_ci 38405bd8deadSopenharmony_ci // Check framebuffer completeness at the end of initialization. 38415bd8deadSopenharmony_ci CHECK_FRAMEBUFFER_STATUS(); 38425bd8deadSopenharmony_ci 38435bd8deadSopenharmony_ci loop { 38445bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, 0); 38455bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb); 38465bd8deadSopenharmony_ci 38475bd8deadSopenharmony_ci <draw to the texture> 38485bd8deadSopenharmony_ci 38495bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); 38505bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, color_tex); 38515bd8deadSopenharmony_ci 38525bd8deadSopenharmony_ci <draw to the window, reading from the color texture> 38535bd8deadSopenharmony_ci } 38545bd8deadSopenharmony_ci 38555bd8deadSopenharmony_ci 38565bd8deadSopenharmony_ci (4) Render-to-texture loop with automatic mipmap generation. There 38575bd8deadSopenharmony_ci are N framebuffers, N mipmap color textures, and a single shared 38585bd8deadSopenharmony_ci depth renderbuffer. The depth renderbuffer is not a mipmap. 38595bd8deadSopenharmony_ci 38605bd8deadSopenharmony_ci GLuint fb_array[N]; 38615bd8deadSopenharmony_ci GLuint color_tex_array[N]; 38625bd8deadSopenharmony_ci GLuint depth_rb; 38635bd8deadSopenharmony_ci 38645bd8deadSopenharmony_ci glGenFramebuffers(N, fb_array); 38655bd8deadSopenharmony_ci glGenTextures(N, color_tex_array); 38665bd8deadSopenharmony_ci glGenRenderbuffers(1, &depth_rb); 38675bd8deadSopenharmony_ci 38685bd8deadSopenharmony_ci // initialize color textures 38695bd8deadSopenharmony_ci for (int i=0; i<N; i++) { 38705bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, color_tex_array[N]); 38715bd8deadSopenharmony_ci glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 512, 512, 0, 38725bd8deadSopenharmony_ci GL_RGB, GL_INT, NULL); 38735bd8deadSopenharmony_ci 38745bd8deadSopenharmony_ci // establish a mipmap chain for the texture 38755bd8deadSopenharmony_ci glGenerateMipmap(GL_TEXTURE_2D); 38765bd8deadSopenharmony_ci } 38775bd8deadSopenharmony_ci 38785bd8deadSopenharmony_ci // initialize depth renderbuffer 38795bd8deadSopenharmony_ci glBindRenderbuffer(GL_RENDERBUFFER, depth_rb); 38805bd8deadSopenharmony_ci glRenderbufferStorage(GL_RENDERBUFFER, 38815bd8deadSopenharmony_ci GL_DEPTH_COMPONENT24, 512, 512); 38825bd8deadSopenharmony_ci 38835bd8deadSopenharmony_ci // setup framebuffers, sharing depth 38845bd8deadSopenharmony_ci for (int i=0; i<N; i++) { 38855bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb_array[i]); 38865bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 38875bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT0, 38885bd8deadSopenharmony_ci GL_TEXTURE_2D, color_tex_array[i], 0); 38895bd8deadSopenharmony_ci glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, 38905bd8deadSopenharmony_ci GL_DEPTH_ATTACHMENT, 38915bd8deadSopenharmony_ci GL_RENDERBUFFER, depth_rb); 38925bd8deadSopenharmony_ci } 38935bd8deadSopenharmony_ci 38945bd8deadSopenharmony_ci // Check framebuffer completeness at the end of initialization. 38955bd8deadSopenharmony_ci CHECK_FRAMEBUFFER_STATUS(); 38965bd8deadSopenharmony_ci 38975bd8deadSopenharmony_ci loop { 38985bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, 0); 38995bd8deadSopenharmony_ci 39005bd8deadSopenharmony_ci for (int i=0; i<N; i++) { 39015bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb_array[i]); 39025bd8deadSopenharmony_ci <draw to texture i> 39035bd8deadSopenharmony_ci } 39045bd8deadSopenharmony_ci 39055bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); 39065bd8deadSopenharmony_ci 39075bd8deadSopenharmony_ci // automatically generate mipmaps 39085bd8deadSopenharmony_ci for (int i=0; i<N; i++) { 39095bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, color_tex_array[i]); 39105bd8deadSopenharmony_ci glGenerateMipmap(GL_TEXTURE_2D); 39115bd8deadSopenharmony_ci } 39125bd8deadSopenharmony_ci 39135bd8deadSopenharmony_ci <draw to the window, reading from the color textures> 39145bd8deadSopenharmony_ci } 39155bd8deadSopenharmony_ci 39165bd8deadSopenharmony_ci 39175bd8deadSopenharmony_ci (5) Render-to-texture loop with custom mipmap generation. 39185bd8deadSopenharmony_ci The depth renderbuffer is not a mipmap. 39195bd8deadSopenharmony_ci 39205bd8deadSopenharmony_ci glGenFramebuffers(1, &fb); 39215bd8deadSopenharmony_ci glGenTextures(1, &color_tex); 39225bd8deadSopenharmony_ci glGenRenderbuffers(1, &depth_rb); 39235bd8deadSopenharmony_ci 39245bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb); 39255bd8deadSopenharmony_ci 39265bd8deadSopenharmony_ci // initialize color texture and establish mipmap chain 39275bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, color_tex); 39285bd8deadSopenharmony_ci glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 512, 512, 0, 39295bd8deadSopenharmony_ci GL_RGB, GL_INT, NULL); 39305bd8deadSopenharmony_ci glGenerateMipmap(GL_TEXTURE_2D); 39315bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 39325bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT0, 39335bd8deadSopenharmony_ci GL_TEXTURE_2D, color_tex, 0); 39345bd8deadSopenharmony_ci 39355bd8deadSopenharmony_ci // initialize depth renderbuffer 39365bd8deadSopenharmony_ci glBindRenderbuffer(GL_RENDERBUFFER, depth_rb); 39375bd8deadSopenharmony_ci glRenderbufferStorage(GL_RENDERBUFFER, 39385bd8deadSopenharmony_ci GL_DEPTH_COMPONENT24, 512, 512); 39395bd8deadSopenharmony_ci glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, 39405bd8deadSopenharmony_ci GL_DEPTH_ATTACHMENT, 39415bd8deadSopenharmony_ci GL_RENDERBUFFER, depth_rb); 39425bd8deadSopenharmony_ci 39435bd8deadSopenharmony_ci // Check framebuffer completeness at the end of initialization. 39445bd8deadSopenharmony_ci CHECK_FRAMEBUFFER_STATUS(); 39455bd8deadSopenharmony_ci 39465bd8deadSopenharmony_ci loop { 39475bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, 0); 39485bd8deadSopenharmony_ci 39495bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb); 39505bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 39515bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT0, 39525bd8deadSopenharmony_ci GL_TEXTURE_2D, color_tex, 0); 39535bd8deadSopenharmony_ci glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, 39545bd8deadSopenharmony_ci GL_DEPTH_ATTACHMENT, 39555bd8deadSopenharmony_ci GL_RENDERBUFFER, depth_rb); 39565bd8deadSopenharmony_ci 39575bd8deadSopenharmony_ci <draw to the base level of the color texture> 39585bd8deadSopenharmony_ci 39595bd8deadSopenharmony_ci // custom-generate successive mipmap levels 39605bd8deadSopenharmony_ci glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, 39615bd8deadSopenharmony_ci GL_DEPTH_ATTACHMENT, 39625bd8deadSopenharmony_ci GL_RENDERBUFFER, 0); 39635bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, color_tex); 39645bd8deadSopenharmony_ci foreach (level > 0, in order of increasing values of level) { 39655bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 39665bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT0, 39675bd8deadSopenharmony_ci GL_TEXTURE_2D, color_tex, level); 39685bd8deadSopenharmony_ci glTexParameteri(TEXTURE_2D, TEXTURE_BASE_LEVEL, level-1); 39695bd8deadSopenharmony_ci glTexParameteri(TEXTURE_2D, TEXTURE_MAX_LEVEL, level-1); 39705bd8deadSopenharmony_ci 39715bd8deadSopenharmony_ci <draw to level> 39725bd8deadSopenharmony_ci } 39735bd8deadSopenharmony_ci glTexParameteri(TEXTURE_2D, TEXTURE_BASE_LEVEL, 0); 39745bd8deadSopenharmony_ci glTexParameteri(TEXTURE_2D, TEXTURE_MAX_LEVEL, max); 39755bd8deadSopenharmony_ci 39765bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); 39775bd8deadSopenharmony_ci <draw to the window, reading from the color texture> 39785bd8deadSopenharmony_ci } 39795bd8deadSopenharmony_ci 39805bd8deadSopenharmony_ci 39815bd8deadSopenharmony_ci (6) Pseudo-code example of one method of responding to 39825bd8deadSopenharmony_ci FRAMEBUFFER_UNSUPPORTED 39835bd8deadSopenharmony_ci 39845bd8deadSopenharmony_ci bool done = false; 39855bd8deadSopenharmony_ci bool success = false; 39865bd8deadSopenharmony_ci int configurationNumber = 0; 39875bd8deadSopenharmony_ci GLenum status; 39885bd8deadSopenharmony_ci 39895bd8deadSopenharmony_ci while (!done) 39905bd8deadSopenharmony_ci { 39915bd8deadSopenharmony_ci for (each framebuffer-attachable image) 39925bd8deadSopenharmony_ci { 39935bd8deadSopenharmony_ci ChooseInternalFormatForFramebufferAttachableImage(configurationNumber); 39945bd8deadSopenharmony_ci 39955bd8deadSopenharmony_ci CreateFramebufferAttachableImage(); 39965bd8deadSopenharmony_ci 39975bd8deadSopenharmony_ci AttachFramebufferAttachableImageToFramebuffer(); 39985bd8deadSopenharmony_ci } 39995bd8deadSopenharmony_ci 40005bd8deadSopenharmony_ci status = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); 40015bd8deadSopenharmony_ci switch(status) 40025bd8deadSopenharmony_ci { 40035bd8deadSopenharmony_ci case GL_FRAMEBUFFER_COMPLETE: 40045bd8deadSopenharmony_ci success = true; 40055bd8deadSopenharmony_ci done = true; 40065bd8deadSopenharmony_ci break; 40075bd8deadSopenharmony_ci 40085bd8deadSopenharmony_ci case GL_FRAMEBUFFER_UNSUPPORTED: 40095bd8deadSopenharmony_ci if (configCount < MAX_NUM_CONFIGS_I_WANT_TO_TRY) 40105bd8deadSopenharmony_ci { 40115bd8deadSopenharmony_ci printf("current config not supported, trying again); 40125bd8deadSopenharmony_ci configurationNumber++; 40135bd8deadSopenharmony_ci } 40145bd8deadSopenharmony_ci else 40155bd8deadSopenharmony_ci { 40165bd8deadSopenharmony_ci printf("couldn't find a supported config\n"); 40175bd8deadSopenharmony_ci success = false; 40185bd8deadSopenharmony_ci done = true; 40195bd8deadSopenharmony_ci } 40205bd8deadSopenharmony_ci break; 40215bd8deadSopenharmony_ci 40225bd8deadSopenharmony_ci default: 40235bd8deadSopenharmony_ci // programming error; will fail on all hardware 40245bd8deadSopenharmony_ci FatalError(); 40255bd8deadSopenharmony_ci exit(1); 40265bd8deadSopenharmony_ci } 40275bd8deadSopenharmony_ci } 40285bd8deadSopenharmony_ci 40295bd8deadSopenharmony_ci if (!success) 40305bd8deadSopenharmony_ci { 40315bd8deadSopenharmony_ci printf("couldn't find a supported config\n"); 40325bd8deadSopenharmony_ci FatalError(); 40335bd8deadSopenharmony_ci exit(1); 40345bd8deadSopenharmony_ci } 40355bd8deadSopenharmony_ci 40365bd8deadSopenharmony_ci // Current framebuffer is supported and complete!! 40375bd8deadSopenharmony_ci Draw(); 40385bd8deadSopenharmony_ci 40395bd8deadSopenharmony_ci 40405bd8deadSopenharmony_ci (7) Render to depth texture with no color attachments 40415bd8deadSopenharmony_ci 40425bd8deadSopenharmony_ci // Given: depth_tex - TEXTURE_2D depth texture object 40435bd8deadSopenharmony_ci // fb - framebuffer object 40445bd8deadSopenharmony_ci 40455bd8deadSopenharmony_ci // Enable render-to-texture 40465bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb); 40475bd8deadSopenharmony_ci 40485bd8deadSopenharmony_ci // Set up depth_tex for render-to-texture 40495bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 40505bd8deadSopenharmony_ci GL_DEPTH_ATTACHMENT, 40515bd8deadSopenharmony_ci GL_TEXTURE_2D, depth_tex, 0); 40525bd8deadSopenharmony_ci 40535bd8deadSopenharmony_ci // No color buffer to draw to or read from 40545bd8deadSopenharmony_ci glDrawBuffer(GL_NONE); 40555bd8deadSopenharmony_ci glReadBuffer(GL_NONE); 40565bd8deadSopenharmony_ci 40575bd8deadSopenharmony_ci // Check framebuffer completeness at the end of initialization. 40585bd8deadSopenharmony_ci CHECK_FRAMEBUFFER_STATUS(); 40595bd8deadSopenharmony_ci 40605bd8deadSopenharmony_ci <draw something> 40615bd8deadSopenharmony_ci 40625bd8deadSopenharmony_ci // Re-enable rendering to the window 40635bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); 40645bd8deadSopenharmony_ci 40655bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, depth_tex); 40665bd8deadSopenharmony_ci <draw to the window, reading from the depth_tex> 40675bd8deadSopenharmony_ci 40685bd8deadSopenharmony_ci (8) FBO and ARB_draw_buffers 40695bd8deadSopenharmony_ci 40705bd8deadSopenharmony_ci // Given: color_texA - TEXTURE_2D color texture object 40715bd8deadSopenharmony_ci // Given: color_texB - TEXTURE_2D color texture object 40725bd8deadSopenharmony_ci // depth_rb - GL_DEPTH renderbuffer object 40735bd8deadSopenharmony_ci // fb - framebuffer object 40745bd8deadSopenharmony_ci 40755bd8deadSopenharmony_ci // Set up the framebuffer object 40765bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb); 40775bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 40785bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT0, 40795bd8deadSopenharmony_ci GL_TEXTURE_2D, color_texA, 0); 40805bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 40815bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT1, 40825bd8deadSopenharmony_ci GL_TEXTURE_2D, color_texB, 0); 40835bd8deadSopenharmony_ci glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, 40845bd8deadSopenharmony_ci GL_DEPTH_ATTACHMENT, 40855bd8deadSopenharmony_ci GL_RENDERBUFFER, depth_rb); 40865bd8deadSopenharmony_ci 40875bd8deadSopenharmony_ci // Enable both attachments as draw buffers 40885bd8deadSopenharmony_ci GLenum drawbuffers = {GL_COLOR_ATTACHMENT0, 40895bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT1}; 40905bd8deadSopenharmony_ci glDrawBuffers(2, drawbuffers); 40915bd8deadSopenharmony_ci 40925bd8deadSopenharmony_ci // Check framebuffer completeness at the end of initialization. 40935bd8deadSopenharmony_ci CHECK_FRAMEBUFFER_STATUS(); 40945bd8deadSopenharmony_ci 40955bd8deadSopenharmony_ci // Enable fragment program that writes to both gl_FragData[0] 40965bd8deadSopenharmony_ci // and gl_FragData[1] 40975bd8deadSopenharmony_ci 40985bd8deadSopenharmony_ci <draw something> 40995bd8deadSopenharmony_ci 41005bd8deadSopenharmony_ci // Disable fragment program 41015bd8deadSopenharmony_ci 41025bd8deadSopenharmony_ci // Re-enable rendering to the window 41035bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); 41045bd8deadSopenharmony_ci 41055bd8deadSopenharmony_ci // Bind both textures, each to a different texture unit 41065bd8deadSopenharmony_ci glActiveTexture(GL_TEXTURE0); 41075bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, color_texA); 41085bd8deadSopenharmony_ci glActiveTexture(GL_TEXTURE1); 41095bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, color_texB); 41105bd8deadSopenharmony_ci 41115bd8deadSopenharmony_ci <draw to the window> 41125bd8deadSopenharmony_ci 41135bd8deadSopenharmony_ciSample Code (from framebuffer_blit) 41145bd8deadSopenharmony_ci 41155bd8deadSopenharmony_ci /* Render to framebuffer object 2 */ 41165bd8deadSopenharmony_ci glBindFramebuffer(DRAW_FRAMEBUFFER, 2); 41175bd8deadSopenharmony_ci RenderScene(); 41185bd8deadSopenharmony_ci 41195bd8deadSopenharmony_ci /* Blit contents of color buffer, depth buffer and stencil buffer 41205bd8deadSopenharmony_ci * from framebuffer object 2 to framebuffer object 1. 41215bd8deadSopenharmony_ci */ 41225bd8deadSopenharmony_ci glBindFramebuffer(GL_READ_FRAMEBUFFER, 2); 41235bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 1); 41245bd8deadSopenharmony_ci glBlitFramebuffer(0, 0, 640, 480, 41255bd8deadSopenharmony_ci 0, 0, 640, 480, 41265bd8deadSopenharmony_ci GL_COLOR_BUFFER_BIT | 41275bd8deadSopenharmony_ci GL_DEPTH_BUFFER_BIT | 41285bd8deadSopenharmony_ci GL_STENCIL_BUFFER_BIT, 41295bd8deadSopenharmony_ci GL_NEAREST); 41305bd8deadSopenharmony_ci 41315bd8deadSopenharmony_ci /* Blit contents of color buffer from framebuffer object 1 to 41325bd8deadSopenharmony_ci * framebuffer object 2, inverting the image in the X direction. 41335bd8deadSopenharmony_ci */ 41345bd8deadSopenharmony_ci glBindFramebuffer(GL_READ_FRAMEBUFFER, 1); 41355bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 2); 41365bd8deadSopenharmony_ci glBlitFramebuffer(0, 0, 640, 480, 41375bd8deadSopenharmony_ci 640, 0, 0, 480, 41385bd8deadSopenharmony_ci GL_COLOR_BUFFER_BIT, 41395bd8deadSopenharmony_ci GL_NEAREST); 41405bd8deadSopenharmony_ci 41415bd8deadSopenharmony_ci /* Blit color buffer from framebuffer object 1 to framebuffer 41425bd8deadSopenharmony_ci * object 3 with a 2X zoom and linear filtering. 41435bd8deadSopenharmony_ci */ 41445bd8deadSopenharmony_ci glBindFramebuffer(GL_READ_FRAMEBUFFER, 1); 41455bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 3); 41465bd8deadSopenharmony_ci glBlitFramebuffer(0, 0, 640, 480, 41475bd8deadSopenharmony_ci 0, 0, 1280, 960, 41485bd8deadSopenharmony_ci GL_COLOR_BUFFER_BIT, GL_LINEAR); 41495bd8deadSopenharmony_ci 41505bd8deadSopenharmony_ciUsage Examples (from packed_depth_stencil) 41515bd8deadSopenharmony_ci 41525bd8deadSopenharmony_ci (1) Attach a DEPTH_STENCIL texture image to an FBO as both the 41535bd8deadSopenharmony_ci depth and stencil buffers. 41545bd8deadSopenharmony_ci 41555bd8deadSopenharmony_ci glGenFramebuffers(1, &fb); 41565bd8deadSopenharmony_ci glGenTextures(1, &tex_color); 41575bd8deadSopenharmony_ci glGenTextures(1, &tex_depthstencil); 41585bd8deadSopenharmony_ci 41595bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb); 41605bd8deadSopenharmony_ci 41615bd8deadSopenharmony_ci // Setup color texture (mipmap) 41625bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, tex_color); 41635bd8deadSopenharmony_ci glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 41645bd8deadSopenharmony_ci 512, 512, 0, GL_RGBA, GL_INT, NULL); 41655bd8deadSopenharmony_ci glGenerateMipmap(GL_TEXTURE_2D); 41665bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 41675bd8deadSopenharmony_ci GL_COLOR_ATTACHMENT0, 41685bd8deadSopenharmony_ci GL_TEXTURE_2D, tex_color, 0); 41695bd8deadSopenharmony_ci 41705bd8deadSopenharmony_ci // Setup depth_stencil texture (not mipmap) 41715bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, tex_depthstencil); 41725bd8deadSopenharmony_ci glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 41735bd8deadSopenharmony_ci glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, 41745bd8deadSopenharmony_ci 512, 512, 0, GL_DEPTH_STENCIL, 41755bd8deadSopenharmony_ci GL_UNSIGNED_INT_24_8, NULL); 41765bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 41775bd8deadSopenharmony_ci GL_DEPTH_ATTACHMENT, 41785bd8deadSopenharmony_ci GL_TEXTURE_2D, tex_depthstencil, 0); 41795bd8deadSopenharmony_ci glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, 41805bd8deadSopenharmony_ci GL_STENCIL_ATTACHMENT, 41815bd8deadSopenharmony_ci GL_TEXTURE_2D, tex_depthstencil, 0); 41825bd8deadSopenharmony_ci 41835bd8deadSopenharmony_ci // Check framebuffer completeness at the end of initialization. 41845bd8deadSopenharmony_ci 41855bd8deadSopenharmony_ci loop { 41865bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, 0); 41875bd8deadSopenharmony_ci glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb); 41885bd8deadSopenharmony_ci <render to color, depth, and stencil textures> 41895bd8deadSopenharmony_ci glBindFramebuffer(GL_FRAMEBUFFER, 0); 41905bd8deadSopenharmony_ci 41915bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, tex_color); 41925bd8deadSopenharmony_ci glGenerateMipmap(GL_TEXTURE_2D); 41935bd8deadSopenharmony_ci <draw to the window, reading from the color texture> 41945bd8deadSopenharmony_ci 41955bd8deadSopenharmony_ci glBindTexture(GL_TEXTURE_2D, tex_depthstencil); 41965bd8deadSopenharmony_ci <draw to the window, reading depth from the depthstencil texture> 41975bd8deadSopenharmony_ci } 41985bd8deadSopenharmony_ci 41995bd8deadSopenharmony_ci 42005bd8deadSopenharmony_ciIssues 42015bd8deadSopenharmony_ci 42025bd8deadSopenharmony_ci (1) What should this extension be named? 42035bd8deadSopenharmony_ci 42045bd8deadSopenharmony_ci RESOLVED. We will call this ARB_framebuffer_object. 42055bd8deadSopenharmony_ci 42065bd8deadSopenharmony_ci (2) What additional functionality does this extension include over 42075bd8deadSopenharmony_ci EXT_framebuffer_object? 42085bd8deadSopenharmony_ci 42095bd8deadSopenharmony_ci RESOLVED. 42105bd8deadSopenharmony_ci 42115bd8deadSopenharmony_ci Currently we incorporate the following layered extensions: 42125bd8deadSopenharmony_ci 42135bd8deadSopenharmony_ci * EXT_framebuffer_multisample 42145bd8deadSopenharmony_ci * EXT_framebuffer_blit 42155bd8deadSopenharmony_ci * EXT_packed_depth_stencil 42165bd8deadSopenharmony_ci 42175bd8deadSopenharmony_ci As well as the following features: 42185bd8deadSopenharmony_ci 42195bd8deadSopenharmony_ci * Permit attachments with different width and height (mixed 42205bd8deadSopenharmony_ci dimensions) 42215bd8deadSopenharmony_ci 42225bd8deadSopenharmony_ci * Permit color attachments with different formats (mixed 42235bd8deadSopenharmony_ci formats). 42245bd8deadSopenharmony_ci 42255bd8deadSopenharmony_ci * Render to 1 and 2 component R/RG formats that are provided 42265bd8deadSopenharmony_ci via the ARB_texture_rg extension. L/A/LA/I will be 42275bd8deadSopenharmony_ci left for a separate (trivial) extension. 42285bd8deadSopenharmony_ci 42295bd8deadSopenharmony_ci * Gen'ed names must be used for framebuffer objects and 42305bd8deadSopenharmony_ci renderbuffers. 42315bd8deadSopenharmony_ci 42325bd8deadSopenharmony_ci * Added FramebufferTextureLayer. 42335bd8deadSopenharmony_ci 42345bd8deadSopenharmony_ci Other features we have considered include: 42355bd8deadSopenharmony_ci 42365bd8deadSopenharmony_ci * Render to Vertex Attrib (RTVA) 42375bd8deadSopenharmony_ci 42385bd8deadSopenharmony_ci * Format compatibility API that can guarantee a set of textures 42395bd8deadSopenharmony_ci images have framebuffer-compatible formats. 42405bd8deadSopenharmony_ci 42415bd8deadSopenharmony_ci * Infolog or other means for communicating framebuffer 42425bd8deadSopenharmony_ci incompleteness information to the application for debugging 42435bd8deadSopenharmony_ci purposes. 42445bd8deadSopenharmony_ci 42455bd8deadSopenharmony_ci * A technique for page flipping framebuffer-attachable images. 42465bd8deadSopenharmony_ci 42475bd8deadSopenharmony_ci * Relaxing framebuffer completeness restrictions, possibly even 42485bd8deadSopenharmony_ci remove FRAMEBUFFER_UNSUPPORTED. Maybe go so far as to remove 42495bd8deadSopenharmony_ci CheckFramebufferStatus. 42505bd8deadSopenharmony_ci 42515bd8deadSopenharmony_ci Features we have rejected include: 42525bd8deadSopenharmony_ci 42535bd8deadSopenharmony_ci * GetRenderbufferImage (benefit/demand does not seem to 42545bd8deadSopenharmony_ci outweigh the additional complexity.) 42555bd8deadSopenharmony_ci 42565bd8deadSopenharmony_ci * READ_BUFFER == NONE for framebuffer zero. 42575bd8deadSopenharmony_ci 42585bd8deadSopenharmony_ci * Attach images from a window or from a pbuffer to an 42595bd8deadSopenharmony_ci application-created framebuffer object. 42605bd8deadSopenharmony_ci 42615bd8deadSopenharmony_ci (3) What are the other differences from EXT_framebuffer_object. 42625bd8deadSopenharmony_ci 42635bd8deadSopenharmony_ci * Framebuffer completeness only considers the attachments named 42645bd8deadSopenharmony_ci by DRAW_BUFFERi and READ_BUFFER. Any other attachments do 42655bd8deadSopenharmony_ci not affect framebuffer completeness. (In 42665bd8deadSopenharmony_ci EXT_framebuffer_object, all attachments affected framebuffer 42675bd8deadSopenharmony_ci completeness, independent of the DRAW_BUFFERi and READ_BUFFER 42685bd8deadSopenharmony_ci state.) 42695bd8deadSopenharmony_ci * Added new queries for the sizes of the bit planes for color, 42705bd8deadSopenharmony_ci depth and stencil attachments at a framebuffer attachment point. 42715bd8deadSopenharmony_ci * Added new queries for framebuffer attachment component type and 42725bd8deadSopenharmony_ci color encoding. 42735bd8deadSopenharmony_ci * Many other minor tweaks to synchronize with the GL3 framebuffer 42745bd8deadSopenharmony_ci objects. 42755bd8deadSopenharmony_ci * ARB FBOs are not shareable. 42765bd8deadSopenharmony_ci 42775bd8deadSopenharmony_ci (4) Do we need new enum values, or can we re-use the ones from the EXT 42785bd8deadSopenharmony_ci versions? 42795bd8deadSopenharmony_ci 42805bd8deadSopenharmony_ci RESOLVED. This extension is designed to be compatible with 42815bd8deadSopenharmony_ci EXT_framebuffer_object, and thus we can reuse the enumerants. There 42825bd8deadSopenharmony_ci are also a number of additional enumerants added in this extension. 42835bd8deadSopenharmony_ci 42845bd8deadSopenharmony_ci (5) What should a query of RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS. 42855bd8deadSopenharmony_ci return if the attached color-renderable images have different 42865bd8deadSopenharmony_ci formats? 42875bd8deadSopenharmony_ci 42885bd8deadSopenharmony_ci RESOLVED. The values of RED_BITS, GREEN_BIT, BLUE_BITS and 42895bd8deadSopenharmony_ci ALPHA_BITS are only defined if all color attachments of the draw 42905bd8deadSopenharmony_ci framebuffer have identical formats, in which case the color 42915bd8deadSopenharmony_ci component sizes of color attachment zero are return. This is 42925bd8deadSopenharmony_ci necessary for backwards compatibility with EXT_framebuffer_object. 42935bd8deadSopenharmony_ci The actual sizes of the color, depth, or stencil bit planes can be 42945bd8deadSopenharmony_ci obtained by querying an attachment point using 42955bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv using the new 42965bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_*_SIZE enumerants, or by querying the object 42975bd8deadSopenharmony_ci attached at that point. 42985bd8deadSopenharmony_ci 42995bd8deadSopenharmony_ci (6) What are the proper names for the 1 and 2 component fixed-point, 43005bd8deadSopenharmony_ci float, and pure integer texture formats? 43015bd8deadSopenharmony_ci 43025bd8deadSopenharmony_ci RESOLVED: as introduced in the 3.0 spec, using RED and RG base 43035bd8deadSopenharmony_ci internal format terminology. The new RED/RG formats have also been 43045bd8deadSopenharmony_ci spun out of 3.0 as the ARB_texture_rg extension. 43055bd8deadSopenharmony_ci 43065bd8deadSopenharmony_ci (7) This extension and EXT_framebuffer_object both have "bind 43075bd8deadSopenharmony_ci framebuffer" functions (BindFramebuffer and BindFramebufferEXT). Are 43085bd8deadSopenharmony_ci there any differences in functionality between the two functions? 43095bd8deadSopenharmony_ci 43105bd8deadSopenharmony_ci RESOLVED: Yes. Both extensions will create a new framebuffer object 43115bd8deadSopenharmony_ci if called with an unused name. However, BindFramebuffer defined in 43125bd8deadSopenharmony_ci this extension will generate an INVALID_OPERATION error if the name 43135bd8deadSopenharmony_ci provided has not been generated by GenFramebuffer. That error did 43145bd8deadSopenharmony_ci not exist in EXT_framebuffer_object, and this extension does not 43155bd8deadSopenharmony_ci modify the behavior of BindFramebufferEXT. This difference also 43165bd8deadSopenharmony_ci applies to BindRenderbuffer from this extension vs. 43175bd8deadSopenharmony_ci BindRenderbufferEXT from EXT_framebuffer_object. 43185bd8deadSopenharmony_ci 43195bd8deadSopenharmony_ci (8) Why don't the new tokens and entry points in this extension have 43205bd8deadSopenharmony_ci "ARB" suffixes like other ARB extensions? 43215bd8deadSopenharmony_ci 43225bd8deadSopenharmony_ci RESOLVED: Unlike most ARB extensions, this is a strict subset of 43235bd8deadSopenharmony_ci functionality already approved in OpenGL 3.0. This extension 43245bd8deadSopenharmony_ci exists only to support that functionality on older hardware that 43255bd8deadSopenharmony_ci cannot implement a full OpenGL 3.0 driver. Since there are no 43265bd8deadSopenharmony_ci possible behavior changes between the ARB extension and core 43275bd8deadSopenharmony_ci features, source code compatibility is improved by not using 43285bd8deadSopenharmony_ci suffixes on the extension. 43295bd8deadSopenharmony_ci 43305bd8deadSopenharmony_ci (9) Should color-renderable textures be limited to a subset of 43315bd8deadSopenharmony_ci color base internal formats? 43325bd8deadSopenharmony_ci 43335bd8deadSopenharmony_ci RESOLVED: No, all color base internal formats and 43345bd8deadSopenharmony_ci sized internal formats should be supported by FBO; the FBO 43355bd8deadSopenharmony_ci status can report what works and doesn't work. 43365bd8deadSopenharmony_ci 43375bd8deadSopenharmony_ci The glCheckFramebufferStatus provides a mechanism for FBOs to 43385bd8deadSopenharmony_ci report whether or not the FBO configuration is supported or 43395bd8deadSopenharmony_ci not (i.e. GL_FRAMEBUFFER_UNSUPPORTED). If implementations 43405bd8deadSopenharmony_ci have issues supporting certain color formats for rendering, 43415bd8deadSopenharmony_ci the existing FBO mechanism is sufficient to report their lack 43425bd8deadSopenharmony_ci of support. 43435bd8deadSopenharmony_ci 43445bd8deadSopenharmony_ci Prior to revision 29, the list of color-renderable base internal 43455bd8deadSopenharmony_ci formats did not include LUMINANCE, LUMINANCE_ALPHA, or INTENSITY 43465bd8deadSopenharmony_ci (and the EXT version of FBO did not list ALPHA either). 43475bd8deadSopenharmony_ci 43485bd8deadSopenharmony_ci This lead to inconsistent operation of FBO. For example, you 43495bd8deadSopenharmony_ci could use a glFramebufferTexture2D to attach a texture that 43505bd8deadSopenharmony_ci was LUMINANCE, LUMINANCE_ALPHA, or INTENSITY to an FBO and find 43515bd8deadSopenharmony_ci out via glCheckFramebufferStatus that this combination wasn't 43525bd8deadSopenharmony_ci considered color-renderable, but if an internal format for one of 43535bd8deadSopenharmony_ci these base internal formats was used with glRenderbufferStorage, 43545bd8deadSopenharmony_ci then an OpenGL error would be generated according to the 43555bd8deadSopenharmony_ci specification. Such inconsistencies are undesirable and 43565bd8deadSopenharmony_ci unnecessarily limit the render-to-texture functionality exposed by 43575bd8deadSopenharmony_ci some implementations when hardware capable of rendering to 43585bd8deadSopenharmony_ci LUMINANCE, LUMINANCE_ALPHA, and INTENSITY textures does exist. 43595bd8deadSopenharmony_ci 43605bd8deadSopenharmony_ci For this reason, revision 29 (specification version 1.1) adds 43615bd8deadSopenharmony_ci these previously missing based internal formats. Developers are 43625bd8deadSopenharmony_ci warned that some implementations (specification version 1.0) 43635bd8deadSopenharmony_ci will report OpenGL errors if glRenderbufferStorage is called for 43645bd8deadSopenharmony_ci LUMINANCE, INTENSITY, LUMINANCE_ALPHA formats (or even possibly 43655bd8deadSopenharmony_ci ALPHA in the case of the EXT version of FBO). 43665bd8deadSopenharmony_ci 43675bd8deadSopenharmony_ci Some thought was given to introducing a new, one-off extension 43685bd8deadSopenharmony_ci (instead of a version 1.1) to allow the LUMINANCE, INTENSITY, 43695bd8deadSopenharmony_ci LUMINANCE_ALPHA base internal formats and their respective 43705bd8deadSopenharmony_ci sized formats to be color-renderable (both otherwise introduce 43715bd8deadSopenharmony_ci no new API). Given the existence of a mechanism for determine 43725bd8deadSopenharmony_ci whether or not an FBO is supported, simply providing this version 43735bd8deadSopenharmony_ci 1.1 clarification was judged to be the most expedient approach. 43745bd8deadSopenharmony_ci This approach also provides consistency with other approved 43755bd8deadSopenharmony_ci ARB specifications such as ARB_framebuffer_sRGB which describes 43765bd8deadSopenharmony_ci (see its issue #9) that formats such as GL_SLUMINANCE8. 43775bd8deadSopenharmony_ci 43785bd8deadSopenharmony_ci (10) Can ARB framebuffer objects be shared between contexts? 43795bd8deadSopenharmony_ci ARB_framebuffer_object is supposed to be compatible with 43805bd8deadSopenharmony_ci EXT_framebuffer_object, but also a subset of OpenGL 3.0. 43815bd8deadSopenharmony_ci EXT_framebuffer_object (rev. 120) explicitly allows sharing in 43825bd8deadSopenharmony_ci issue 76, but the 3.0 spec explicitly disallows it in Appendix D. 43835bd8deadSopenharmony_ci 43845bd8deadSopenharmony_ci Resolved: No. ARB_framebuffer_object is intended to capture the 43855bd8deadSopenharmony_ci functionality that went into GL 3.0. Furthermore, given that the 43865bd8deadSopenharmony_ci entry points and tokens in this extension and the core are identical 43875bd8deadSopenharmony_ci there is no way that an implementation could differentiate FBOs 43885bd8deadSopenharmony_ci created with this extension from those created by core GL. 43895bd8deadSopenharmony_ci 43905bd8deadSopenharmony_ci ADDITIONAL COMMENTS: 43915bd8deadSopenharmony_ci 43925bd8deadSopenharmony_ci See the "Dependencies on EXT_framebuffer_object" section above for 43935bd8deadSopenharmony_ci the interaction behaviour between EXT and non-EXT FBO interfaces. 43945bd8deadSopenharmony_ci 43955bd8deadSopenharmony_ciRevision History 43965bd8deadSopenharmony_ci 43975bd8deadSopenharmony_ci #1, October 20, 2005: jjuliano 43985bd8deadSopenharmony_ci - branch from EXT_framebuffer_object 43995bd8deadSopenharmony_ci - Delete old issues and revision history 44005bd8deadSopenharmony_ci 44015bd8deadSopenharmony_ci #2, November 28, 2005: jjuliano 44025bd8deadSopenharmony_ci - Add issues 1 and 2. 44035bd8deadSopenharmony_ci - Describe RenderbufferStorage in terms of color/depth/stencil 44045bd8deadSopenharmony_ci renderable with forward reference to 4.4.4. 44055bd8deadSopenharmony_ci - Reword the definitions of color/depth/stencil renderable. 44065bd8deadSopenharmony_ci - Explicitly state how framebuffer operations write to and read 44075bd8deadSopenharmony_ci from texture images. 44085bd8deadSopenharmony_ci - Incorporate feedback from Barthold. 44095bd8deadSopenharmony_ci 44105bd8deadSopenharmony_ci #3-draft2, January 16, 2006: jjuliano 44115bd8deadSopenharmony_ci - Define the conversions to/from framebuffer in terms of the 44125bd8deadSopenharmony_ci internal format(s) of the attached image(s). 44135bd8deadSopenharmony_ci - Handle color mask in RGBA to internal component conversion. 44145bd8deadSopenharmony_ci - Improve language in section 4.4.5. 44155bd8deadSopenharmony_ci - Add dependencies on more extensions. 44165bd8deadSopenharmony_ci 44175bd8deadSopenharmony_ci #4c April 28, 2008: dgkoch 44185bd8deadSopenharmony_ci - merge in framebuffer_blit and update other references to 44195bd8deadSopenharmony_ci FRAMEBUFFER_EXT and FRAMEBUFFER_BINDING_EXT, eliminating all 44205bd8deadSopenharmony_ci references to the obsolete bindings. 44215bd8deadSopenharmony_ci 44225bd8deadSopenharmony_ci #5 May 2, 2008: rbarris, dgkoch 44235bd8deadSopenharmony_ci - merge in framebuffer_multisample 44245bd8deadSopenharmony_ci 44255bd8deadSopenharmony_ci #6 May 8, 2008: dgkoch 44265bd8deadSopenharmony_ci - rebase against OpenGL 2.1 spec 44275bd8deadSopenharmony_ci 44285bd8deadSopenharmony_ci #7 May 8, 2008: dgkoch 44295bd8deadSopenharmony_ci - merge in packed_depth_stencil 44305bd8deadSopenharmony_ci 44315bd8deadSopenharmony_ci #8 May 8, 2008: dgkoch 44325bd8deadSopenharmony_ci - add caveat that MSAA to MSAA blit may have issues (khronos bug 44335bd8deadSopenharmony_ci #3005) 44345bd8deadSopenharmony_ci 44355bd8deadSopenharmony_ci #9 May 9, 2008: dgkoch 44365bd8deadSopenharmony_ci - renamed from EXT_fbo2 to ARB_fbo. Changed all suffixes to _ARB 44375bd8deadSopenharmony_ci instead of _EXT. 44385bd8deadSopenharmony_ci 44395bd8deadSopenharmony_ci #10 May 19, 2008: rbarris 44405bd8deadSopenharmony_ci - Bugzilla 3013: allow dimension mismatches (esp. depth) 44415bd8deadSopenharmony_ci 44425bd8deadSopenharmony_ci #11 May 21, 2008: dgkoch 44435bd8deadSopenharmony_ci - Bugzilla 3014: allow different color formats when using MRT. 44445bd8deadSopenharmony_ci - added Issues 4, 5 44455bd8deadSopenharmony_ci - deleted FRAMEBUFFER_INCOMPLETE_FORMATS & 44465bd8deadSopenharmony_ci FRAMEBUFFER_INCOMPLETE_DIMENSIONS 44475bd8deadSopenharmony_ci - added text for proposed resolution of Issue (5) 44485bd8deadSopenharmony_ci 44495bd8deadSopenharmony_ci #12 May 22, 2008: dgkoch 44505bd8deadSopenharmony_ci - Bugzilla 3015: define one- and two- component formats to be 44515bd8deadSopenharmony_ci color-renderable 44525bd8deadSopenharmony_ci - added Issue 6 44535bd8deadSopenharmony_ci 44545bd8deadSopenharmony_ci #13 May 29, 2008: Jon Leech 44555bd8deadSopenharmony_ci - Many updates and minor fixes for consistency with the 3.0 spec 44565bd8deadSopenharmony_ci draft. Replace DEPTH with DEPTH_COMPONENT in most uses. Increase 44575bd8deadSopenharmony_ci MAX_RENDERBUFFER_SIZE to 64 matching MAX_TEXTURE_SIZE (pending 44585bd8deadSopenharmony_ci resolution of bug 3454). Pose some open questions preceded by 44595bd8deadSopenharmony_ci "***". 44605bd8deadSopenharmony_ci 44615bd8deadSopenharmony_ci #14 June 26: dgkoch 44625bd8deadSopenharmony_ci - change MAX_SAMPLES to 0, to indicate the multisampling is not 44635bd8deadSopenharmony_ci required. (bug 3551) 44645bd8deadSopenharmony_ci 44655bd8deadSopenharmony_ci #15 July 2: Jon Leech 44665bd8deadSopenharmony_ci - More updates for 3.0 spec consistency. Define meaning of <src> 44675bd8deadSopenharmony_ci NONE and FRONT_AND_BACK for ReadBuffer() - this was an 44685bd8deadSopenharmony_ci oversight introduced with the original extension. Replace 44695bd8deadSopenharmony_ci reference to nonexistent table 12.nnn with reference to 44705bd8deadSopenharmony_ci table 3.15. Start introducing RED and RG formats from 3.0 spec. 44715bd8deadSopenharmony_ci 44725bd8deadSopenharmony_ci #16 July 10: dgkoch 44735bd8deadSopenharmony_ci - backport error change for DrawBuffer in 4.2.1 (bug 3530) 44745bd8deadSopenharmony_ci 44755bd8deadSopenharmony_ci #17 July 12, 2008: Jon Leech 44765bd8deadSopenharmony_ci - Use 'layer' instead of 'zoffset' terminology. Add 44775bd8deadSopenharmony_ci FramebufferTextureLayer. 44785bd8deadSopenharmony_ci - Add framebuffer attachment queries for attachment component 44795bd8deadSopenharmony_ci size / type / color encoding. 44805bd8deadSopenharmony_ci - Allow framebuffer incomplete if no default framebuffer is made 44815bd8deadSopenharmony_ci current, with new framebuffer status error. 44825bd8deadSopenharmony_ci - Allow multisample buffers in framebuffer objects. 44835bd8deadSopenharmony_ci - Global renaming / simplification to "default framebuffer" and 44845bd8deadSopenharmony_ci "framebuffer object". Did not yet re-flow those paragraphs for 44855bd8deadSopenharmony_ci ease of comparison. 44865bd8deadSopenharmony_ci - Add more introductory material about framebuffers in chapter 2. 44875bd8deadSopenharmony_ci - Remove requirement that all color attachments have the same 44885bd8deadSopenharmony_ci depth. 44895bd8deadSopenharmony_ci - Restrict FBOs and renderbuffers to Gen'ed names as agreed for 44905bd8deadSopenharmony_ci 3.0. 44915bd8deadSopenharmony_ci - Update clipping / buffer intersection / filtering rules for 44925bd8deadSopenharmony_ci BlitFramebuffer. 44935bd8deadSopenharmony_ci - Allow FRAMEBUFFER as a bind pseudotarget aliasing both read 44945bd8deadSopenharmony_ci and draw framebuffer targets. Allow DEPTH_STENCIL_ATTACHMENT 44955bd8deadSopenharmony_ci as an attachment alias for both depth and stencil attachments. 44965bd8deadSopenharmony_ci - Add Pat's introductory paragraph describing feedback loops in 44975bd8deadSopenharmony_ci section 4.4.3. 44985bd8deadSopenharmony_ci - Make RED_BITS etc. context queries defined iff all draw color 44995bd8deadSopenharmony_ci buffers have the same format. 45005bd8deadSopenharmony_ci - Remove "Dependencies" sections for NV extensions since we no 45015bd8deadSopenharmony_ci longer refer to their tokens. Need to add some dependencies 45025bd8deadSopenharmony_ci sections for new ARB extensions and figure out which language 45035bd8deadSopenharmony_ci goes here and which language with those extensions (e.g. 45045bd8deadSopenharmony_ci texture_rg, framebuffer_sRGB, 45055bd8deadSopenharmony_ci - Many minor non-functional language tweaks to match 3.0 core 45065bd8deadSopenharmony_ci language. 45075bd8deadSopenharmony_ci 45085bd8deadSopenharmony_ci #18 July 14, 2008: Rob Barris 45095bd8deadSopenharmony_ci - Tidy up introductory/overview section 45105bd8deadSopenharmony_ci 45115bd8deadSopenharmony_ci #19 July 16, 2008: Daniel Koch, Rob Barris 45125bd8deadSopenharmony_ci - add interactions with ARB_texture_rg, EXT_texture_array and 45135bd8deadSopenharmony_ci NV_float_buffer 45145bd8deadSopenharmony_ci - restore FRAMEBUFFER enumerant and restore all the text where 45155bd8deadSopenharmony_ci it had been accepted before (removed in version 4). 45165bd8deadSopenharmony_ci - allow texture arrays via FramebufferTextureLayer 45175bd8deadSopenharmony_ci - removed reference to required format list which we don't have here. 45185bd8deadSopenharmony_ci - updated resolution of issue (6) 45195bd8deadSopenharmony_ci 45205bd8deadSopenharmony_ci #20 July 16, 2008: Daniel Koch, Rob Barris 45215bd8deadSopenharmony_ci - simplification of language for logical operation when a FB-image 45225bd8deadSopenharmony_ci is attached more than once 45235bd8deadSopenharmony_ci - add interactions with EXT_texture_integer and ARB_framebuffer_sRGB 45245bd8deadSopenharmony_ci - Resolved issues (2), (4) and (5) 45255bd8deadSopenharmony_ci - Updated issue (3) (although the list is still not exhaustive) 45265bd8deadSopenharmony_ci 45275bd8deadSopenharmony_ci #21 July 17, 2008: Daniel Koch 45285bd8deadSopenharmony_ci - add Issue (7) as suggested by pbrown 45295bd8deadSopenharmony_ci - restore FRAMEBUFFER_BINDING alias 45305bd8deadSopenharmony_ci - fix incorrect references to FRAMEBUFFER_BINDING 45315bd8deadSopenharmony_ci 45325bd8deadSopenharmony_ci #22 July 17, 2008: Jon Leech 45335bd8deadSopenharmony_ci - minor language cleanup for consistency with the 3.0 core spec. 45345bd8deadSopenharmony_ci 45355bd8deadSopenharmony_ci #23 July 24, 2008: Jon Leech 45365bd8deadSopenharmony_ci - Use new GLX rendering opcodes for BindRenderbuffer and 45375bd8deadSopenharmony_ci BindFramebuffer so they can be semantically distinguished 45385bd8deadSopenharmony_ci from the EXT entry points. 45395bd8deadSopenharmony_ci - Add GLX protocol for FramebufferTextureLayer. 45405bd8deadSopenharmony_ci 45415bd8deadSopenharmony_ci #24 August 7, 2008: Jon Leech 45425bd8deadSopenharmony_ci - Remove ARB suffixes. 45435bd8deadSopenharmony_ci 45445bd8deadSopenharmony_ci #25 August 8, 2008: Jon Leech 45455bd8deadSopenharmony_ci - Add missing framebuffer attachment state for component type / 45465bd8deadSopenharmony_ci encoding / size to state tables. 45475bd8deadSopenharmony_ci 45485bd8deadSopenharmony_ci #26 August 8, 2008: Jon Leech 45495bd8deadSopenharmony_ci - Add missing INDEX token for legacy default framebuffer 45505bd8deadSopenharmony_ci color buffer component types. 45515bd8deadSopenharmony_ci 45525bd8deadSopenharmony_ci #27 August 20, 2008: Jon Leech 45535bd8deadSopenharmony_ci - Add ALPHA to list of color-renderable base internal formats to 45545bd8deadSopenharmony_ci sync with 3.0 spec language. 45555bd8deadSopenharmony_ci 45565bd8deadSopenharmony_ci #28 November 17, 2008: Mark Kilgard & Nigel Stewart 45575bd8deadSopenharmony_ci - glFramebufferTexturLayerARB -> glFramebufferTextureLayerARB 45585bd8deadSopenharmony_ci (add final e to Texture) 45595bd8deadSopenharmony_ci 45605bd8deadSopenharmony_ci #29 March 12, 2009: Jon Leech 45615bd8deadSopenharmony_ci - Edits in chapter 4 intro for consistency with GL core spec 45625bd8deadSopenharmony_ci language, including removing the completeness requirement that all 45635bd8deadSopenharmony_ci color buffers of an FBO be the same depth. Reflow some text for 45645bd8deadSopenharmony_ci readability. 45655bd8deadSopenharmony_ci 45665bd8deadSopenharmony_ci #30 March 31, 2009: Mark Kilgard & Jeff Juliano 45675bd8deadSopenharmony_ci - Change color-renderable to be any color texture format. 45685bd8deadSopenharmony_ci Fix some typos. 45695bd8deadSopenharmony_ci 45705bd8deadSopenharmony_ci #31 May 27, 2009: Jon Leech 45715bd8deadSopenharmony_ci - Change default value of FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 45725bd8deadSopenharmony_ci to NONE (bug 4407). 45735bd8deadSopenharmony_ci 45745bd8deadSopenharmony_ci #32 July 21, 2010: Daniel Koch 45755bd8deadSopenharmony_ci - Add issue 10 clarifying that ARB fbos cannot be shared. 45765bd8deadSopenharmony_ci 45775bd8deadSopenharmony_ci #33 July 22, 2011: Jon Leech 45785bd8deadSopenharmony_ci - Remove error which disallowed non-multisample <-> sample blits 45795bd8deadSopenharmony_ci (bug 7367). 45805bd8deadSopenharmony_ci 45815bd8deadSopenharmony_ci #34 October 2, 2011: Jon Leech 45825bd8deadSopenharmony_ci - Bring chapter 6 language changes in sync with the OpenGL 3.0 API 45835bd8deadSopenharmony_ci specification phrasing, and fix the description of 45845bd8deadSopenharmony_ci GetFramebufferAttachmentParameteriv to use DEPTH and STENCIL as 45855bd8deadSopenharmony_ci attachment names, rather than the nonexistent DEPTH_BUFFER and 45865bd8deadSopenharmony_ci STENCIL_BUFFER tokens (Bug 8102). 45875bd8deadSopenharmony_ci 45885bd8deadSopenharmony_ci #35 June 29, 2013: Jon Leech 45895bd8deadSopenharmony_ci - Rearrange New Tokens section to allow all simple queries to be 45905bd8deadSopenharmony_ci queried with GetBooleanv as well, since it's defined to work for 45915bd8deadSopenharmony_ci all of them (Bug 6838). 45925bd8deadSopenharmony_ci 45935bd8deadSopenharmony_ci #36, September 23, 2013: Jon Leech 45945bd8deadSopenharmony_ci - Specify that undefined behavior results when mixing EXT and 45955bd8deadSopenharmony_ci ARB_framebuffer_object / OpenGL 3.0 API framebuffer objects 45965bd8deadSopenharmony_ci (Bug 10738). 45975bd8deadSopenharmony_ci 45985bd8deadSopenharmony_ci #37, June 20, 2016: Kevin Rogvin, James Jones 45995bd8deadSopenharmony_ci - Specify behaviour of mixing EXT and ARB_framebuffer_object / 46005bd8deadSopenharmony_ci OpenGL 3.0 framebuffer objects so that the aliases of the 46015bd8deadSopenharmony_ci functions are correctly observed (Bug 1485) 46025bd8deadSopenharmony_ci 46035bd8deadSopenharmony_ci #38, October 6, 2016: Jon Leech 46045bd8deadSopenharmony_ci - Remove STENCIL_REF from list of state moved to become framebuffer 46055bd8deadSopenharmony_ci dependent (Bug 8422). 4606