1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/extensions/EXT_draw_buffers.txt Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,542 @@ 1.4 +Name 1.5 + 1.6 + EXT_draw_buffers 1.7 + 1.8 +Name Strings 1.9 + 1.10 + GL_EXT_draw_buffers 1.11 + 1.12 +Contributors 1.13 + 1.14 + Contributors to GL_NV_draw_buffers 1.15 + Contributors to GL_NV_fbo_color_attachments 1.16 + Contributors to the OpenGL ES 2.0 specification 1.17 + Contributors to the OpenGLSL ES 1.0.17 specification 1.18 + Contributors to the OpenGL ES 3.0 specification 1.19 + Nicolas Capens, TransGaming Inc. 1.20 + Daniel Koch, TransGaming Inc. 1.21 + Alastair Patrick, Google Inc. 1.22 + Kenneth Russell, Google Inc. 1.23 + Greg Roth, NVIDIA Corporation 1.24 + Ben Bowman, Imagination Technologies 1.25 + Members of the WebGL and OpenGL ES working groups 1.26 + 1.27 +Contact 1.28 + 1.29 + Daniel Koch (daniel 'at' transgaming.com) 1.30 + 1.31 +Status 1.32 + 1.33 + Draft Complete 1.34 + 1.35 +Version 1.36 + 1.37 + Last Modified Date: January 30, 2013 1.38 + Revision: #7 1.39 + 1.40 +Number 1.41 + 1.42 + TBD 1.43 + 1.44 +Dependencies 1.45 + 1.46 + OpenGL ES 2.0 is required. 1.47 + 1.48 + The extension is written against the OpenGL ES 2.0 specification. 1.49 + 1.50 + ANGLE_framebuffer_blit affects the definition of this extension. 1.51 + APPLE_framebuffer_multisample affects the definitin of this extension. 1.52 + 1.53 +Overview 1.54 + 1.55 + This extension increases the number of available framebuffer object 1.56 + color attachment points, extends OpenGL ES 2.0 to allow multiple output 1.57 + colors, and provides a mechanism for directing those outputs to 1.58 + multiple color buffers. 1.59 + 1.60 + This extension is similar to the combination of the GL_NV_draw_buffers 1.61 + and GL_NV_fbo_color_attachments extensions, but imposes certain 1.62 + restrictions informed by the OpenGL ES 3.0 API. 1.63 + 1.64 +New Procedures and Functions 1.65 + 1.66 + void DrawBuffersEXT(sizei n, const enum *bufs); 1.67 + 1.68 +New Tokens 1.69 + 1.70 + Accepted by the <pname> parameter of GetIntegerv: 1.71 + 1.72 + MAX_COLOR_ATTACHMENTS_EXT 0x8CDF 1.73 + 1.74 + Accepted by the <pname> parameters of GetIntegerv and GetFloatv: 1.75 + 1.76 + MAX_DRAW_BUFFERS_EXT 0x8824 1.77 + DRAW_BUFFER0_EXT 0x8825 1.78 + DRAW_BUFFER1_EXT 0x8826 1.79 + DRAW_BUFFER2_EXT 0x8827 1.80 + DRAW_BUFFER3_EXT 0x8828 1.81 + DRAW_BUFFER4_EXT 0x8829 1.82 + DRAW_BUFFER5_EXT 0x882A 1.83 + DRAW_BUFFER6_EXT 0x882B 1.84 + DRAW_BUFFER7_EXT 0x882C 1.85 + DRAW_BUFFER8_EXT 0x882D 1.86 + DRAW_BUFFER9_EXT 0x882E 1.87 + DRAW_BUFFER10_EXT 0x882F 1.88 + DRAW_BUFFER11_EXT 0x8830 1.89 + DRAW_BUFFER12_EXT 0x8831 1.90 + DRAW_BUFFER13_EXT 0x8832 1.91 + DRAW_BUFFER14_EXT 0x8833 1.92 + DRAW_BUFFER15_EXT 0x8834 1.93 + 1.94 + Accepted by the <attachment> parameter of FramebufferRenderbuffer, 1.95 + FramebufferTexture2D and GetFramebufferAttachmentParameteriv, and by 1.96 + the <bufs> parameter of DrawBuffersEXT: 1.97 + 1.98 + COLOR_ATTACHMENT0_EXT 0x8CE0 1.99 + COLOR_ATTACHMENT1_EXT 0x8CE1 1.100 + COLOR_ATTACHMENT2_EXT 0x8CE2 1.101 + COLOR_ATTACHMENT3_EXT 0x8CE3 1.102 + COLOR_ATTACHMENT4_EXT 0x8CE4 1.103 + COLOR_ATTACHMENT5_EXT 0x8CE5 1.104 + COLOR_ATTACHMENT6_EXT 0x8CE6 1.105 + COLOR_ATTACHMENT7_EXT 0x8CE7 1.106 + COLOR_ATTACHMENT8_EXT 0x8CE8 1.107 + COLOR_ATTACHMENT9_EXT 0x8CE9 1.108 + COLOR_ATTACHMENT10_EXT 0x8CEA 1.109 + COLOR_ATTACHMENT11_EXT 0x8CEB 1.110 + COLOR_ATTACHMENT12_EXT 0x8CEC 1.111 + COLOR_ATTACHMENT13_EXT 0x8CED 1.112 + COLOR_ATTACHMENT14_EXT 0x8CEE 1.113 + COLOR_ATTACHMENT15_EXT 0x8CEF 1.114 + 1.115 + The COLOR_ATTACHMENT0_EXT constant is equal to the 1.116 + COLOR_ATTACHMENT0 constant. 1.117 + 1.118 + Each COLOR_ATTACHMENT<i>_EXT adheres to COLOR_ATTACHMENT<i>_EXT 1.119 + = COLOR_ATTACHMENT0_EXT + <i>. 1.120 + 1.121 +Changes to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization) 1.122 + 1.123 + Section 3.2, (Multisampling). Replace the second paragraph: 1.124 + 1.125 + An additional buffer, called the multisample buffer, is added to the 1.126 + window system-provided framebuffer. Pixel sample values, including 1.127 + color, depth, and stencil values, are stored in this buffer. Samples 1.128 + contain separate color values for each fragment color. When the 1.129 + window system-provided framebuffer includes a multisample buffer, it 1.130 + does not include depth or stencil buffers, even if the multisample 1.131 + buffer does not store depth or stencil values. Color buffers do 1.132 + coexist with the multisample buffer, however. 1.133 + 1.134 + Section 3.8.2, (Shader Execution) Replace subsection "Shader 1.135 + Outputs": 1.136 + 1.137 + The OpenGL ES Shading Language specification describes the values 1.138 + that may be output by a fragment shader. These are gl_FragColor and 1.139 + gl_FragData[n]. The final fragment color values or the final 1.140 + fragment data values written by a fragment shader are clamped to the 1.141 + range [0, 1] and then converted to fixed-point as described in 1.142 + section 2.1.2 for framebuffer color components. 1.143 + 1.144 + Writing to gl_FragColor specifies the fragment color (color number 1.145 + zero) that will be used by subsequent stages of the pipeline. 1.146 + Writing to gl_FragData[n] specifies the value of fragment color 1.147 + number n. Any colors, or color components, associated with a 1.148 + fragment that are not written by the fragment shader are undefined. 1.149 + A fragment shader may not statically assign values to both 1.150 + gl_FragColor and gl_FragData. In this case, a compile or link error 1.151 + will result. A shader statically assigns a value to a variable if, 1.152 + after preprocessing, it contains a statement that would write to the 1.153 + variable, whether or not run-time flow of control will cause that 1.154 + statement to be executed. 1.155 + 1.156 +Changes to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment 1.157 +Operations and the Frame Buffer) 1.158 + 1.159 + Modify the overview of Chapter 4 and replace the sentences 1.160 + of the fifth paragraph which read: 1.161 + 1.162 + "The name of the color buffer of an application-created framebuffer 1.163 + object is COLOR_ATTACHMENT0. The names of the depth and stencil buffers 1.164 + are DEPTH_ATTACHMENT and STENCIL_ATTACHMENT." 1.165 + 1.166 + With the following: 1.167 + 1.168 + "A framebuffer object has an array of color buffer attachment points, 1.169 + numbered zero through <n>, a depth buffer attachment point, and a 1.170 + stencil buffer attachment point." 1.171 + 1.172 + Insert Table 4.3 to Section 4.2.1 (and renumber subsequent tables): 1.173 + 1.174 + Symbolic Constant Meaning 1.175 + ----------------- --------------------- 1.176 + NONE No buffer 1.177 + 1.178 + COLOR_ATTACHMENT<i>_EXT (see caption) Output fragment color to image 1.179 + attached at color attachment 1.180 + point i 1.181 + 1.182 + Table 4.3: Arguments to DrawBuffersEXT when the context is bound to a 1.183 + framebuffer object, and the buffers they indicate. <i> in 1.184 + COLOR_ATTACHMENT<i>_EXT may range from zero to the value of 1.185 + MAX_COLOR_ATTACHMENTS_EXT minus one. 1.186 + 1.187 + Replace Section 4.2.1, "Selecting a Buffer for Writing" with the following: 1.188 + 1.189 + "By default, color values are written into the front buffer for 1.190 + single buffered surfaces or into the back buffer for back buffered 1.191 + surfaces as determined when making the context current. To control 1.192 + the color buffer into which each of the fragment color values is 1.193 + written, DrawBuffersEXT is used. 1.194 + 1.195 + The command 1.196 + 1.197 + void DrawBuffersEXT(sizei n, const enum *bufs); 1.198 + 1.199 + defines the draw buffers to which all fragment colors are written. 1.200 + <n> specifies the number of buffers in <bufs>. <bufs> is a pointer 1.201 + to an array of symbolic constants specifying the buffer to which 1.202 + each fragment color is written. 1.203 + 1.204 + Each buffer listed in <bufs> must be BACK, NONE, or one of the 1.205 + values from table 4.3. Further, acceptable values for the constants 1.206 + in <bufs> depend on whether the GL is using the default framebuffer 1.207 + (i.e., DRAW_FRAMEBUFFER_BINDING is zero), or a framebuffer object 1.208 + (i.e., DRAW_FRAMEBUFFER_BINDING is non-zero). For more information 1.209 + about framebuffer objects, see section 4.4. 1.210 + 1.211 + If the GL is bound to the default framebuffer, then <n> must be 1 1.212 + and the constant must be BACK or NONE. When draw buffer zero is 1.213 + BACK, color values are written into the sole buffer for single- 1.214 + buffered contexts, or into the back buffer for double-buffered 1.215 + contexts. If DrawBuffersEXT is supplied with a constant other than 1.216 + BACK and NONE, the error INVALID_OPERATION is generated. 1.217 + 1.218 + If the GL is bound to a draw framebuffer object, then each of the 1.219 + constants must be one of the values listed in table 4.3. 1.220 + 1.221 + In both cases, the draw buffers being defined correspond in order to 1.222 + the respective fragment colors. The draw buffer for fragment 1.223 + colors beyond <n> is set to NONE. 1.224 + 1.225 + The maximum number of draw buffers is implementation-dependent. The 1.226 + number of draw buffers supported can be queried by calling 1.227 + GetIntegerv with the symbolic constant MAX_DRAW_BUFFERS_EXT. An 1.228 + INVALID_VALUE error is generated if <n> is greater than 1.229 + MAX_DRAW_BUFFERS_EXT. 1.230 + 1.231 + If the GL is bound to a draw framebuffer object, the <i>th buffer listed 1.232 + in <bufs> must be COLOR_ATTACHMENT<i>_EXT or NONE. Specifying a 1.233 + buffer out of order, BACK, or COLOR_ATTACHMENT<m>_EXT where <m> is 1.234 + greater than or equal to the value of MAX_COLOR_ATTACHMENTS_EXT, 1.235 + will generate the error INVALID_OPERATION. 1.236 + 1.237 + If a fragment shader writes to "gl_FragColor", DrawBuffersEXT 1.238 + specifies the set of draw buffers into which the color 1.239 + written to "gl_FragColor" is written. If a fragment shader writes to 1.240 + "gl_FragData", DrawBuffersEXT specifies a set of draw buffers 1.241 + into which each of the multiple output colors defined by these 1.242 + variables are separately written. If a fragment shader writes to 1.243 + neither "gl_FragColor" nor "gl_FragData" the values of the 1.244 + fragment colors following shader execution are undefined, and may 1.245 + differ for each fragment color. 1.246 + 1.247 + Indicating a buffer or buffers using DrawBuffersEXT causes 1.248 + subsequent pixel color value writes to affect the indicated 1.249 + buffers. If the GL is bound to a draw framebuffer object and a draw 1.250 + buffer selects an attachment that has no image attached, then that 1.251 + fragment color is not written. 1.252 + 1.253 + Specifying NONE as the draw buffer for a fragment color will inhibit 1.254 + that fragment color from being written. 1.255 + 1.256 + The state required to handle color buffer selection for each 1.257 + framebuffer is an integer for each supported fragment color. For the 1.258 + default framebuffer, in the initial state the draw buffer for 1.259 + fragment color zero is BACK if there is a default framebuffer 1.260 + associated with the context, otherwise NONE. For framebuffer 1.261 + objects, in the initial state the draw buffer for fragment color 1.262 + zero is COLOR_ATTACHMENT0_EXT. 1.263 + 1.264 + For both the default framebuffer and framebuffer objects, the 1.265 + initial state of draw buffers for fragment colors other than zero is 1.266 + NONE. 1.267 + 1.268 + The value of the draw buffer selected for fragment color <i> can be 1.269 + queried by calling GetIntegerv with the symbolic constant 1.270 + DRAW_BUFFER<i>_EXT." 1.271 + 1.272 + Modify Section 4.2.3 (Clearing the Buffers) and replace the first 1.273 + two paragraphs with the following: 1.274 + 1.275 + "The GL provides a means for setting portions of every pixel in a 1.276 + particular buffer to the same value. The argument to 1.277 + 1.278 + void Clear(bitfield buf); 1.279 + 1.280 + is the bitwise OR of a number of values indicating which buffers are 1.281 + to be cleared. The values are COLOR_BUFFER_BIT, DEPTH_BUFFER_BIT, and 1.282 + STENCIL_BUFFER_BIT, indicating the buffers currently enabled for color 1.283 + writing, the depth buffer, and the stencil buffer (see below), 1.284 + respectively. The value to which each buffer is cleared depends on 1.285 + the setting of the clear value for that buffer. If the mask is not a 1.286 + bitwise OR of the specified values, then the error INVALID_VALUE is 1.287 + generated. 1.288 + 1.289 + void ClearColor(clampf r, clampf, g, clampf b, clampf a); 1.290 + 1.291 + sets the clear value for fixed-point color buffers. Each of the 1.292 + specified components is clamped to [0, 1] and converted to fixed-point 1.293 + as described in section 2.1.2 for framebuffer color components." 1.294 + 1.295 + Replace the second paragraph of Section 4.4.1 (Binding and Managing 1.296 + Framebuffer Objects) with the following: 1.297 + 1.298 + "The namespace for framebuffer objects is the unsigned integers, with 1.299 + zero reserved by OpenGL ES to refer to the default framebuffer. A 1.300 + framebuffer object is created by binding an unused name to the 1.301 + target FRAMEBUFFER, DRAW_FRAMEBUFFER, or READ_FRAMEBUFFER. The binding 1.302 + is effected by calling 1.303 + 1.304 + void BindFramebuffer(enum target, uint framebuffer); 1.305 + 1.306 + with <target> set the desired framebuffer target and <framebuffer> set 1.307 + to the unused name. The resulting framebuffer object is a new state 1.308 + vector. There is a number of color attachment points, plus one each 1.309 + for the depth and stencil attachment points. The number of color attachment 1.310 + points is equal to the value of MAX_COLOR_ATTACHMENTS_EXT." 1.311 + 1.312 + Replace the third item in the bulleted list in Section 4.4.1 (Binding 1.313 + and Managing Framebuffer Objects) with the following: 1.314 + 1.315 + " * The only color buffer bitplanes are the ones defined by the 1.316 + framebuffer attachments points named COLOR_ATTACHMENT0_EXT through 1.317 + COLOR_ATTACHMENT<n>_EXT." 1.318 + 1.319 + Modify Section 4.4.3 (Renderbuffer Objects) in the 1.320 + "Attaching Renderbuffer Images to a Framebuffer" subsection as follows: 1.321 + 1.322 + Insert the following table: 1.323 + 1.324 + Name of attachment 1.325 + --------------------------------------- 1.326 + COLOR_ATTACHMENT<i>_EXT (see caption) 1.327 + DEPTH_ATTACHMENT 1.328 + STENCIL_ATTACHMENT 1.329 + 1.330 + Table 4.x: Framebuffer attachment points. <i> in COLOR_ATTACHMENT<i>_EXT 1.331 + may range from zero to the value of MAX_COLOR_ATTACHMENTS_EXT minus 1. 1.332 + 1.333 + Modify the third sentence of the paragraph following the definition of 1.334 + FramebufferRenderbuffer to be as follows: 1.335 + 1.336 + "<attachment> should be set to one of the attachment points of the 1.337 + framebuffer listed in Table 4.x." 1.338 + 1.339 + Modify Section 4.4.3 (Renderbuffer Objects) in the "Attaching Texture 1.340 + Images to a Framebuffer" subsection as follows: 1.341 + 1.342 + Modify the last sentence of the paragraph following the definition of 1.343 + FramebufferTexture2D to be as follows: 1.344 + 1.345 + "<attachment> must be one of the attachment points of the framebuffer 1.346 + listed in Table 4.x." 1.347 + 1.348 + Modify Section 4.4.5 (Framebuffer Completeness) and replace the 3rd 1.349 + item in the bulleted list in the "Framebuffer Attachment Completeness" 1.350 + subsection with the following: 1.351 + 1.352 + " * If <attachment> is COLOR_ATTACHMENT<i>_EXT, then <image> must 1.353 + have a color-renderable internal format." 1.354 + 1.355 +Changes to Chapter 6 of the OpenGL ES 2.0 Specification (State and 1.356 +State Requests) 1.357 + 1.358 + In section 6.1.3 (Enumerated Queries) modify the third sentence in 1.359 + the definition of GetFramebufferAttachmentParameteriv to be as follows: 1.360 + 1.361 + "<attachment> must be one of the attachment points of the framebuffer 1.362 + listed in Table 4.x." 1.363 + 1.364 +Changes to Chapter 3 of the OpenGL ES Shading Language 1.0.17 Specification (Basics) 1.365 + 1.366 + Add a new section: 1.367 + 1.368 + 3.4.1 GL_EXT_draw_buffers Extension 1.369 + 1.370 + To use the GL_EXT_draw_buffers extension in a shader it 1.371 + must be enabled using the #extension directive. 1.372 + 1.373 + The shading language preprocessor #define 1.374 + GL_EXT_draw_buffers will be defined to 1, if the 1.375 + GL_EXT_draw_buffers extension is supported. 1.376 + 1.377 +Dependencies on ANGLE_framebuffer_blit and APPLE_framebuffer_multisample: 1.378 + 1.379 + If neither ANGLE_framebuffer_blit nor APPLE_framebuffer_multisample are 1.380 + supported, then all references to "draw framebuffers" should be replaced 1.381 + with references to "framebuffers". References to DRAW_FRAMEBUFFER_BINDING 1.382 + should be replaced with references to FRAMEBUFFER_BINDING. References to 1.383 + DRAW_FRAMEBUFFER and READ_FRAMEBUFFER should be removed. 1.384 + 1.385 + If ANGLE_framebuffer_blit is supported, DRAW_FRAMEBUFFER_BINDING, DRAW_FRAMEBUFFER 1.386 + and READ_FRAMEBUFFER all refer to corresponding _ANGLE suffixed names 1.387 + (they have the same token values). 1.388 + 1.389 + If APPLE_framebuffer_multisample is supported, DRAW_FRAMEBUFFER_BINDING, 1.390 + DRAW_FRAMEBUFFER and READ_FRAMEBUFFER all refer to the corresponding _APPLE 1.391 + suffixed names (they have the same token values). 1.392 + 1.393 +Errors 1.394 + 1.395 + The INVALID_OPERATION error is generated if DrawBuffersEXT is called 1.396 + when the default framebuffer is bound and any of the following conditions 1.397 + hold: 1.398 + - <n> is greater than 1 and less than MAX_DRAW_BUFFERS_EXT, 1.399 + - <bufs> contains a value other than BACK or NONE. 1.400 + 1.401 + The INVALID_OPERATION error is generated if DrawBuffersEXT is called 1.402 + when bound to a draw framebuffer object and any of the following 1.403 + conditions hold: 1.404 + - the <i>th value in <bufs> is not COLOR_ATTACHMENT<i>_EXT or NONE. 1.405 + 1.406 + The INVALID_VALUE error is generated if DrawBuffersEXT is called 1.407 + with a value of <n> which is greater than MAX_DRAW_BUFFERS_EXT. 1.408 + 1.409 + The INVALID_ENUM error is generated by FramebufferRenderbuffer if 1.410 + the <attachment> parameter is not one of the values listed in Table 4.x. 1.411 + 1.412 + The INVALID_ENUM error is generated by FramebufferTexture2D if 1.413 + the <attachment> parameter is not one of the values listed in Table 4.x. 1.414 + 1.415 + The INVALID_ENUM error is generated by GetFramebufferAttachmentParameteriv 1.416 + if the <attachment> parameter is not one of the values listed in Table 4.x. 1.417 + 1.418 +New State 1.419 + 1.420 + Add Table 6.X Framebuffer (State per framebuffer object): 1.421 + 1.422 + State Type Get Command Initial Value Description 1.423 + ------------------ ---- ------------ ------------- ----------- 1.424 + DRAW_BUFFER<i>_EXT Z10* GetIntegerv see 4.2.1 Draw buffer selected 1.425 + for fragment color i 1.426 + 1.427 + Add to Table 6.18 (Implementation Dependent Values) 1.428 + 1.429 + Get value Type Get Cmnd Minimum Value Description Sec. 1.430 + -------------------- ---- ----------- ------------- ----------- ----- 1.431 + MAX_DRAW_BUFFERS_EXT Z+ GetIntegerv 1 Maximum number of 4.2.1 1.432 + active draw buffers 1.433 + MAX_COLOR_ATTACHMENTS_EXT Z+ GetIntegerv 1 Number of framebuffer 4.4.1 1.434 + color attachment points 1.435 +Issues 1.436 + 1.437 + See ARB_draw_buffers for relevant issues. 1.438 + 1.439 + 1) What are the differences between this extension and NV_draw_buffers 1.440 + + NV_fbo_color_attachments? 1.441 + 1.442 + RESOLVED. This extension: 1.443 + - adds interactions with blit_framebuffer and the separate 1.444 + draw/read binding points 1.445 + - The draw buffer and color attachment limits are global instead 1.446 + of per-fbo (see Issue 2) 1.447 + - can be used to with default framebuffer to set NONE/BACK (see Issue 4) 1.448 + - retains the ordering restrictions on color attachments that are 1.449 + imposed by ES 3.0. 1.450 + 1.451 + 2) Should the MAX_DRAW_BUFFERS_EXT and MAX_COLOR_ATTACHMENTS_EXT limits 1.452 + be per-framebuffer values or implementation dependent constants? 1.453 + 1.454 + DISCUSSION: In ARB_draw_buffers this was per-context (see Issue 2). 1.455 + EXT_framebuffer_object (and subsequently ARB_framebuffer_object, and GL 3.0 1.456 + through GL 4.2) made these queries framebuffer-dependent. 1.457 + However in GL 4.3 and GLES 3.0, these limits were changed from 1.458 + framebuffer-dependent state to implementation-dependent state after 1.459 + much discussion (Bug 7990). 1.460 + 1.461 + NV_draw_buffers has MAX_DRAW_BUFFERS listed as per-framebuffer state, 1.462 + but NV_fbo_color_attachments has MAX_COLOR_ATTACHMENTS as an 1.463 + implementation-dependent constant. 1.464 + 1.465 + This is relevant because some implementations are not able to support 1.466 + multisampling in conjuction with multiple color attachments. If the 1.467 + query is per-framebuffer, they can report a maximum of one attachment 1.468 + when there are multisampled attachments, but a higher limit when only 1.469 + single-sampled attachments are present. 1.470 + 1.471 + RESOLVED. Make this global context state as this is most consistent 1.472 + with GLES 3.0 and updated GL drivers. In an implementation cannot 1.473 + support multisampling in conjunction with multiple color attachments, 1.474 + perhaps such an implementation could report FBO incomplete in this 1.475 + situation, but this is less than desirable. 1.476 + 1.477 + 3) Should we support broadcast from gl_FragColor to all gl_FragData[x] 1.478 + or should it be synonymous with gl_FragData[0]? 1.479 + 1.480 + DISCUSSION: With NV_draw_buffers, writing to gl_FragColor writes to all 1.481 + the enabled draw buffers (ie broadcast). In OpenGL ES 3.0 when using 1.482 + ESSL 1.0, gl_FragColor is equivalent to writing a single output to 1.483 + gl_FragData[0] and multiple outputs are not possible. When using ESSL 3.0, 1.484 + only user-defined out variables may be used. 1.485 + 1.486 + If broadcast is supported, some implementations may have to replace 1.487 + writes to gl_FragColor with replicated writes to all possible gl_FragData 1.488 + locations when this extension is enabled. 1.489 + 1.490 + RESOLVED: Writes to gl_FragColor are broadcast to all enabled color 1.491 + buffers. ES 3.0 using ESSL 1.0 doesn't support broadcast because 1.492 + ESSL 1.0 was not extended to have multiple color outputs (but that is 1.493 + what this extension adds). ESSL 3.0 doesn't support the broadcast because 1.494 + it doesn't have the gl_FragColor variable at all, and only has user- 1.495 + defined out variables. This extension extends ESSL 1.0 to have multiple 1.496 + color outputs. Broadcasting from gl_FragColor to all enabled color 1.497 + buffers is the most consistent with existing draw buffer extensions to 1.498 + date (both NV_draw_buffers and desktop GL). 1.499 + 1.500 + 4) Should we allow DrawBuffersEXT to be called when the default FBO is 1.501 + bound? 1.502 + 1.503 + DISCUSSION: NV_draw_buffers specifies that DrawBuffersNV errors with 1.504 + INVALID_OPERATION when the default FBO is bound. OpenGL ES 3.0 allows 1.505 + DrawBuffers to toggle between BACK and NONE on the default FBO. 1.506 + 1.507 + An implementation that does not natively support disabling the drawbuffer 1.508 + on the default FBO could emulate this by disabling color writes. 1.509 + 1.510 + RESOLVED: Allow DrawBuffersEXT to be called for the default FBO. This 1.511 + is more forward looking and is compatible with ES 3.0. 1.512 + 1.513 + 5) What are the requirements on the color attachment sizes and formats? 1.514 + 1.515 + RESOLVED: ES 2.0 requires that all color buffers attached to application- 1.516 + created framebuffer objects must have the same number of bitplanes 1.517 + (Chapter 4 overview p91). ES 2.0 also requires that all attached images 1.518 + have the same width and height (Section 4.4.5 Framebuffer Completeness). 1.519 + This extension does not lift those requirements, and failing to meet 1.520 + them will result in an incomplete FBO. 1.521 + 1.522 + 6) Does this have any interactions with glClear? 1.523 + 1.524 + RESOLVED: Yes. When multiple color buffers are enabled for writing, 1.525 + glClear clears all of the color buffers. Added language clarifying 1.526 + that glClear and glClearColor may affect multiple color buffers. 1.527 + 1.528 +Revision History 1.529 + 1.530 + 01/30/2013 dgkoch add issue 6 and clear interactions 1.531 + renamed to EXT_draw_buffers based on feedback 1.532 + changed resolution of issue 3. 1.533 + 01/23/2013 dgkoch add resolutions to issues 2-4. 1.534 + add issue 5. 1.535 + Add Table 4.x and update various explicit 1.536 + references to COLOR_ATTACHMENT0. 1.537 + Add errors. 1.538 + 11/13/2012 dgkoch add revision history 1.539 + add text from updated ES 3.0 spec 1.540 + add issues for discussion 1.541 + 10/16/2012 kbr update name string 1.542 + 10/16/2012 kbr remove restrition requiring draw buffer 0 to be non-NULL 1.543 + 10/12/2012 kbr remove references to GetDoublev and ReadBuffer 1.544 + 10/11/2012 kbr initial draft extension 1.545 +