15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_window_rectangles
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_window_rectangles
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Mark J. Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Jeff Bolz, NVIDIA
165bd8deadSopenharmony_ci    Mark Callow, Khronos
175bd8deadSopenharmony_ci    Chris Dalton, NVIDIA
185bd8deadSopenharmony_ci    Arthur Huillet, NVIDIA
195bd8deadSopenharmony_ci    Ilia Mirkin
205bd8deadSopenharmony_ci    Kai Ninomiya, Google
215bd8deadSopenharmony_ci    Marek Olsak, AMD
225bd8deadSopenharmony_ci    Brian Paul, VMware Inc.
235bd8deadSopenharmony_ci    Brian Salomon, Google
245bd8deadSopenharmony_ci    Walt Steiner, NVIDIA
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciStatus
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Complete
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    Implemeneted in NVIDIA late-2016 drivers
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ciVersion
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    Last Modified Date:  2017/11/03
355bd8deadSopenharmony_ci    Public Revision:     3
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ciNumber
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    OpenGL Extension #490
405bd8deadSopenharmony_ci    OpenGL ES Extension #263
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ciDependencies
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    Written based on the wording of the OpenGL 4.5 (Compatibility Profile)
455bd8deadSopenharmony_ci    specification.
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    This extension requires OpenGL 3.0 (for glGet*i_v queries) or
485bd8deadSopenharmony_ci    EXT_draw_buffers2 (for glGet*IndexedvEXT queries).
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    This extension interacts with EXT_direct_state_access.
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    Also written based on the wording of the OpenGL ES 3.2 specification.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    This extension requires OpenGL ES 3.0 (for glGet*i_v queries) or ES
555bd8deadSopenharmony_ci    2.0 with EXT_multiview_draw_buffers (for glGet*i_vEXT queries).
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ciOverview
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    This extension provides additional orthogonally aligned "window
605bd8deadSopenharmony_ci    rectangles" specified in window-space coordinates that restrict
615bd8deadSopenharmony_ci    rasterization of all primitive types (geometry, images, paths)
625bd8deadSopenharmony_ci    and framebuffer clears.
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci    When rendering to the framebuffer of an on-screen window, these
655bd8deadSopenharmony_ci    window rectangles are ignored so these window rectangles apply to
665bd8deadSopenharmony_ci    rendering to non-zero framebuffer objects only.
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    From zero to an implementation-dependent limit (specified by
695bd8deadSopenharmony_ci    GL_MAX_WINDOW_RECTANGLES_EXT) number of window rectangles can be
705bd8deadSopenharmony_ci    operational at once.  When one or more window rectangles are active,
715bd8deadSopenharmony_ci    rasterized fragments can either survive if the fragment is within
725bd8deadSopenharmony_ci    any of the operational window rectangles (GL_INCLUSIVE_EXT mode) or
735bd8deadSopenharmony_ci    be rejected if the fragment is within any of the operational window
745bd8deadSopenharmony_ci    rectangles (GL_EXCLUSIVE_EXT mode).
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci    These window rectangles operate orthogonally to the existing scissor
775bd8deadSopenharmony_ci    test functionality.
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    This extension has specification language for both OpenGL and ES so
805bd8deadSopenharmony_ci    EXT_window_rectangles can be implemented and advertised for either
815bd8deadSopenharmony_ci    or both API contexts.
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ciNew Procedures and Functions
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci    void WindowRectanglesEXT(enum mode, sizei count, const int box[]);
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ciNew Tokens
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    Accepted by the <mode> parameter of WindowRectanglesEXT:
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci        INCLUSIVE_EXT                               0x8F10
925bd8deadSopenharmony_ci        EXCLUSIVE_EXT                               0x8F11
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetIntegeri_v, GetInteger64i_v,
955bd8deadSopenharmony_ci    GetBooleani_v, GetFloati_v, GetDoublei_v, GetIntegerIndexedvEXT,
965bd8deadSopenharmony_ci    GetFloatIndexedvEXT, GetDoubleIndexedvEXT, GetBooleanIndexedvEXT, and
975bd8deadSopenharmony_ci    GetIntegeri_vEXT:
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci        WINDOW_RECTANGLE_EXT                        0x8F12
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
1025bd8deadSopenharmony_ci    GetInteger64v, GetFloatv, and GetDoublev:
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci        WINDOW_RECTANGLE_MODE_EXT                   0x8F13
1055bd8deadSopenharmony_ci        MAX_WINDOW_RECTANGLES_EXT                   0x8F14
1065bd8deadSopenharmony_ci        NUM_WINDOW_RECTANGLES_EXT                   0x8F15
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ciAdditions to Chapter 14 of the OpenGL 4.5 (Compatibility Profile)
1095bd8deadSopenharmony_ciSpecification (Fixed-Function Primitive Assembly and Rasterization)
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci -- Change the second and third paragraph of section 14.9 "Early
1125bd8deadSopenharmony_ci    Per-Fragment Tests" to read:
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ci    "Up to five operations are performed on each fragment, in the
1155bd8deadSopenharmony_ci    following order:
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci    * the pixel ownership test (see section 17.3.1);
1185bd8deadSopenharmony_ci    * the window rectangles test (see section 17.3.X);
1195bd8deadSopenharmony_ci    * the scissor test (see section 17.3.2);
1205bd8deadSopenharmony_ci    * the stencil test (see section 17.3.5);
1215bd8deadSopenharmony_ci    * the depth buffer test (see section 17.3.6); and
1225bd8deadSopenharmony_ci    * occlusion query sample counting (see section 17.3.7).
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    The pixel ownership, window rectangles test, and scissor tests are
1255bd8deadSopenharmony_ci    always performed."
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ciAdditions to Chapter 17 of the OpenGL 4.5 (Compatibility Profile)
1285bd8deadSopenharmony_ciSpecification (Writing Fragments and Samples to the Framebuffer)
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci -- Update figure 7.1 "Per-fragment operations" to insert a box labeled
1315bd8deadSopenharmony_ci    "Window Rectangles Test" with an arrow from the "Pixel Ownership Test"
1325bd8deadSopenharmony_ci    box and an arrow to the "Scissor Test" box.
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci -- Insert section 17.3.X "Window Rectangles Test" after section 17.3.1
1355bd8deadSopenharmony_ci    "Pixel Ownership Test"
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    "The window rectangles test determines if window-space fragment
1385bd8deadSopenharmony_ci    position (xw,yw) is inclusive or exclusive to a set of window-space
1395bd8deadSopenharmony_ci    rectangles.  The window rectangles are set with
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci        void WindowRectanglesEXT(enum mode, sizei n, const int box[]);
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci    where /mode/ is either INCLUSIVE_EXT or EXCLUSIVE_EXT (and otherwise
1445bd8deadSopenharmony_ci    generates INVALID_ENUM), /n/ is a count of active window rectangles (and
1455bd8deadSopenharmony_ci    generates INVALID_VALUE when /n/ is less than zero or greater than
1465bd8deadSopenharmony_ci    the implementation-dependent value of MAX_WINDOW_RECTANGLES_EXT), and
1475bd8deadSopenharmony_ci    an array of 4*/n/ elements.
1485bd8deadSopenharmony_ci    
1495bd8deadSopenharmony_ci    When the WindowRectanglesEXT command is processed without error,
1505bd8deadSopenharmony_ci    the /i/th window rectangle box is set to the corresponding four
1515bd8deadSopenharmony_ci    parameters (box[4*i],box[4*i+1],box[4*i+2],box[4*i+3) for values
1525bd8deadSopenharmony_ci    of /i/ less then /n/.  For values of /i/ greater than /n/, each
1535bd8deadSopenharmony_ci    window rectangle box is set to (0,0,0,0).
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    Each four elements (x_i,y_i,w_i,h_i) corresponds to the /i/th window
1565bd8deadSopenharmony_ci    rectangle indicating a box of pixels specified with window-space
1575bd8deadSopenharmony_ci    coordinates.  Each window rectangle box /i/ has a lower-left origin at
1585bd8deadSopenharmony_ci    (x_i,y_i) and upper-right corner at (x_i+w_i,y_i+h_i).
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci    The INVALID_VALUE error is generated if any element w_i or h_i,
1615bd8deadSopenharmony_ci    corresponding to each box's respective width and height, is negative.
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    Each rasterized or cleared fragment with a window-space position
1645bd8deadSopenharmony_ci    (xw,yw) is within the /i/th window rectangle box when both of these
1655bd8deadSopenharmony_ci    equations are satisfied for all /i/ less than /n/:
1665bd8deadSopenharmony_ci
1675bd8deadSopenharmony_ci       x_i <= xw < x_i+w_i
1685bd8deadSopenharmony_ci       y_i <= yw < y_i+h_i,
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci    When the window rectangles mode is INCLUSIVE_EXT mode and the
1715bd8deadSopenharmony_ci    bound framebuffer object is non-zero, a fragment passes the window
1725bd8deadSopenharmony_ci    rectangles test if the fragment's window-space position is within
1735bd8deadSopenharmony_ci    at least one of the current /n/ active window rectangles; otherwise
1745bd8deadSopenharmony_ci    the window rectangles test fails and the fragment is discarded.
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci    When the window rectangles mode is EXCLUSIVE_EXT mode and the bound
1775bd8deadSopenharmony_ci    framebuffer object is non-zero, a fragment fails the window rectangles
1785bd8deadSopenharmony_ci    test and is discarded if the fragment's window-space position is
1795bd8deadSopenharmony_ci    within at least one of the current /n/ active window rectangles;
1805bd8deadSopenharmony_ci    otherwise the window rectangles test passes and the fragment passes
1815bd8deadSopenharmony_ci    the window rectangles test.
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci    When the bound framebuffer object is zero, the window rectangles
1845bd8deadSopenharmony_ci    test always passes.
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci    The state required for the window rectangles test is a bit
1875bd8deadSopenharmony_ci    indicating if the mode is inclusive or exclusive, an array with
1885bd8deadSopenharmony_ci    /max/ elements, each element consisting of 2 integers for (x,y) and
1895bd8deadSopenharmony_ci    2 non-negative integers for width & height where /max/ is the value
1905bd8deadSopenharmony_ci    of the implementation-dependent constant MAX_WINDOW_RECTANGLES_EXT,
1915bd8deadSopenharmony_ci    and a non-negative integer indicating the number of active window
1925bd8deadSopenharmony_ci    rectangles.  This initial state is EXCLUSIVE_EXT for the bit, all
1935bd8deadSopenharmony_ci    zero for each integer in the array of window rectangles, and zero
1945bd8deadSopenharmony_ci    for the count."
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci -- Update section 17.4.3 "Clearing the Buffers"
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ci    Replace the first sentence of the seventh paragraph with:
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci    "When Clear is called, the only per-fragment operations that are
2015bd8deadSopenharmony_ci    applied (if enabled) are the pixel ownership test, the window
2025bd8deadSopenharmony_ci    rectangles test (17.3.X), the scissor test, sRGB conversion (see
2035bd8deadSopenharmony_ci    section 17.3.9), and dithering."
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci -- Update section 17.4.3.2 "Clearing the Multisample Buffer"
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    Replace the final paragraph with:
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci    "Masking, window rectangle testing, and scissoring affect clearing
2105bd8deadSopenharmony_ci    the multisample buffer in the same way as they affect clearing the
2115bd8deadSopenharmony_ci    corresponding color, depth, and stencil buffers."
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci -- Update section 18.1.2 "Conversion to Fragments"
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci    Change the third sentence of the second paragraph to read: 
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci    "However, the histogram and minmax tables are updated even if the
2185bd8deadSopenharmony_ci    corresponding fragments are later rejected by the pixel ownership
2195bd8deadSopenharmony_ci    (section 17.3.1), window rectangles test (section 17.3.X), or scissor
2205bd8deadSopenharmony_ci    (section 17.3.2) tests."
2215bd8deadSopenharmony_ci
2225bd8deadSopenharmony_ci -- Update section 18.1.4 "Writing to the Stencil or Depth/Stencil Buffers"
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    Change the third sentence to read:
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci    "Each pair is then treated as a fragment for purposes of the pixel
2275bd8deadSopenharmony_ci    ownership, window rectangle tests, and scissor tests; all other
2285bd8deadSopenharmony_ci    per-fragment operations are bypassed."
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci -- Update section 18.3.2 "Blitting Pixel Rectangles"
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci    Update the second sentence of the fourteenth paragraph to read:
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci    "The only fragment operations which affect a blit are the pixel
2355bd8deadSopenharmony_ci    ownership test, the window rectangles test, the scissor test, and
2365bd8deadSopenharmony_ci    sRGB conversion (see section 17.3.9)."
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ciAdditions to Chapter 7 of the OpenGL ES 3.2 Specification (Programs and
2395bd8deadSopenharmony_ciShaders)
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci -- Change the second bullet in section 7.11.1 "Shader Memory Access
2425bd8deadSopenharmony_ci    Ordering" to read:
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci    "For each fragment generated by the GL, the number of fragment shader
2455bd8deadSopenharmony_ci    invocations depends on a number of factors. If the fragment fails
2465bd8deadSopenharmony_ci    the pixel ownership test (see section 13.8.1), window rectangles
2475bd8deadSopenharmony_ci    test (see section 13.8.X), scissor test (see section 13.8.2), or is
2485bd8deadSopenharmony_ci    discarded by any of the multisample fragment operations (see section
2495bd8deadSopenharmony_ci    13.8.3), the fragment shader will not be executed."
2505bd8deadSopenharmony_ci
2515bd8deadSopenharmony_ciAdditions to Chapter 13 of the OpenGL ES 3.2
2525bd8deadSopenharmony_ciSpecification (Fixed-Function Primitive Assembly and Rasterization)
2535bd8deadSopenharmony_ci
2545bd8deadSopenharmony_ci -- Update figure 13.1 "Rasterization, early per-fragment tests, and
2555bd8deadSopenharmony_ci    fragment shading" to insert a box labeled "Window Rectangles Test"
2565bd8deadSopenharmony_ci    with an arrow from the "Pixel Ownership Test" box and an arrow to the
2575bd8deadSopenharmony_ci    "Scissor Test" box.
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ci -- Change the beginning of the second of section 13.8 "Early Per-Fragment
2605bd8deadSopenharmony_ci    Tests" to read:
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci    "Four fragment operations are performed, and a further three are
2635bd8deadSopenharmony_ci    optionally performed on each fragment, in the following order:
2645bd8deadSopenharmony_ci    
2655bd8deadSopenharmony_ci    * the pixel ownership test (see section 13.8.1);
2665bd8deadSopenharmony_ci    * the window rectangles test (see section 13.8.X);
2675bd8deadSopenharmony_ci    * the scissor test (see section 13.8.2);
2685bd8deadSopenharmony_ci    * multisample fragment operations (see section 13.8.3);
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci    If early per-fragment operations ..."
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci -- Insert section 13.8.X "Window Rectangles Test" after section 13.8.1
2735bd8deadSopenharmony_ci    "Pixel Ownership Test"
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci    "The window rectangles test determines if window-space fragment
2765bd8deadSopenharmony_ci    position (xw,yw) is inclusive or exclusive to a set of window-space
2775bd8deadSopenharmony_ci    rectangles.  The window rectangles are set with
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci        void WindowRectanglesEXT(enum mode, sizei n, const int box[]);
2805bd8deadSopenharmony_ci
2815bd8deadSopenharmony_ci    where /mode/ is either INCLUSIVE_EXT or EXCLUSIVE_EXT (and otherwise
2825bd8deadSopenharmony_ci    generates INVALID_ENUM), /n/ is a count of active window rectangles (and
2835bd8deadSopenharmony_ci    generates INVALID_VALUE when /n/ is less than zero or greater than
2845bd8deadSopenharmony_ci    the implementation-dependent value of MAX_WINDOW_RECTANGLES_EXT), and
2855bd8deadSopenharmony_ci    an array of 4*/n/ elements.
2865bd8deadSopenharmony_ci
2875bd8deadSopenharmony_ci    When the WindowRectanglesEXT command is processed without error,
2885bd8deadSopenharmony_ci    the /i/th window rectangle box is set to the corresponding four
2895bd8deadSopenharmony_ci    parameters (box[4*i],box[4*i+1],box[4*i+2],box[4*i+3) for values
2905bd8deadSopenharmony_ci    of /i/ less then /n/.  For values of /i/ greater than /n/, each
2915bd8deadSopenharmony_ci    window rectangle box is set to (0,0,0,0).
2925bd8deadSopenharmony_ci
2935bd8deadSopenharmony_ci    Each four elements (x_i,y_i,w_i,h_i) corresponds to the /i/th window
2945bd8deadSopenharmony_ci    rectangle indicating a box of pixels specified with window-space
2955bd8deadSopenharmony_ci    coordinates.  Each window rectangle box /i/ has a lower-left origin at
2965bd8deadSopenharmony_ci    (x_i,y_i) and upper-right corner at (x_i+w_i,y_i+h_i).
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci    The INVALID_VALUE error is generated if any element w_i or h_i,
2995bd8deadSopenharmony_ci    corresponding to each box's respective width and height, is negative.
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci    Each rasterized or cleared fragment with a window-space position
3025bd8deadSopenharmony_ci    (xw,yw) is within the /i/th window rectangle box when both of these
3035bd8deadSopenharmony_ci    equations are satisfied for all /i/ less than /n/:
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci       x_i <= xw < x_i+w_i
3065bd8deadSopenharmony_ci       y_i <= yw < y_i+h_i,
3075bd8deadSopenharmony_ci
3085bd8deadSopenharmony_ci    When the window rectangles mode is INCLUSIVE_EXT mode and the
3095bd8deadSopenharmony_ci    bound framebuffer object is non-zero, a fragment passes the window
3105bd8deadSopenharmony_ci    rectangles test if the fragment's window-space position is within
3115bd8deadSopenharmony_ci    at least one of the current /n/ active window rectangles; otherwise
3125bd8deadSopenharmony_ci    the window rectangles test fails and the fragment is discarded.
3135bd8deadSopenharmony_ci
3145bd8deadSopenharmony_ci    When the window rectangles mode is EXCLUSIVE_EXT mode and the bound
3155bd8deadSopenharmony_ci    framebuffer object is non-zero, a fragment fails the window rectangles
3165bd8deadSopenharmony_ci    test and is discarded if the fragment's window-space position is
3175bd8deadSopenharmony_ci    within at least one of the current /n/ active window rectangles;
3185bd8deadSopenharmony_ci    otherwise the window rectangles test passes and the fragment passes
3195bd8deadSopenharmony_ci    the window rectangles test.
3205bd8deadSopenharmony_ci
3215bd8deadSopenharmony_ci    When the bound framebuffer object is zero, the window rectangles
3225bd8deadSopenharmony_ci    test always passes.
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ci    The state required for the window rectangles test is a bit
3255bd8deadSopenharmony_ci    indicating if the mode is inclusive or exclusive, an array with
3265bd8deadSopenharmony_ci    /max/ elements, each element consisting of 2 integers for (x,y) and
3275bd8deadSopenharmony_ci    2 non-negative integers for width & height where /max/ is the value
3285bd8deadSopenharmony_ci    of the implementation-dependent constant MAX_WINDOW_RECTANGLES_EXT,
3295bd8deadSopenharmony_ci    and a non-negative integer indicating the number of active window
3305bd8deadSopenharmony_ci    rectangles.  This initial state is EXCLUSIVE_EXT for the bit, all
3315bd8deadSopenharmony_ci    zero for each integer in the array of window rectangles, and zero
3325bd8deadSopenharmony_ci    for the count."
3335bd8deadSopenharmony_ci
3345bd8deadSopenharmony_ciAdditions to Chapter 15 of the OpenGL ES 3.2 Specification (Writing
3355bd8deadSopenharmony_ciFragments and Samples to the Framebuffer)
3365bd8deadSopenharmony_ci
3375bd8deadSopenharmony_ci -- Update section 15.2.3 "Clearing the Buffers"
3385bd8deadSopenharmony_ci
3395bd8deadSopenharmony_ci    Replace the first sentence of the sixth paragraph with:
3405bd8deadSopenharmony_ci
3415bd8deadSopenharmony_ci    "When Clear is called, the only per-fragment operations that are
3425bd8deadSopenharmony_ci    applied (if enabled) are the pixel ownership test, the window
3435bd8deadSopenharmony_ci    rectangles test (13.8.X), the scissor test, sRGB conversion (see
3445bd8deadSopenharmony_ci    section 15.1.6), and dithering."
3455bd8deadSopenharmony_ci
3465bd8deadSopenharmony_ci -- Update section 15.2.3.2 "Clearing the Multisample Buffer"
3475bd8deadSopenharmony_ci
3485bd8deadSopenharmony_ci    Replace the final paragraph with:
3495bd8deadSopenharmony_ci
3505bd8deadSopenharmony_ci    "Masking, window rectangle testing, and scissoring affect clearing
3515bd8deadSopenharmony_ci    the multisample buffer in the same way as they affect clearing the
3525bd8deadSopenharmony_ci    corresponding color, depth, and stencil buffers."
3535bd8deadSopenharmony_ci
3545bd8deadSopenharmony_ciAdditions to Chapter 16 of the OpenGL ES 3.2 Specification (Reading and
3555bd8deadSopenharmony_ciCopying Pixels)
3565bd8deadSopenharmony_ci
3575bd8deadSopenharmony_ci -- Update section 16.2.1 "Blitting Pixel Rectangles"
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ci    Update the second sentence of the thirteenth paragraph to read:
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ci    "The only fragment operations which affect a blit are the pixel
3625bd8deadSopenharmony_ci    ownership test, the window rectangles test, the scissor test, and
3635bd8deadSopenharmony_ci    sRGB conversion (see section 15.1.6)."
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ciInteractions with the EXT_draw_buffers2 specification
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci    If EXT_draw_buffers2 is NOT supported, ignore references to
3685bd8deadSopenharmony_ci    GetIntegerIndexedvEXT and GetBooleanIndexedvEXT.
3695bd8deadSopenharmony_ci
3705bd8deadSopenharmony_ciInteractions with the EXT_direct_state_access specification
3715bd8deadSopenharmony_ci
3725bd8deadSopenharmony_ci    If EXT_direct_state_access is NOT supported, ignore references to
3735bd8deadSopenharmony_ci    GetFloatIndexedvEXT and GetDoubleIndexedvEXT.
3745bd8deadSopenharmony_ci
3755bd8deadSopenharmony_ciInteractions with the EXT_multiview_draw_buffers
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci    If EXT_multiview_draw_buffers is NOT supported, ignore references to
3785bd8deadSopenharmony_ci    GetIntegeri_vEXT.
3795bd8deadSopenharmony_ci
3805bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
3815bd8deadSopenharmony_ci
3825bd8deadSopenharmony_ci    None
3835bd8deadSopenharmony_ci
3845bd8deadSopenharmony_ciGLX Protocol
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci    A new GL rendering command is added. The following command is sent to the 
3875bd8deadSopenharmony_ci    server as part of a glXRender request:
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci        WindowRectanglesEXT
3905bd8deadSopenharmony_ci            2           12+4*n          rendering command length
3915bd8deadSopenharmony_ci            2           XXX             rendering command opcode
3925bd8deadSopenharmony_ci            4           ENUM            mode
3935bd8deadSopenharmony_ci            4           CARD32          count
3945bd8deadSopenharmony_ci            4*n         LISTofINT32     box
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ciErrors
3975bd8deadSopenharmony_ci
3985bd8deadSopenharmony_ci    The error INVALID_ENUM is generated by WindowRectanglesEXT if mode
3995bd8deadSopenharmony_ci    is not INCLUSIVE_EXT or EXCLUSIVE_EXT.
4005bd8deadSopenharmony_ci
4015bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by WindowRectanglesEXT if count
4025bd8deadSopenharmony_ci    is negative.
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by WindowRectanglesEXT if
4055bd8deadSopenharmony_ci    count is greater than the value of the implementation-dependent
4065bd8deadSopenharmony_ci    limit MAX_WINDOW_RECTANGLES_EXT.
4075bd8deadSopenharmony_ci
4085bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by WindowRectanglesEXT if any
4095bd8deadSopenharmony_ci    of the w_i or h_i elements of the box array are negative.
4105bd8deadSopenharmony_ci
4115bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by GetIntegeri_v,
4125bd8deadSopenharmony_ci    GetInteger64i_v, GetBooleani_v, GetFloati_v, and GetDoublei_v when
4135bd8deadSopenharmony_ci    pname is WINDOW_RECTANGLE_EXT and index is greater or equal to the
4145bd8deadSopenharmony_ci    implementation-dependent value of MAX_WINDOW_RECTANGLES_EXT.
4155bd8deadSopenharmony_ci
4165bd8deadSopenharmony_ciNew State
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci(table 23.26, p724) add the following entry:
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci    Get Value                  Type     Get Command    Initial Value  Description               Sec     Attribute
4215bd8deadSopenharmony_ci    -------------------------  -------  -------------  -------------  ------------------------  ------  ---------
4225bd8deadSopenharmony_ci    NUM_WINDOW_RECTANGLE_EXT   Z+       GetIntegerv    0              Active window rectangles  17.3.X  scissor
4235bd8deadSopenharmony_ci                                                                      count
4245bd8deadSopenharmony_ci    WINDOW_RECTANGLE_EXT       4*x4xZ+  GetIntegeri_v  4*x(0,0,0,0)   Window rectangle box      17.3.X  scissor
4255bd8deadSopenharmony_ci    WINDOW_RECTANGLE_MODE_EXT  Z2       GetIntegerv    EXCLUSIVE_EXT  Window rectangle mode     17.3.X  scissor
4265bd8deadSopenharmony_ci
4275bd8deadSopenharmony_ciNew Implementation Dependent State
4285bd8deadSopenharmony_ci
4295bd8deadSopenharmony_ci(table 23.66, p764) add the following entry:
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ci    Get Value                  Type  Get Command  Minimum Value  Description        Sec     Attribute
4325bd8deadSopenharmony_ci    -------------------------  ----  -----------  -------------  -----------------  ------  --------------
4335bd8deadSopenharmony_ci    MAX_WINDOW_RECTANGLES_EXT  Z+    GetIntegerv  4              Maximum num of     17.3.X  -
4345bd8deadSopenharmony_ci                                                                 window rectangles
4355bd8deadSopenharmony_ci
4365bd8deadSopenharmony_ciIssues
4375bd8deadSopenharmony_ci
4385bd8deadSopenharmony_ci    1)  What should this extension be called?
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ci        RESOLVED:  EXT_window_rectangles as this extension introduces
4415bd8deadSopenharmony_ci        a new per-fragment test, called the window rectangles test,
4425bd8deadSopenharmony_ci        that operates on (x,y) window-space coordinates of the fragment,
4435bd8deadSopenharmony_ci        testing those coordinates against a set of rectangles.
4445bd8deadSopenharmony_ci
4455bd8deadSopenharmony_ci        We avoid the term "scissor" because that describes preexisting
4465bd8deadSopenharmony_ci        OpenGL functionality orthogonal to this extension's
4475bd8deadSopenharmony_ci        functionality.
4485bd8deadSopenharmony_ci
4495bd8deadSopenharmony_ci        We also avoid the term "clip" because clipping operates on
4505bd8deadSopenharmony_ci        primitives (triangles, lines, points) rather than fragments
4515bd8deadSopenharmony_ci        as the window rectangles test does.
4525bd8deadSopenharmony_ci
4535bd8deadSopenharmony_ci        The "window" in the name does not refer to the often rectangular
4545bd8deadSopenharmony_ci        surface for managing application rendering within a desktop user
4555bd8deadSopenharmony_ci        interface metaphor.  "window" refers to window-space following
4565bd8deadSopenharmony_ci        the precedent of the ARB_window_pos extension.
4575bd8deadSopenharmony_ci
4585bd8deadSopenharmony_ci        Each rectangle is specified as a box in (integer) window-space
4595bd8deadSopenharmony_ci        coordinates.  Multiple such rectangles are supported hence
4605bd8deadSopenharmony_ci        "rectangles" in the name.
4615bd8deadSopenharmony_ci
4625bd8deadSopenharmony_ci        Intuitively, we can think of the rectangles carving out by
4635bd8deadSopenharmony_ci        exclusion (or selecting by inclusion) rectangular boxes in
4645bd8deadSopenharmony_ci        the region of window space either not allowed (or allowed) for
4655bd8deadSopenharmony_ci        rasterization.
4665bd8deadSopenharmony_ci
4675bd8deadSopenharmony_ci    2)  Should there be an enable?
4685bd8deadSopenharmony_ci
4695bd8deadSopenharmony_ci        RESOLVED:  No, configuring zero exclusive window rectangles is
4705bd8deadSopenharmony_ci        the same as disabling window rectangles.  Example:
4715bd8deadSopenharmony_ci
4725bd8deadSopenharmony_ci          // disable window rectangles
4735bd8deadSopenharmony_ci          glWindowRectanglesEXT(GL_EXCLUSIVE, 0, NULL);
4745bd8deadSopenharmony_ci
4755bd8deadSopenharmony_ci    3)  Should all the window rectangles be specified in a single call
4765bd8deadSopenharmony_ci        with the mode?
4775bd8deadSopenharmony_ci
4785bd8deadSopenharmony_ci        RESOLVED:  Yes.
4795bd8deadSopenharmony_ci
4805bd8deadSopenharmony_ci        The expectation is that the configuration of window rectangles
4815bd8deadSopenharmony_ci        is typically updated once per frame.  Hence it makes sense to
4825bd8deadSopenharmony_ci        have a single API call that takes an array of window rectangle
4835bd8deadSopenharmony_ci        boxes rather than requiring one call to specify each window
4845bd8deadSopenharmony_ci        rectangle box.  This means all the window rectangles must be
4855bd8deadSopenharmony_ci        specified "as a unit" but this is likely an advantage.
4865bd8deadSopenharmony_ci
4875bd8deadSopenharmony_ci    4)  What performance expectations should applications have when
4885bd8deadSopenharmony_ci        window rectangles are configured?
4895bd8deadSopenharmony_ci
4905bd8deadSopenharmony_ci        RESOLVED:  Applications should assume window rectangles
4915bd8deadSopenharmony_ci        discard work (rasterized fragments) and there is effectively
4925bd8deadSopenharmony_ci        no cost to enable the window rectangles, even including the
4935bd8deadSopenharmony_ci        implementation-dependent limit number of window rectangles.
4945bd8deadSopenharmony_ci
4955bd8deadSopenharmony_ci    5)  How does this extension's window rectangles interact with OpenGL's
4965bd8deadSopenharmony_ci        existing scissor test functionality?
4975bd8deadSopenharmony_ci
4985bd8deadSopenharmony_ci        RESOLVED:  The scissor test and window rectangles are orthogonal.
4995bd8deadSopenharmony_ci
5005bd8deadSopenharmony_ci        In window rectangle inclusive mode, a fragment survives the
5015bd8deadSopenharmony_ci        scissor test and window rectangles when the fragment's window space
5025bd8deadSopenharmony_ci        position is within any one of the window rectangles and also
5035bd8deadSopenharmony_ci        inside the scissor box.
5045bd8deadSopenharmony_ci
5055bd8deadSopenharmony_ci        In window rectangle exclusive mode, a fragment survives the
5065bd8deadSopenharmony_ci        scissor test and window rectangles when the fragment's window
5075bd8deadSopenharmony_ci        space position is within the scissor box and NOT within any of
5085bd8deadSopenharmony_ci        the window rectangles.
5095bd8deadSopenharmony_ci
5105bd8deadSopenharmony_ci    6)  What should an application do if it needs more than the
5115bd8deadSopenharmony_ci        implementation-dependent maximum number of window rectangles?
5125bd8deadSopenharmony_ci
5135bd8deadSopenharmony_ci        RESOLVED:  The application can use stencil testing as a way to
5145bd8deadSopenharmony_ci        simulate more than the implementation-dependent maximum.
5155bd8deadSopenharmony_ci
5165bd8deadSopenharmony_ci        The application may find it is possible to express a more complex
5175bd8deadSopenharmony_ci        clipping region by merging or overlapping window rectangles.
5185bd8deadSopenharmony_ci
5195bd8deadSopenharmony_ci    7)  What are some intended applications for this extension?
5205bd8deadSopenharmony_ci
5215bd8deadSopenharmony_ci        RESOLVED:  There are several envisioned applications:
5225bd8deadSopenharmony_ci
5235bd8deadSopenharmony_ci        a)  For a simple user interface managed in OpenGL, the window
5245bd8deadSopenharmony_ci            rectangles in exclusive mode can be used to avoid rendering
5255bd8deadSopenharmony_ci            into one or more rectangular sub-windows, dialog boxes,
5265bd8deadSopenharmony_ci            or menus "overlapping" some rendering window.
5275bd8deadSopenharmony_ci
5285bd8deadSopenharmony_ci            While stencil testing could be used in this application,
5295bd8deadSopenharmony_ci            that requires rendering the extents of all the windows into
5305bd8deadSopenharmony_ci            the stencil buffer.  Managing exclusive window rectangles
5315bd8deadSopenharmony_ci            is simpler for simple configurations and leaves the stencil
5325bd8deadSopenharmony_ci            buffer for other purposes.
5335bd8deadSopenharmony_ci
5345bd8deadSopenharmony_ci        b)  Minimizing rasterization to non-animating regions of a
5355bd8deadSopenharmony_ci            framebuffer.  Say much of the background of a game is not
5365bd8deadSopenharmony_ci            actually updating; for example, a board game or puzzle game
5375bd8deadSopenharmony_ci            where rendering updates are highly localized.  Inclusive
5385bd8deadSopenharmony_ci            rectangles can restrict rendering to just the rectangles
5395bd8deadSopenharmony_ci            of the screen that require updates.
5405bd8deadSopenharmony_ci
5415bd8deadSopenharmony_ci            The scissor could be used for this purpose but would
5425bd8deadSopenharmony_ci            only represent a single rectangle so the application would
5435bd8deadSopenharmony_ci            have to repeat the rendering process multiple times at
5445bd8deadSopenharmony_ci            different scissor locations.
5455bd8deadSopenharmony_ci
5465bd8deadSopenharmony_ci    8)  Does the window rectangles test affect rasterization of geometric
5475bd8deadSopenharmony_ci        primitive (polygons, lines, points), image rectangles (glBitmap,
5485bd8deadSopenharmony_ci        glDrawPixels, glCopyPixels), and path rendering?
5495bd8deadSopenharmony_ci
5505bd8deadSopenharmony_ci        RESOLVED:  Yes.
5515bd8deadSopenharmony_ci
5525bd8deadSopenharmony_ci    9)  Does the window rectangles test affect clears?
5535bd8deadSopenharmony_ci
5545bd8deadSopenharmony_ci        RESOLVED:  Yes.
5555bd8deadSopenharmony_ci
5565bd8deadSopenharmony_ci    10) If you specify a subset (or none) of the window rectangles,
5575bd8deadSopenharmony_ci        what happens to the state of the unspecified window rectangles?
5585bd8deadSopenharmony_ci
5595bd8deadSopenharmony_ci        RESOLVED:  The state of such boxes is set to (0,0,0,0).
5605bd8deadSopenharmony_ci
5615bd8deadSopenharmony_ci        This only matters to the extent that you can query that state
5625bd8deadSopenharmony_ci        with glGetIntegerv_i, etc. and get reliable values returned.
5635bd8deadSopenharmony_ci
5645bd8deadSopenharmony_ci    11) What if negative values are specified for box coordinates?
5655bd8deadSopenharmony_ci
5665bd8deadSopenharmony_ci        RESOLVED:  The values of the window rectangles box elements are
5675bd8deadSopenharmony_ci        typed GLint, however the width and height parameters of each
5685bd8deadSopenharmony_ci        box are required to be non-negative (otherwise GL_INVALID_VALUE
5695bd8deadSopenharmony_ci        results).
5705bd8deadSopenharmony_ci
5715bd8deadSopenharmony_ci        This matches the behavior of existing commands such
5725bd8deadSopenharmony_ci        as glScissorArrayv and glViewportArrayv, part of the
5735bd8deadSopenharmony_ci        ARB_viewport_array extension.
5745bd8deadSopenharmony_ci        
5755bd8deadSopenharmony_ci    12) What about really huge values for the box coordinates?
5765bd8deadSopenharmony_ci
5775bd8deadSopenharmony_ci        RESOLVED:  That should be fine.  In theory, OpenGL has an
5785bd8deadSopenharmony_ci        implementation-dependent limit GL_MAX_VIEWPORT_DIMS so there is
5795bd8deadSopenharmony_ci        a bound on the (xw,yw) of rasterized fragments.
5805bd8deadSopenharmony_ci
5815bd8deadSopenharmony_ci        There is not any implicit or explicit clamping of the box
5825bd8deadSopenharmony_ci        coordinates.
5835bd8deadSopenharmony_ci
5845bd8deadSopenharmony_ci    13) What happens when the window rectangles mode is GL_INCLUSIVE_EXT but
5855bd8deadSopenharmony_ci        zero window rectangles are specified?
5865bd8deadSopenharmony_ci
5875bd8deadSopenharmony_ci        RESOLVED:  All rasterization and clearing is discarded.  Effectively
5885bd8deadSopenharmony_ci        there's no way for a fragment to be "inside" the window clips
5895bd8deadSopenharmony_ci        if there are none.
5905bd8deadSopenharmony_ci
5915bd8deadSopenharmony_ci        This is just one of many ways to throw away all rasterized
5925bd8deadSopenharmony_ci        fragments in OpenGL.  A similiar effect could be accomplished with
5935bd8deadSopenharmony_ci        a zero width or height scissor (or zero width and height inclusive
5945bd8deadSopenharmony_ci        window rectangles for that matter).
5955bd8deadSopenharmony_ci
5965bd8deadSopenharmony_ci        This behavior is why GL_EXCLUSIVE_EXT is the initial context state.
5975bd8deadSopenharmony_ci
5985bd8deadSopenharmony_ci    14) Should this work when rendering to windows?
5995bd8deadSopenharmony_ci    
6005bd8deadSopenharmony_ci        RESOLVED:  No, the hardware functionality for window rectangles
6015bd8deadSopenharmony_ci        may be used by the window system for pixel-ownership tests.  Instead
6025bd8deadSopenharmony_ci        this functionality is limited to FBOs.
6035bd8deadSopenharmony_ci
6045bd8deadSopenharmony_ci    15) Should this work when rendering to non-FBO off-screen rendering
6055bd8deadSopenharmony_ci        resources such pbuffers, GLX bitmaps, and Windows
6065bd8deadSopenharmony_ci        device-independent bitmaps?
6075bd8deadSopenharmony_ci
6085bd8deadSopenharmony_ci        RESOLVED:  No.
6095bd8deadSopenharmony_ci    
6105bd8deadSopenharmony_ci        For simplicity of specification, the language is written to
6115bd8deadSopenharmony_ci        refer only to non-zero framebuffer objects supporting the window
6125bd8deadSopenharmony_ci        rectangles test so pbuffers, etc. wouldn't support the window
6135bd8deadSopenharmony_ci        rectangles test.
6145bd8deadSopenharmony_ci
6155bd8deadSopenharmony_ci        Off-screen rendering mechanisms such as pbuffers are legacy
6165bd8deadSopenharmony_ci        mechanisms that predated FBOs so it makes sense to not aggrandize
6175bd8deadSopenharmony_ci        them.  This eases the implementation and testing burden for
6185bd8deadSopenharmony_ci        supporting the window rectangles test.
6195bd8deadSopenharmony_ci
6205bd8deadSopenharmony_ci    16) Should the viewport index index into an array of window rectangle
6215bd8deadSopenharmony_ci        arrays, similar to viewport and scissor arrays?
6225bd8deadSopenharmony_ci
6235bd8deadSopenharmony_ci        RESOLVED:  No.  This functionality is disconnected from the
6245bd8deadSopenharmony_ci        viewport index (see ARB_viewport_array) but orthogonal to that
6255bd8deadSopenharmony_ci        functionality.
6265bd8deadSopenharmony_ci
6275bd8deadSopenharmony_ci        The current set of window rectangles applies to rasterization
6285bd8deadSopenharmony_ci        independent of the viewport index.
6295bd8deadSopenharmony_ci
6305bd8deadSopenharmony_ci    17) Does the window rectangles test affect glBlitFramebuffer and
6315bd8deadSopenharmony_ci        similar blit operations?
6325bd8deadSopenharmony_ci
6335bd8deadSopenharmony_ci        RESOLVED:  Yes.
6345bd8deadSopenharmony_ci
6355bd8deadSopenharmony_ci        One of the key applications is limiting opaque compositing so
6365bd8deadSopenharmony_ci        clipping blit framebuffer operations is important to support.
6375bd8deadSopenharmony_ci
6385bd8deadSopenharmony_ci    18) Does the window rectangles test affect glAccum operations?
6395bd8deadSopenharmony_ci
6405bd8deadSopenharmony_ci        RESOLVED:  No, because framebuffer objects do not support
6415bd8deadSopenharmony_ci        accumulation buffer attachments and the window rectangles test
6425bd8deadSopenharmony_ci        only operates on FBOs (see issue 15).
6435bd8deadSopenharmony_ci
6445bd8deadSopenharmony_ci        If support for accumulation buffer bindings were supported for
6455bd8deadSopenharmony_ci        FBOs (as unlikely though would be), it would make sense for
6465bd8deadSopenharmony_ci        language to be added to support window rectangles on FBOs.
6475bd8deadSopenharmony_ci        That language would read:
6485bd8deadSopenharmony_ci
6495bd8deadSopenharmony_ci         -- Update section 17.4.5 "The Accumulation Buffer"
6505bd8deadSopenharmony_ci        
6515bd8deadSopenharmony_ci            Change the second paragraph's first sentence to read:
6525bd8deadSopenharmony_ci        
6535bd8deadSopenharmony_ci            "When the scissor test is enabled (section 17.3.2), then only those
6545bd8deadSopenharmony_ci            pixels within the current scissor box are updated by any Accum
6555bd8deadSopenharmony_ci            operation; otherwise, all pixels in the window that survive the
6565bd8deadSopenharmony_ci            window rectangles test (section 17.3.X) are updated."
6575bd8deadSopenharmony_ci        
6585bd8deadSopenharmony_ci            Change the second sentence of the fifth paragraph to read:
6595bd8deadSopenharmony_ci        
6605bd8deadSopenharmony_ci            "If fragment color clamping is enabled, the results are then clamped
6615bd8deadSopenharmony_ci            to the range [0,1]. The resulting color value is placed in the
6625bd8deadSopenharmony_ci            buffers currently enabled for color writing as if it were a fragment
6635bd8deadSopenharmony_ci            produced from rasterization, except that the only per-fragment
6645bd8deadSopenharmony_ci            operations that are applied (if enabled) are the pixel ownership
6655bd8deadSopenharmony_ci            test, the window rectangles test (section 17.3.X), the scissor test
6665bd8deadSopenharmony_ci            (section 17.3.2), sRGB conversion (see section 17.3.9), and dithering
6675bd8deadSopenharmony_ci            (section 17.3.10)."
6685bd8deadSopenharmony_ci
6695bd8deadSopenharmony_ci    19) Is glInvalidateSubFramebuffer affected by window rectangles test?
6705bd8deadSopenharmony_ci
6715bd8deadSopenharmony_ci        RESOLVED:  No.  The window rectangles test applies to
6725bd8deadSopenharmony_ci        rasterization, and invalidating a region of the framebuffer is
6735bd8deadSopenharmony_ci        not a rasterization operation.
6745bd8deadSopenharmony_ci
6755bd8deadSopenharmony_ci    20) Should the window rectangles state be subject to
6765bd8deadSopenharmony_ci        glPushAttrib/glPopAttrib?
6775bd8deadSopenharmony_ci
6785bd8deadSopenharmony_ci        RESOLVED:  Yes, as part of the GL_SCISSOR_BIT state.
6795bd8deadSopenharmony_ci
6805bd8deadSopenharmony_ci        Being able to push/pop window rectangles is a natural notion for
6815bd8deadSopenharmony_ci        hierachical clipping.  The scissor state group is most similar
6825bd8deadSopenharmony_ci        to window rectangles.
6835bd8deadSopenharmony_ci
6845bd8deadSopenharmony_ci    21) Since shader memory accesses are possible from a fragment shader,
6855bd8deadSopenharmony_ci        can side effects from shader execution occur before the window
6865bd8deadSopenharmony_ci        rectangles test discards fragments?
6875bd8deadSopenharmony_ci
6885bd8deadSopenharmony_ci        RESOLVED:  No.
6895bd8deadSopenharmony_ci
6905bd8deadSopenharmony_ci        No changes are made to section 7.12.1 "Shader Memory Access
6915bd8deadSopenharmony_ci        Ordering" when the window rectangles test is supported.
6925bd8deadSopenharmony_ci        An implementation could implement the window rectangles test
6935bd8deadSopenharmony_ci        as a fragment shader prologue, but if so, it needs to happen
6945bd8deadSopenharmony_ci        before any fragment shader side-effects that might occur if the
6955bd8deadSopenharmony_ci        fragment was not discarded by the window rectangles test.
6965bd8deadSopenharmony_ci
6975bd8deadSopenharmony_ci    22) Can a software rasterizer efficiently exploit this functionality?
6985bd8deadSopenharmony_ci
6995bd8deadSopenharmony_ci        RESOLVED:  Yes.  For an existing software rasterizer, the window
7005bd8deadSopenharmony_ci        rectangles test could be implementing naively, just testing every
7015bd8deadSopenharmony_ci        pixel position against all the active inclusive or exclusive
7025bd8deadSopenharmony_ci        window rectanges.
7035bd8deadSopenharmony_ci
7045bd8deadSopenharmony_ci        For a bit more sophisticated software rasterizer, the nice thing
7055bd8deadSopenharmony_ci        is the window rectangles are "known up front" so they can be
7065bd8deadSopenharmony_ci        statically Y-sorted and then X-sorted for primitives bounding
7075bd8deadSopenharmony_ci        boxes to minimize the window rectangle intersection costs.  In a
7085bd8deadSopenharmony_ci        smart scan-line rasterizer, once you detect and excluded pixel
7095bd8deadSopenharmony_ci        position, you can skip over pixels to advance past exclusive
7105bd8deadSopenharmony_ci        window rectangles rather than naively testing every fragment.
7115bd8deadSopenharmony_ci        MMX should be useful for it.
7125bd8deadSopenharmony_ci
7135bd8deadSopenharmony_ci    23) Is this functionality useful for rendering virtual reality eye
7145bd8deadSopenharmony_ci        views?
7155bd8deadSopenharmony_ci
7165bd8deadSopenharmony_ci        RESOLVED:  Yes.  Often when rendering to a view frustum for a
7175bd8deadSopenharmony_ci        virtual reality eye view, the edges of the field of view are
7185bd8deadSopenharmony_ci        not do not contribute to the warped version of the image to be
7195bd8deadSopenharmony_ci        displayed on the Head Mounted Display (HMD).
7205bd8deadSopenharmony_ci
7215bd8deadSopenharmony_ci        By overlapping multiple inclusive window rectangles, the shape
7225bd8deadSopenharmony_ci        of an stair-stepped approximate circle or ellipse can be formed
7235bd8deadSopenharmony_ci        so rasterization to the corners is skipped.
7245bd8deadSopenharmony_ci
7255bd8deadSopenharmony_ci    24) Can the glWindowRectanglesEXT command be compiled into a display
7265bd8deadSopenharmony_ci        list?
7275bd8deadSopenharmony_ci
7285bd8deadSopenharmony_ci        RESOLVED:  Yes (as the specification language does not say
7295bd8deadSopenharmony_ci        otherwise) and the command is a rendering state command logically
7305bd8deadSopenharmony_ci        similar to glScissor and glViewport.
7315bd8deadSopenharmony_ci
7325bd8deadSopenharmony_ci    25) How does the window rectangles test operated in layered
7335bd8deadSopenharmony_ci        framebuffer (see section 9.8) rendering?
7345bd8deadSopenharmony_ci
7355bd8deadSopenharmony_ci        RESOLVED:  The window rectangles test affects rendering to any
7365bd8deadSopenharmony_ci        and all layers.  The test itself just depends on the window
7375bd8deadSopenharmony_ci        coordinates of a pixel, not its layer.
7385bd8deadSopenharmony_ci
7395bd8deadSopenharmony_ci    26) Does the window rectangles state affect glReadPixels or the
7405bd8deadSopenharmony_ci        reading of pixels by glCopyPixels or glBlitFramebuffer?
7415bd8deadSopenharmony_ci
7425bd8deadSopenharmony_ci        RESOLVED:  No.  The window rectangles test is a fragment operation
7435bd8deadSopenharmony_ci        for pixel updates.  Pixel values are read irrespective of the
7445bd8deadSopenharmony_ci        window rectangles test state.  This is matches the behavior of
7455bd8deadSopenharmony_ci        the existing scissor test.
7465bd8deadSopenharmony_ci
7475bd8deadSopenharmony_ci        That said, the window rectangles test does affect the
7485bd8deadSopenharmony_ci        blitted/copied pixel written by glBlitFramebuffer and glCopyPixels
7495bd8deadSopenharmony_ci        operations.  This could allow an implementation to skip reading
7505bd8deadSopenharmony_ci        pixels that will be discarded by the window rectangles test on
7515bd8deadSopenharmony_ci        the pixel update operations that are discarded by the window
7525bd8deadSopenharmony_ci        rectangles test on a blit or copy operation.
7535bd8deadSopenharmony_ci
7545bd8deadSopenharmony_ci    27) Is this extension functionally and interface identical in its
7555bd8deadSopenharmony_ci        OpenGL and ES versions?
7565bd8deadSopenharmony_ci
7575bd8deadSopenharmony_ci        RESOLVED:  Yes, the API and functionality is identical.
7585bd8deadSopenharmony_ci
7595bd8deadSopenharmony_ci    28) What should the minimum implementation-dependent limit for
7605bd8deadSopenharmony_ci        GL_MAX_WINDOW_RECTANGLES_EXT be?
7615bd8deadSopenharmony_ci
7625bd8deadSopenharmony_ci        RESOLVED:  4 (was 8 originally).
7635bd8deadSopenharmony_ci
7645bd8deadSopenharmony_ci        While NVIDIA GPUs can support 8 window rectangles, feedback from
7655bd8deadSopenharmony_ci        AMD is they could support the extension if the limit was 4.
7665bd8deadSopenharmony_ci
7675bd8deadSopenharmony_ci    29) Is there a Vulkan version of this functionality?
7685bd8deadSopenharmony_ci    
7695bd8deadSopenharmony_ci        RESOLVED:  Yes, VK_EXT_discard_rectangles.  See:
7705bd8deadSopenharmony_ci
7715bd8deadSopenharmony_ci        https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VK_EXT_discard_rectangles
7725bd8deadSopenharmony_ci        
7735bd8deadSopenharmony_ciRevision History
7745bd8deadSopenharmony_ci
7755bd8deadSopenharmony_ci    Rev.    Date    Author     Changes
7765bd8deadSopenharmony_ci    ----  -------- ---------  ------------------------------------------------
7775bd8deadSopenharmony_ci    1     06/09/16 mjk        Public release
7785bd8deadSopenharmony_ci    2     06/27/16 mjk        Change limit to 4 based on AMD feedback
7795bd8deadSopenharmony_ci    3     11/03/17 mjk        Fix state table for limit of 4, add issue 29
780