15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    QCOM_tiled_rendering
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_QCOM_tiled_rendering
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Colin Sharp
125bd8deadSopenharmony_ci    Jeff Leger
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciContacts
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    Chuck Smith, Qualcomm (chucks 'at' qualcomm.com)
175bd8deadSopenharmony_ci    Maurice Ribble, Qualcomm (mribble 'at' qualcomm.com)
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ciNotice
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ci    Copyright Qualcomm 2009.
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciIP Status
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    Qualcomm Proprietary.
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ciStatus
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    Complete.
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciVersion
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    Last Modified Date: August 20, 2009
345bd8deadSopenharmony_ci    Revision: #1.6
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ciNumber
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    OpenGL ES Extension #70
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ciDependencies
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    OpenGL ES 1.0 or higher is required.
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    This extension interacts with QCOM_write_only_rendering.
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    This extension is written based on the wording of the OpenGL ES 2.0
475bd8deadSopenharmony_ci    specification.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ciOverview
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    In the handheld graphics space, a typical challenge is achieving efficient
525bd8deadSopenharmony_ci    rendering performance given the different characteristics of the various
535bd8deadSopenharmony_ci    types of graphics memory.  Some types of memory ("slow" memory) are less
545bd8deadSopenharmony_ci    expensive but have low bandwidth, higher latency, and/or higher power
555bd8deadSopenharmony_ci    consumption, while other types ("fast" memory) are more expensive but have
565bd8deadSopenharmony_ci    higher bandwidth, lower latency, and/or lower power consumption.  In many
575bd8deadSopenharmony_ci    cases, it is more efficient for a graphics processing unit (GPU) to render
585bd8deadSopenharmony_ci    directly to fast memory, but at most common display resolutions it is not
595bd8deadSopenharmony_ci    practical for a device to contain enough fast memory to accommodate both the
605bd8deadSopenharmony_ci    full color and depth/stencil buffers (the frame buffer).  In some devices,
615bd8deadSopenharmony_ci    this problem can be addressed by providing both types of memory; a large
625bd8deadSopenharmony_ci    amount of slow memory that is sufficient to store the entire frame buffer,
635bd8deadSopenharmony_ci    and a small, dedicated amount of fast memory that allows the GPU to render
645bd8deadSopenharmony_ci    with optimal performance.  The challenge lies in finding a way for the GPU
655bd8deadSopenharmony_ci    to render to fast memory when it is not large enough to contain the actual
665bd8deadSopenharmony_ci    frame buffer.
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    One approach to solving this problem is to design the GPU and/or driver
695bd8deadSopenharmony_ci    using a tiled rendering architecture.  With this approach the render target
705bd8deadSopenharmony_ci    is subdivided into a number of individual tiles, which are sized to fit
715bd8deadSopenharmony_ci    within the available amount of fast memory.  Under normal operation, the
725bd8deadSopenharmony_ci    entire scene will be rendered to each individual tile using a multi-pass
735bd8deadSopenharmony_ci    technique, in which primitives that lie entirely outside of the tile being
745bd8deadSopenharmony_ci    rendered are trivially discarded.  After each tile has been rendered, its
755bd8deadSopenharmony_ci    contents are saved out to the actual frame buffer in slow memory (a process
765bd8deadSopenharmony_ci    referred to as the "resolve").  The resolve introduces significant overhead,
775bd8deadSopenharmony_ci    both for the CPU and the GPU.  However, even with this additional overhead,
785bd8deadSopenharmony_ci    rendering using this method is usually more efficient than rendering
795bd8deadSopenharmony_ci    directly to slow memory.
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci    This extension allows the application to specify a rectangular tile
825bd8deadSopenharmony_ci    rendering area and have full control over the resolves for that area.  The
835bd8deadSopenharmony_ci    information given to the driver through this API can be used to perform
845bd8deadSopenharmony_ci    various optimizations in the driver and hardware.  One example optimization
855bd8deadSopenharmony_ci    is being able to reduce the size or number of the resolves.  Another
865bd8deadSopenharmony_ci    optimization might be to reduce the number of passes needed in the tiling
875bd8deadSopenharmony_ci    approach mentioned above.  Even traditional rendering GPUs that don't use
885bd8deadSopenharmony_ci    tiles may benefit from this extension depending on their implemention of
895bd8deadSopenharmony_ci    certain common GPU operations.
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    One typical use case could involve an application only rendering to select
925bd8deadSopenharmony_ci    portions of the render target using this technique (which shall be referred
935bd8deadSopenharmony_ci    to as "application tiling"), leaving all other portions of the render target
945bd8deadSopenharmony_ci    untouched.  Therefore, in order to preserve the contents of the untouched
955bd8deadSopenharmony_ci    portions of the render target, the application must request an EGL (or other
965bd8deadSopenharmony_ci    context management API) configuration with a non-destructive swap. A
975bd8deadSopenharmony_ci    destructive swap may only be used safely if the application renders to the
985bd8deadSopenharmony_ci    entire area of the render target during each frame (otherwise the contents
995bd8deadSopenharmony_ci    of the untouched portions of the frame buffer will be undefined).
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ci    Additionally, care must be taken to avoid the cost of mixing rendering with
1025bd8deadSopenharmony_ci    and without application tiling within a single frame.  Rendering without
1035bd8deadSopenharmony_ci    application tiling ("normal" rendering) is most efficient when all of the
1045bd8deadSopenharmony_ci    rendering for the entire scene can be encompassed within a single resolve.
1055bd8deadSopenharmony_ci    If any portions of the scene are rendered prior to that resolve (such as via
1065bd8deadSopenharmony_ci    a prior resolve, or via application tiling), then that resolve becomes much
1075bd8deadSopenharmony_ci    more heavyweight.  When this occurs, prior to rendering each tile the fast
1085bd8deadSopenharmony_ci    memory must be populated with the existing contents of the frame buffer
1095bd8deadSopenharmony_ci    region corresponding to that tile.  This operation can double the cost of
1105bd8deadSopenharmony_ci    resolves, so it is recommended that applications avoid mixing application
1115bd8deadSopenharmony_ci    tiling and normal rendering within a single frame.  If both rendering
1125bd8deadSopenharmony_ci    methods must be used in the same frame, then the most efficient approach is
1135bd8deadSopenharmony_ci    to perform all normal rendering first, followed by rendering done with
1145bd8deadSopenharmony_ci    application tiling.  An implicit resolve will occur (if needed) at the start
1155bd8deadSopenharmony_ci    of application tiling, so any pending normal rendering operations will be
1165bd8deadSopenharmony_ci    flushed at the time application tiling is initiated.  This extension
1175bd8deadSopenharmony_ci    provides interfaces for the application to communicate to the driver whether
1185bd8deadSopenharmony_ci    or not rendering done with application tiling depends on the existing
1195bd8deadSopenharmony_ci    contents of the specified tile, and whether or not the rendered contents of
1205bd8deadSopenharmony_ci    the specified tile need to be preserved upon completion.  This mechanism can
1215bd8deadSopenharmony_ci    be used to obtain optimal performance, e.g. when the application knows that
1225bd8deadSopenharmony_ci    every pixel in a tile will be completely rendered or when the resulting
1235bd8deadSopenharmony_ci    contents of the depth/stencil buffers do not need to be preserved.
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ciIssues
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    (1)  How do Viewport and Scissor interact with this extension?
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    RESOLVED:  They don't.  When application tiling is used, the viewport and
1305bd8deadSopenharmony_ci    scissor retain their existing values, relative to the render target, not the
1315bd8deadSopenharmony_ci    specified tile.  Therefore, all rendering commands issued between
1325bd8deadSopenharmony_ci    StartTilingQCOM and EndTilingQCOM will be subject to the same scissor, and
1335bd8deadSopenharmony_ci    will undergo the same viewport transformation, as normal rendering commands.
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci    (2)  How do Flush and Finish interact with this extension?
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    RESOLVED:  When Flush or Finish is called while application tiling is
1385bd8deadSopenharmony_ci    active, the behavior will be as if EndTilingQCOM was called, except that the
1395bd8deadSopenharmony_ci    application tiling state will remain unchanged (meaning the active tile will
1405bd8deadSopenharmony_ci    not be reset).  This means that any pending rendering commands will be
1415bd8deadSopenharmony_ci    performed to the active tile, and application tiling will continue to be
1425bd8deadSopenharmony_ci    active for any following rendering commands.
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    (3)  How does SwapBuffers interact with this extension?
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    RESOLVED:  It doesn't.  If SwapBuffers is called while application tiling is
1475bd8deadSopenharmony_ci    active, the contents of the entire back buffer will be copied to the visible
1485bd8deadSopenharmony_ci    window, ignoring the active tile.  SwapBuffers will have no effect on the
1495bd8deadSopenharmony_ci    application tiling state.
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci    (4)  What happens if the render target is changed while application tiling
1525bd8deadSopenharmony_ci         is active?
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci    RESOLVED:  If the current render target is changed, either by binding a new
1555bd8deadSopenharmony_ci    framebuffer object or changing the write surface of the active framebuffer
1565bd8deadSopenharmony_ci    (either explicitly or by deleting the currently bound framebuffer or write
1575bd8deadSopenharmony_ci    surface), an implicit EndTilingQCOM will occur.  The active tile will be
1585bd8deadSopenharmony_ci    reset and application tiling will be deactivated.  This is necessary because
1595bd8deadSopenharmony_ci    the active tile may not be valid for the new render target.
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    (5)  Should this extension provide a query mechanism for determining things
1625bd8deadSopenharmony_ci         such as tile offset, alignment, and size requirements so a developer
1635bd8deadSopenharmony_ci         can intelligently choose tile regions?
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci    RESOLVED:  No.  This information is very device-dependent and difficult to
1665bd8deadSopenharmony_ci    present in an easily understood manner.  Instead, this extension will let
1675bd8deadSopenharmony_ci    developers specify an arbitrary rectangular tile region and all these
1685bd8deadSopenharmony_ci    requirements, including subdividing the given tile into multiple tiles if
1695bd8deadSopenharmony_ci    necessary, will be handled by the driver and hardware.
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci    (6)  Should this extension allow multiple tiles?
1725bd8deadSopenharmony_ci
1735bd8deadSopenharmony_ci    RESOLVED:  No.  While earlier versions of this extension allowed for this,
1745bd8deadSopenharmony_ci    after support for arbitrary tile sizes was added the benefit of multiple
1755bd8deadSopenharmony_ci    tiles became negligible.  Allowing multiple tiles complicated the API and
1765bd8deadSopenharmony_ci    made it much more difficult for traditional rendering and some tile-based
1775bd8deadSopenharmony_ci    rendering GPUs to support this extension.
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci    (7)  Should multiple render targets be supported?  They are not supported
1805bd8deadSopenharmony_ci         by either the OpenGL ES core specification or any existing OpenGL ES
1815bd8deadSopenharmony_ci         extensions.  Support could be added with some new bitmasks for the
1825bd8deadSopenharmony_ci         <preserveMask> parameter.  Should this be added now, or deferred for
1835bd8deadSopenharmony_ci         inclusion in any possible future MRT extension?
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    RESOLVED:  Yes.  It is not difficult to add now and doing it now makes 
1865bd8deadSopenharmony_ci    supporting MRTs in the future easier.
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ciNew Procedures and Functions
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    void StartTilingQCOM(uint x, uint y, uint width, uint height,
1915bd8deadSopenharmony_ci                         bitfield preserveMask);
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci    void EndTilingQCOM(bitfield preserveMask);
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ciNew Tokens
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    Accepted by the <preserveMask> parameter of StartTilingQCOM and
1985bd8deadSopenharmony_ci    EndTilingQCOM
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci        GL_COLOR_BUFFER_BIT0_QCOM                     0x00000001
2015bd8deadSopenharmony_ci        GL_COLOR_BUFFER_BIT1_QCOM                     0x00000002
2025bd8deadSopenharmony_ci        GL_COLOR_BUFFER_BIT2_QCOM                     0x00000004
2035bd8deadSopenharmony_ci        GL_COLOR_BUFFER_BIT3_QCOM                     0x00000008
2045bd8deadSopenharmony_ci        GL_COLOR_BUFFER_BIT4_QCOM                     0x00000010
2055bd8deadSopenharmony_ci        GL_COLOR_BUFFER_BIT5_QCOM                     0x00000020
2065bd8deadSopenharmony_ci        GL_COLOR_BUFFER_BIT6_QCOM                     0x00000040
2075bd8deadSopenharmony_ci        GL_COLOR_BUFFER_BIT7_QCOM                     0x00000080
2085bd8deadSopenharmony_ci        GL_DEPTH_BUFFER_BIT0_QCOM                     0x00000100
2095bd8deadSopenharmony_ci        GL_DEPTH_BUFFER_BIT1_QCOM                     0x00000200
2105bd8deadSopenharmony_ci        GL_DEPTH_BUFFER_BIT2_QCOM                     0x00000400
2115bd8deadSopenharmony_ci        GL_DEPTH_BUFFER_BIT3_QCOM                     0x00000800
2125bd8deadSopenharmony_ci        GL_DEPTH_BUFFER_BIT4_QCOM                     0x00001000
2135bd8deadSopenharmony_ci        GL_DEPTH_BUFFER_BIT5_QCOM                     0x00002000
2145bd8deadSopenharmony_ci        GL_DEPTH_BUFFER_BIT6_QCOM                     0x00004000
2155bd8deadSopenharmony_ci        GL_DEPTH_BUFFER_BIT7_QCOM                     0x00008000
2165bd8deadSopenharmony_ci        GL_STENCIL_BUFFER_BIT0_QCOM                   0x00010000
2175bd8deadSopenharmony_ci        GL_STENCIL_BUFFER_BIT1_QCOM                   0x00020000
2185bd8deadSopenharmony_ci        GL_STENCIL_BUFFER_BIT2_QCOM                   0x00040000
2195bd8deadSopenharmony_ci        GL_STENCIL_BUFFER_BIT3_QCOM                   0x00080000
2205bd8deadSopenharmony_ci        GL_STENCIL_BUFFER_BIT4_QCOM                   0x00100000
2215bd8deadSopenharmony_ci        GL_STENCIL_BUFFER_BIT5_QCOM                   0x00200000
2225bd8deadSopenharmony_ci        GL_STENCIL_BUFFER_BIT6_QCOM                   0x00400000
2235bd8deadSopenharmony_ci        GL_STENCIL_BUFFER_BIT7_QCOM                   0x00800000
2245bd8deadSopenharmony_ci        GL_MULTISAMPLE_BUFFER_BIT0_QCOM               0x01000000
2255bd8deadSopenharmony_ci        GL_MULTISAMPLE_BUFFER_BIT1_QCOM               0x02000000
2265bd8deadSopenharmony_ci        GL_MULTISAMPLE_BUFFER_BIT2_QCOM               0x04000000
2275bd8deadSopenharmony_ci        GL_MULTISAMPLE_BUFFER_BIT3_QCOM               0x08000000
2285bd8deadSopenharmony_ci        GL_MULTISAMPLE_BUFFER_BIT4_QCOM               0x10000000
2295bd8deadSopenharmony_ci        GL_MULTISAMPLE_BUFFER_BIT5_QCOM               0x20000000
2305bd8deadSopenharmony_ci        GL_MULTISAMPLE_BUFFER_BIT6_QCOM               0x40000000
2315bd8deadSopenharmony_ci        GL_MULTISAMPLE_BUFFER_BIT7_QCOM               0x80000000
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL Operation)
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci    Add a new section "Rendering with Application Tiling" after section 2.13:
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ci    "2.14 Rendering with Application Tiling
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci    The application may specify an arbitrary rectangular region (a 'tile') to
2405bd8deadSopenharmony_ci    which rendering commands should be restricted.
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci    The command
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci        void StartTilingQCOM(uint x, uint y, uint width, uint height,
2455bd8deadSopenharmony_ci                             bitfield preserveMask);
2465bd8deadSopenharmony_ci
2475bd8deadSopenharmony_ci    specifies the tile described by <x>, <y>, <width>, <height>.  Until the next
2485bd8deadSopenharmony_ci    call to EndTilingQCOM, all rendering commands (including clears) will only
2495bd8deadSopenharmony_ci    update the contents of the render target defined by the extents of this
2505bd8deadSopenharmony_ci    tile.  The parameters <x> and <y> specify the screen-space origin of the
2515bd8deadSopenharmony_ci    tile, and <width> and <height> specify the screen-space width and height of
2525bd8deadSopenharmony_ci    the tile.  The tile origin is located at the lower left corner of the tile.
2535bd8deadSopenharmony_ci    If the size of the tile is too large for the fast memory on the device then
2545bd8deadSopenharmony_ci    it will be internally subdivided into multiple tiles.  The parameter
2555bd8deadSopenharmony_ci    <preserveMask> is the bitwise OR of a number of values indicating which
2565bd8deadSopenharmony_ci    buffers need to be initialized with the existing contents of the frame
2575bd8deadSopenharmony_ci    buffer region corresponding to the specified tile prior to rendering, or the
2585bd8deadSopenharmony_ci    single value NONE.  The values allowed are COLOR_BUFFER_BIT*_QCOM,
2595bd8deadSopenharmony_ci    DEPTH_BUFFER_BIT*_QCOM, STENCIL_BUFFER_BIT*_QCOM, and
2605bd8deadSopenharmony_ci    MULTISAMPLE_BUFFER_BIT*_QCOM.  These indicate the color buffer, the depth
2615bd8deadSopenharmony_ci    buffer, the stencil buffer, and a multisample buffer modifier, respectively.
2625bd8deadSopenharmony_ci    The multisample bits are different since they modify the meaning of the
2635bd8deadSopenharmony_ci    color, depth, and stencil bits if the active surface is a multisample
2645bd8deadSopenharmony_ci    surface.  If a multisample bit is set then the corresponding color, depth,
2655bd8deadSopenharmony_ci    and/or stencil bit will cause all the samples to be copied across the memory
2665bd8deadSopenharmony_ci    bus in devices that are using fast tiled memory, but if the multisample bit
2675bd8deadSopenharmony_ci    is not set then only a single resolved sample is copied across the bus.  In
2685bd8deadSopenharmony_ci    practice, not setting the multisample bit when rendering to a multisample
2695bd8deadSopenharmony_ci    buffer can greatly improve performance, but could cause small rendering
2705bd8deadSopenharmony_ci    artifacts in some multiple-pass rendering algorithms.  The 0-7 number is to
2715bd8deadSopenharmony_ci    specify which render target is being used.  If multiple render targets are
2725bd8deadSopenharmony_ci    not being used then 0 should be specified.  Any buffers specifed in
2735bd8deadSopenharmony_ci    <preserveMask> that do not exist in the current rendering state will be
2745bd8deadSopenharmony_ci    silently ignored (simlilar to the behavior of Clear).  If NONE is specified,
2755bd8deadSopenharmony_ci    then no buffers will be initialized.  For any buffers not initialized in
2765bd8deadSopenharmony_ci    this manner, the initial contents will be undefined.
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    The values of <x>, <y>, <width> and <height> are silently clamped to the 
2795bd8deadSopenharmony_ci    extents of the render target.
2805bd8deadSopenharmony_ci
2815bd8deadSopenharmony_ci    The command
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci        void EndTilingQCOM(bitfield preserveMask);
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci    notifies the driver that the application has completed all desired rendering
2865bd8deadSopenharmony_ci    to the tile specified by StartTilingQCOM.  This allows the driver to flush
2875bd8deadSopenharmony_ci    the contents of the specified tile to the corresponding region of the render
2885bd8deadSopenharmony_ci    target, and disables application tiling (resuming normal rendering).  The
2895bd8deadSopenharmony_ci    parameter <preserveMask> is specified using the same values as the
2905bd8deadSopenharmony_ci    equivalent argument of StartTilingQCOM, but indicates which buffers need to
2915bd8deadSopenharmony_ci    be preserved upon completion of all rendering commands issued with
2925bd8deadSopenharmony_ci    application tiling.  For any buffers not preserved in this manner, the
2935bd8deadSopenharmony_ci    resulting contents of the buffer regions corresponding to the active tile
2945bd8deadSopenharmony_ci    will be undefined.
2955bd8deadSopenharmony_ci
2965bd8deadSopenharmony_ciGLX Protocol
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci    None.
2995bd8deadSopenharmony_ci
3005bd8deadSopenharmony_ciErrors
3015bd8deadSopenharmony_ci
3025bd8deadSopenharmony_ci    INVALID_OPERATION error is generated if StartTilingQCOM is called while
3035bd8deadSopenharmony_ci    WRITEONLY_RENDERING_QCOM is enabled or the current framebuffer is not
3045bd8deadSopenharmony_ci    framebuffer complete
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci    INVALID_OPERATION error is generated if EndTilingQCOM is called without a
3075bd8deadSopenharmony_ci    corresponding call to StartTilingQCOM
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci    INVALID_OPERATION error is generated if StartTilingQCOM is called after
3105bd8deadSopenharmony_ci    calling StartTilingQCOM without a corresponding call to EndTilingQCOM
3115bd8deadSopenharmony_ci
3125bd8deadSopenharmony_ci    INVALID_OPERATION error is generated if Enable(WRITEONLY_RENDERING_QCOM)
3135bd8deadSopenharmony_ci    is called between StartTilingQCOM and EndTilingQCOM
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ciNew State
3165bd8deadSopenharmony_ci
3175bd8deadSopenharmony_ci    None.
3185bd8deadSopenharmony_ci
3195bd8deadSopenharmony_ciSample Usage
3205bd8deadSopenharmony_ci
3215bd8deadSopenharmony_ci    GLboolean renderTiledTriangle(GLuint x, GLuint y, GLuint width, GLuint height)
3225bd8deadSopenharmony_ci    {
3235bd8deadSopenharmony_ci        // set the active tile and initialize the color and depth buffers with
3245bd8deadSopenharmony_ci        // the existing contents
3255bd8deadSopenharmony_ci        glStartTilingQCOM(x, y, width, height,
3265bd8deadSopenharmony_ci                          GL_COLOR_BUFFER_BIT0_QCOM | GL_DEPTH_BUFFER_BIT0_QCOM);
3275bd8deadSopenharmony_ci      
3285bd8deadSopenharmony_ci        // draw the triangle
3295bd8deadSopenharmony_ci        glDrawArrays(GL_TRIANGLES, 0, 3);
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci        // finished with this tile -- preserve the color buffer
3325bd8deadSopenharmony_ci        glEndTilingQCOM(GL_COLOR_BUFFER_BIT0_QCOM);
3335bd8deadSopenharmony_ci
3345bd8deadSopenharmony_ci        // return success
3355bd8deadSopenharmony_ci        return GL_TRUE;
3365bd8deadSopenharmony_ci    }
3375bd8deadSopenharmony_ci
3385bd8deadSopenharmony_ciRevision History
3395bd8deadSopenharmony_ci
3405bd8deadSopenharmony_ci    #09    08/20/2009    Chuck Smith     Cosmetic changes
3415bd8deadSopenharmony_ci    #08    08/19/2009    Maurice Ribble  Add support for multiple render targets
3425bd8deadSopenharmony_ci    #07    07/28/2009    Maurice Ribble  Clean up spec
3435bd8deadSopenharmony_ci                                         Remove multiple tile support
3445bd8deadSopenharmony_ci    #06    07/23/2009    Maurice Ribble  Updated overview to match latest spec
3455bd8deadSopenharmony_ci    #05    07/15/2009    Maurice Ribble  Changed from spec to subdivide tiles
3465bd8deadSopenharmony_ci                                         instead of returning out of memory
3475bd8deadSopenharmony_ci    #04    07/06/2009    Maurice Ribble  Update due to the AMD->Qualcomm move;
3485bd8deadSopenharmony_ci                                         general extension cleanup.
3495bd8deadSopenharmony_ci    #03    11/17/2008    Chuck Smith     Clarified the results of EndTilingQCOM
3505bd8deadSopenharmony_ci                                         for unpreserved buffers.
3515bd8deadSopenharmony_ci    #02    11/10/2008    Chuck Smith     Updates to clarify behavior; additions
3525bd8deadSopenharmony_ci                                         to the Issues section.
3535bd8deadSopenharmony_ci    #01    11/04/2008    Chuck Smith     First draft.
354