From c219f1a3b1488bb318b85e08bab86d1efbee58ac Mon Sep 17 00:00:00 2001 From: Olli Etuaho Date: Fri, 21 Jul 2017 14:41:27 +0300 Subject: [PATCH] Change some WEBGL_multiview errors to be generated at draw (#2420) Make it possible to enable EXT_disjoint_timer_query(2) at the same time as WEBGL_multiview. This is important particularly for emscripten compatibility. Emscripten apps enable all available extensions at initialization. So if a timer query is active, multiview draws and clears now generate an INVALID_OPERATION error. Transform feedback related errors are also changed to happen at draw time rather than at state changes. This is a more elegant API, and even though making it perform as well is slightly more difficult, a sufficiently performant implementation should be possible. Also adds a framebuffer completeness condition that baseViewIndex must match between attachments. This is required for a performant implementation on most desktop platforms. --- .../proposals/WEBGL_multiview/extension.xml | 61 ++++++------------- 1 file changed, 19 insertions(+), 42 deletions(-) diff --git a/extensions/proposals/WEBGL_multiview/extension.xml b/extensions/proposals/WEBGL_multiview/extension.xml index 3c6d7edfc3..b67cfd4a87 100644 --- a/extensions/proposals/WEBGL_multiview/extension.xml +++ b/extensions/proposals/WEBGL_multiview/extension.xml @@ -15,33 +15,15 @@ - - Attempting to enable this extension when the EXT_disjoint_timer_query extension is enabled generates an INVALID_OPERATION error. - - - Attempting to enable the EXT_disjoint_timer_query extension when this extension is enabled generates an INVALID_OPERATION error. - - - Attempting to enable this extension when the EXT_disjoint_timer_query_webgl2 extension is enabled generates an INVALID_OPERATION error. - - - Attempting to enable the EXT_disjoint_timer_query_webgl2 extension when this extension is enabled generates an INVALID_OPERATION error. - - - When transform feedback is active, calling framebufferTextureMultiviewWEBGL generates an INVALID_OPERATION error. - - - When transform feedback is active, calling bindFramebuffer with a framebuffer parameter that has multi-view attachments generates an INVALID_OPERATION error. - - - When a framebuffer with multi-view attachments is bound as the draw framebuffer, calling beginTransformFeedback generates an INVALID_OPERATION error. - Calling framebufferTextureMultiviewWEBGL with a texture parameter that does not identify a 2D array texture generates an INVALID_OPERATION error. Calling framebufferTextureMultiviewWEBGL with the parameters set so that baseViewIndex + numViews is greater than the value of MAX_ARRAY_TEXTURE_LAYERS generates an INVALID_VALUE error. + + If baseViewIndex is not the same for all framebuffer attachment points where the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is not NONE the framebuffer is considered incomplete. Calling getFramebufferStatus for a framebuffer in this state returns FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR. + If baseViewIndex + numViews is greater than the number of texture array elements in the texture bound to target, the framebuffer is considered incomplete. Calling getFramebufferStatus for a framebuffer in this state returns FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR. @@ -124,6 +106,12 @@ In OpenGL ES shading language version 1.00 gl_ViewID_OVR has the type int as opposed to uint. + + When a timer query is active and the number of views in the current draw framebuffer is greater than 1, attempting to draw or calling clear generates an INVALID_OPERATION error. + + + When transform feedback is active and the number of views in the current draw framebuffer is greater than 1, attempting to draw generates an INVALID_OPERATION error. + @@ -195,27 +183,6 @@ interface WEBGL_multiview { - - The error INVALID_OPERATION is generated by attempting to enable this extension when the EXT_disjoint_timer_query extension is enabled. - - - The error INVALID_OPERATION is generated by attempting to enable the EXT_disjoint_timer_query extension when this extension is enabled. - - - The error INVALID_OPERATION is generated by attempting to enable this extension when the EXT_disjoint_timer_query_webgl2 extension is enabled. - - - The error INVALID_OPERATION is generated by attempting to enable the EXT_disjoint_timer_query_webgl2 extension when this extension is enabled. - - - The error INVALID_OPERATION is generated by calling framebufferTextureMultiviewWEBGL when transform feedback is active. - - - The error INVALID_OPERATION is generated by calling bindFramebuffer with a framebuffer parameter that has multi-view attachments when transform feedback is active. - - - The error INVALID_OPERATION is generated by calling beginTransformFeedback when a framebuffer with multi-view attachments is bound as the draw framebuffer, - The error INVALID_OPERATION is generated by calling framebufferTextureMultiviewWEBGL with a texture parameter that does not identify a 2D array texture. @@ -240,6 +207,12 @@ interface WEBGL_multiview { The error INVALID_OPERATION is generated by attempting to draw if the active program declares a number of views and the number of views in the draw framebuffer does not match the number of views declared in the active program. + + The error INVALID_OPERATION is generated by attempting to draw if the number of views in the current draw framebuffer is greater than 1 and transform feedback is active. + + + The error INVALID_OPERATION is generated by attempting to draw or calling clear if the number of views in the current draw framebuffer is greater than 1 and a timer query is active. +
@@ -307,5 +280,9 @@ interface WEBGL_multiview {
     
       Made the extension compatible with WebGL 1.0 and fixed example shader code.
     
+
+    
+      Specified some errors to be generated at draw time and made the extension compatible with emscripten.
+