15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_map_buffer_alignment
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_map_buffer_alignment
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Piers Daniell, NVIDIA Corporation (pdaniell 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Jeff Bolz, NVIDIA
165bd8deadSopenharmony_ci    Pat Brown, NVIDIA
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciNotice
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    Copyright (c) 2011-2013 The Khronos Group Inc. Copyright terms at
215bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciSpecification Update Policy
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
265bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
275bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
285bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
295bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
305bd8deadSopenharmony_ci    described in more detail at
315bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciStatus
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    Complete. Approved by the ARB on 2011/06/20.
365bd8deadSopenharmony_ci    Approved by the Khronos Promoters on 2011/07/29.
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ciVersion
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    Last Modified Date:         July 28, 2011
415bd8deadSopenharmony_ci    Revision:                   5
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ciNumber
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    ARB Extension #113
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ciDependencies
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    OpenGL 2.1 is required.
505bd8deadSopenharmony_ci    
515bd8deadSopenharmony_ci    If ARB_map_buffer_range is NOT supported, ignore references to
525bd8deadSopenharmony_ci    MapBufferRange.
535bd8deadSopenharmony_ci    
545bd8deadSopenharmony_ci    This extension is written against The OpenGL 4.1 (Compatibility Profile)
555bd8deadSopenharmony_ci    specification.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ciOverview
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    This extension adds a requirement to the pointer returned by MapBuffer
605bd8deadSopenharmony_ci    and MapBufferRange that they provide a minimum of 64 byte alignment to
615bd8deadSopenharmony_ci    support processing of the data directly with special CPU instructions
625bd8deadSopenharmony_ci    like SSE and AVX.
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ciNew Procedures and Functions
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    None
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ciNew Tokens
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
715bd8deadSopenharmony_ci    GetInteger64v, GetFloatv, and GetDoublev:
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci        MIN_MAP_BUFFER_ALIGNMENT                        0x90BC
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ciChanges to Section 2.9.3 (Mapping and Unmapping Buffer Data), page 60
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    In the third paragraph of the section that starts:
785bd8deadSopenharmony_ci    
795bd8deadSopenharmony_ci    "Pointer values returned by MapBufferRange may not be passed..."
805bd8deadSopenharmony_ci    
815bd8deadSopenharmony_ci    insert the following sentence at the start of the paragraph:
825bd8deadSopenharmony_ci    
835bd8deadSopenharmony_ci    "If no error occurs, the pointer value returned by MapBufferRange must
845bd8deadSopenharmony_ci    reflect an allocation aligned to the value of MIN_MAP_BUFFER_ALIGNMENT
855bd8deadSopenharmony_ci    basic machine units.  Subtracting <offset> basic machine units from the
865bd8deadSopenharmony_ci    returned pointer will always produce a multiple of the value of
875bd8deadSopenharmony_ci    MIN_MAP_BUFFER_ALIGNMENT."
885bd8deadSopenharmony_ci    
895bd8deadSopenharmony_ci    On page 63, which describes MapBuffer, after the sentence that ends:
905bd8deadSopenharmony_ci    
915bd8deadSopenharmony_ci    "... value of the access enum parameter passed to MapBuffer."
925bd8deadSopenharmony_ci    
935bd8deadSopenharmony_ci    Add the following sentence:
945bd8deadSopenharmony_ci    
955bd8deadSopenharmony_ci    "The pointer value returned by MapBuffer must be aligned to
965bd8deadSopenharmony_ci    the value of MIN_MAP_BUFFER_ALIGNMENT basic machine units."
975bd8deadSopenharmony_ci    
985bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci    None
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ciErrors
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci    None
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ciNew State
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci    None
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ciNew Implementation Dependent State
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci    Get Value                        Type  Get Command     Minimum Value    Description             Sec.     Attribute
1135bd8deadSopenharmony_ci    ---------                        ----  -----------     -------------    -------------------     -----    ---------
1145bd8deadSopenharmony_ci    MIN_MAP_BUFFER_ALIGNMENT         Z+    GetIntegerv     64               Minimum byte alignment  2.9.3    -
1155bd8deadSopenharmony_ci                                                                            of the pointer returned
1165bd8deadSopenharmony_ci                                                                            by MapBuffer and
1175bd8deadSopenharmony_ci                                                                            MapBufferRange.
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ciIssues
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    1) Why 64 byte alignment and not 16 (like DX) or something else?
1225bd8deadSopenharmony_ci    
1235bd8deadSopenharmony_ci    RESOLVED: A 16 byte alignment is good for SSE, which uses a 128 bit
1245bd8deadSopenharmony_ci    register file. However, with the advent of AVX, which has a 256 bit
1255bd8deadSopenharmony_ci    register file, and the potential for even wider register files in the
1265bd8deadSopenharmony_ci    near future, 64 byte alignment seemed like a safe choice.
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci    2) What alignment should be used for MapBufferRange when <offset> is
1295bd8deadSopenharmony_ci    non-zero?
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    RESOLVED:  The pointer returned should be consistent with the base of the
1325bd8deadSopenharmony_ci    buffer being aligned.  For example, if a buffer was mapped with an
1335bd8deadSopenharmony_ci    <offset> of 24 bytes on an implementation with a
1345bd8deadSopenharmony_ci    MIN_MAP_BUFFER_ALIGNMENT of 64, the value of the pointer returned
1355bd8deadSopenharmony_ci    would have a value of the form 64*<N>+24 for some integer <N>.
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    3) How should the minimum alignment be exposed?
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    RESOLVED:  Provide an implementation-dependent constant that can be
1405bd8deadSopenharmony_ci    queried.  Implementations that align buffers to >64-byte boundaries for
1415bd8deadSopenharmony_ci    whatever reason could advertise higher alignment values.  Since the
1425bd8deadSopenharmony_ci    minimum alignment is 64 bytes, an application using this extension need
1435bd8deadSopenharmony_ci    not check the implementation's advertised alignment unless it requires an
1445bd8deadSopenharmony_ci    alignment larger than this minimum.
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ciRevision History
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
1495bd8deadSopenharmony_ci    ----  --------  --------  -----------------------------------------------
1505bd8deadSopenharmony_ci    5     07/28/11  pbrown    Rename MINIMUM_MAP_BUFFER_ALIGNMENT to
1515bd8deadSopenharmony_ci                              MIN_MAP_BUFFER_ALIGNMENT to match usual API
1525bd8deadSopenharmony_ci                              naming conventions (bug 7825).
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci    4     06/20/11  pdaniell  Assign enum value.
1555bd8deadSopenharmony_ci    
1565bd8deadSopenharmony_ci    3     06/06/11  Jon Leech Minor typos for consistency with core spec.
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci    2     05/19/11  pbrown    Change spec language to require MapBufferRange
1595bd8deadSopenharmony_ci                              to return a pointer consistent with the base
1605bd8deadSopenharmony_ci                              being aligned.  Add a couple issues.  Minor 
1615bd8deadSopenharmony_ci                              wording changes (bug 7663).
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    1     05/05/11  pdaniell  Initial version.
164