1Name 2 3 APPLE_aux_depth_stencil 4 5Name Strings 6 7 GL_APPLE_aux_depth_stencil 8 9Contact 10 11 Bob Beretta, Apple Inc. (beretta 'at' apple.com) 12 13Version 14 15 1.0 16 17Number 18 19 370 20 21Dependencies 22 23 None 24 25Overview 26 27 Normally, each OpenGL drawable allocates at most one depth buffer and one 28 stencil buffer, regardless of how many aux buffers there are. 29 30 When the APPLE_aux_depth_stencil extension is used, and the depth buffer 31 size is non-zero, the GL silently allocates a separate depth buffer for the 32 color buffer and for each aux buffer. Similarly, if the stencil buffer size 33 is non-zero, a separate stencil buffer is allocated for the color buffer and 34 each aux buffer. This extension does not cause separate depth or stencil 35 buffers to be allocated for the left and right buffers of a stereo drawable. 36 A context with no aux buffers will be unaffected by this extension. 37 38 Switching the draw or read buffer from the color buffer to an aux buffer, or 39 switching between two aux buffers, simultaneously switches the associated 40 depth and stencil buffers, for drawing or reading. 41 42 For example, if an OpenGL context has two aux buffers and non-zero depth 43 buffer size, it will have a total of three depth buffers - one associated 44 with the color buffer and one associated with each aux buffer. If that 45 context is used to render to AUX0, then to render to AUX1, the changes to 46 the depth buffer made by the rendering to AUX1 will not affect the depth 47 buffer associated with AUX0, and vice versa. 48 49Issues 50 51 (1) Because the additional depth and stencil buffers must be present when 52 the OpenGL context is created, the extension cannot be enabled or disabled 53 after context creation. How is it enabled? 54 55 RESOLVED: The extension is enabled by creating the context with a pixel 56 format, or visual, specification that includes the aux_depth_stencil 57 attribure. On MacOSX, this is done by passing the CGLPFAAuxDepthStencil 58 boolean attribute to CGLChoosePixelFormat. If you create a context with an 59 aux_depth_stencil pixel format or visual, the context is permanently in 60 aux_depth_stencil mode. 61 62 (2) Because the extension must be enabled before a context is created, there 63 is no extension string to query. Is there still an extension string? 64 65 RESOLVED: The normal semantic of querying the OpenGL extension string does 66 not apply. If the extension is not supported, the attempt to create a pixel 67 format or visual with the aux_depth_stencil attribute will fail. However, 68 the GL_APPLE_aux_depth_stencil extension string is still exported for 69 consistency. 70 71 (3) Once a context has been created, is it possible to whether or not 72 aux_depth_stencil is active? 73 74 RESOLVED: Yes. GetIntegerv can be used to query AUX_DEPTH_STENCIL_APPLE to 75 see if the current context is an aux_depth_stencil context. The return 76 value is guaranteed to be TRUE if the context was created with an 77 aux_depth_stencil pixel format, and FALSE otherwise. 78 79 (4) How does this extension interact with ARB_draw_buffers? 80 81 RESOLVED: When a fragment program renders to multiple output color buffers, 82 only the depth and stencil buffers associated with draw buffer 0 are used. 83 The additional depth and stencil buffers created by aux_depth_stencil are 84 accessible to the fragment program only when their associated color buffer 85 is the current draw buffer 0. 86 87New Procedures and Functions 88 89 None 90 91New Tokens 92 93 Accepted by the <pname> parameter of GetIntegerv. 94 95 AUX_DEPTH_STENCIL_APPLE 0x8A14 96 97Errors 98 99 None 100 101New State 102 103 None 104 105New Implementation Dependent State 106 107Get Value Type Get Command Values Description Section 108------------------------------- ------ ------------- ------------- ------------------ ------------ 109AUX_DEPTH_STENCIL_APPLE Z2 GetIntegerv True or False aux depth stencil - 110 enabled 111 112