15bd8deadSopenharmony_ci 25bd8deadSopenharmony_ciName 35bd8deadSopenharmony_ci 45bd8deadSopenharmony_ci ATI_vertex_array_object 55bd8deadSopenharmony_ci 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ciName Strings 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ci GL_ATI_vertex_array_object 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci 125bd8deadSopenharmony_ciContact 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ci Rick Hammerstone, AMD (rick.hammerstone 'at' amd.com) 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciVersion 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci 1.11 - 11/04/06 205bd8deadSopenharmony_ci Updated contact info after ATI/AMD merger. 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ci 1.1 - 01/08/02 235bd8deadSopenharmony_ci Changed DeleteObjectBufferATI to FreeObjectBufferATI to match the 245bd8deadSopenharmony_ci glati.h header file. Removed objbuf attribute. 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ci 1.01 - 09/18/01 275bd8deadSopenharmony_ci Added clarification that ArrayObectATI and VariantArrayObjectATI 285bd8deadSopenharmony_ci are not allowed between Begin/End but may not return an error. 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci 1.0 - 09/06/01 315bd8deadSopenharmony_ci Changed references to ATI_vertex_shader to EXT_vertex_shader. 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci 0.9 - 08/15/01 345bd8deadSopenharmony_ci Added support for variant arrays. 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci 0.8 - 07/06/01 375bd8deadSopenharmony_ci Added table of new state. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci 0.7 - 07/02/01 405bd8deadSopenharmony_ci Added official enumerants. 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci 0.6 - 05/07/01 435bd8deadSopenharmony_ci Chopped out most of the new entry points. Back to just object 445bd8deadSopenharmony_ci buffers and one call to define vertex arrays in an object buffer. 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci 0.5 - 04/18/01 475bd8deadSopenharmony_ci The great renaming. Added sample usage section. Expanded issues 485bd8deadSopenharmony_ci section. 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci 0.4 - 04/09/01 515bd8deadSopenharmony_ci Rewrote to use new entry points. 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci 0.3 - 04/06/01 545bd8deadSopenharmony_ci Changed Allocate and Free to New and Delete. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci 0.2 - 03/26/01 575bd8deadSopenharmony_ci Added error description, additions to section 5 and 6 of the spec. 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci 0.1 605bd8deadSopenharmony_ci Original version 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ciNumber 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci 247 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ciDependencies 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci This extension is written against the OpenGL 1.2.1 Specification. 695bd8deadSopenharmony_ci OpenGL 1.1 is required. GL_EXT_vertex_shader affects the 705bd8deadSopenharmony_ci definition of this extension. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ciOverview 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci This extension defines an interface that allows multiple sets of 765bd8deadSopenharmony_ci vertex array data to be cached in persistent server-side memory. 775bd8deadSopenharmony_ci It is intended to allow client data to be stored in memory that 785bd8deadSopenharmony_ci can be directly accessed by graphics hardware. 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ciIssues 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci Should this extension include support for allowing vertex indices 845bd8deadSopenharmony_ci to be stored on the server? 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci RESOLUTION: NO. This might not be universally supported, and 875bd8deadSopenharmony_ci seems simple enough to layer on top of this extension. 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci Is there a better name for this extension? 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci RESOLUTION: YES. The ArrayStore vs. StoredArray terminology 925bd8deadSopenharmony_ci was confusing. StoredArrays have been changed to be 935bd8deadSopenharmony_ci ArrayObjects. Since any type of object could be stored in the 945bd8deadSopenharmony_ci ArrayStore, these have been changed to ObjectBuffers. 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci Should the layout of an array store be defined at array store 975bd8deadSopenharmony_ci creation time? 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci RESOLUTION: NO. This could provide better performance if the 1005bd8deadSopenharmony_ci client specifies a data type that the hardware doesn't 1015bd8deadSopenharmony_ci support, but this isn't a performance path anyways, and it 1025bd8deadSopenharmony_ci adds a cumbersome interface on top of the extension. 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci Should the client be able to retrieve a pointer to the array store 1055bd8deadSopenharmony_ci instead of a handle? 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci RESOLUTION: NO. For now, it doesn't seem like this is a big 1085bd8deadSopenharmony_ci win, and it presents problems on certain OS's. It also 1095bd8deadSopenharmony_ci requires using an explicit synchronization mechanism. This 1105bd8deadSopenharmony_ci would be pretty trivial to add, however. 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci Should this just sit on top of the existing vertex array 1135bd8deadSopenharmony_ci implementation, instead of introducing a new set of API calls? 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci RESOLUTION: NO. Trying to fit something on top existing vertex 1165bd8deadSopenharmony_ci arrays introduces a lot of confusion as to where the data is 1175bd8deadSopenharmony_ci stored (on the client side vs. on the server side). Adding new 1185bd8deadSopenharmony_ci API that mirrors traditional vertex arrays doesn't seem to 1195bd8deadSopenharmony_ci cumbersome. 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ciNew Procedures and Functions 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci For creating, updating, and querying object buffers: 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci uint NewObjectBufferATI(sizei size, const void *pointer, enum usage) 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci boolean IsObjectBufferATI(uint buffer) 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci void UpdateObjectBufferATI(uint buffer, uint offset, sizei size, 1315bd8deadSopenharmony_ci const void *pointer, enum preserve) 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci void GetObjectBufferfvATI(uint buffer, enum pname, float *params) 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci void GetObjectBufferivATI(uint buffer, enum pname, int *params) 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci void FreeObjectBufferATI(uint buffer) 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci For defining vertex arrays inside an object buffer: 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci void ArrayObjectATI(enum array, int size, enum type, 1435bd8deadSopenharmony_ci sizei stride, uint buffer, uint offset) 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci For querying vertex arrays inside an object buffer: 1465bd8deadSopenharmony_ci 1475bd8deadSopenharmony_ci void GetArrayObjectfvATI(enum array, enum pname, float *params) 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci void GetArrayObjectivATI(enum array, enum pname, int *params) 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci If EXT_vertex_shader is defined, for defining variant arrays inside 1525bd8deadSopenharmony_ci an object buffer: 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci void VariantArrayObjectATI(uint id, enum type, sizei stride, 1555bd8deadSopenharmony_ci uint buffer, uint offset) 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci If EXT_vertex_shader is defined, for querying variant arrays inside 1585bd8deadSopenharmony_ci an object buffer: 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci void GetVariantArrayObjectfvATI(uint id, enum pname, 1615bd8deadSopenharmony_ci float *params) 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci void GetVariantArrayObjectivATI(uint id, enum pname, 1645bd8deadSopenharmony_ci int *params) 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ciNew Tokens 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ci Accepted by the <usage> parameter of NewObjectBufferATI: 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci STATIC_ATI 0x8760 1725bd8deadSopenharmony_ci DYNAMIC_ATI 0x8761 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci Accepted by the <preserve> parameter of UpdateObjectBufferATI: 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ci PRESERVE_ATI 0x8762 1775bd8deadSopenharmony_ci DISCARD_ATI 0x8763 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetObjectBufferivATI and 1805bd8deadSopenharmony_ci GetObjectBufferfvATI: 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci OBJECT_BUFFER_SIZE_ATI 0x8764 1835bd8deadSopenharmony_ci OBJECT_BUFFER_USAGE_ATI 0x8765 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetArrayObjectivATI and 1865bd8deadSopenharmony_ci GetArrayObjectfvATI: 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci ARRAY_OBJECT_BUFFER_ATI 0x8766 1895bd8deadSopenharmony_ci ARRAY_OBJECT_OFFSET_ATI 0x8767 1905bd8deadSopenharmony_ci 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ciAdditions to Chapter 2 of the GL Specification (OpenGL Operation) 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ci In section 2.6.3, GL Commands within Begin/End, add ArrayObjectATI 1955bd8deadSopenharmony_ci to the list of commands that are not allowed within any Begin/End 1965bd8deadSopenharmony_ci pair, but may or may not generate an error. If EXT_vertex_shader 1975bd8deadSopenharmony_ci is defined, add VariantArrayObjectATI to the list of commands that 1985bd8deadSopenharmony_ci are not allowed within any Begin/End pair, but may or may not 1995bd8deadSopenharmony_ci generate an error. 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci Inserted between section 2.8, Vertex Arrays, and section 2.9, 2035bd8deadSopenharmony_ci Rectangles, a new section titled Vertex Array Objects. 2045bd8deadSopenharmony_ci 2055bd8deadSopenharmony_ci In order to provide more a more efficient mechanism for storing 2065bd8deadSopenharmony_ci frequently used vertex array data on the server side, a client may 2075bd8deadSopenharmony_ci use the command 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ci uint NewObjectBufferATI(sizei size, const void *pointer, 2105bd8deadSopenharmony_ci enum usage); 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci to allocate a persistent buffer in which client data may be 2135bd8deadSopenharmony_ci stored. <size> specifies the size of the allocation in machine 2145bd8deadSopenharmony_ci units (hereafter assumed to be unsigned bytes). <pointer> 2155bd8deadSopenharmony_ci specifies a region of client memory that contains data to 2165bd8deadSopenharmony_ci initialize the object buffer. If <pointer> is null, then the 2175bd8deadSopenharmony_ci object buffer is created but not initialized. 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci <usage> provides a hint to the implementation of whether the 2205bd8deadSopenharmony_ci contents of the object buffer will be static or dynamic. <usage> 2215bd8deadSopenharmony_ci must be either STATIC_ATI or DYNAMIC_ATI. If the client specifies 2225bd8deadSopenharmony_ci an object buffer as static, its contents may still be updated, 2235bd8deadSopenharmony_ci however this may result in reduced performance. 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci The return value is a positive integer that uniquely identifies 2265bd8deadSopenharmony_ci the object buffer. If the object buffer cannot be allocated, the 2275bd8deadSopenharmony_ci return value is zero. 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ci When the client creates an object buffer using NewObjectBufferATI, 2305bd8deadSopenharmony_ci the implementation can provide more efficient transfers of data 2315bd8deadSopenharmony_ci between the client and the graphics controller by allocating the 2325bd8deadSopenharmony_ci object buffer in memory that can be directly addressed by the 2335bd8deadSopenharmony_ci graphics controller. In addition, because the object buffer is 2345bd8deadSopenharmony_ci persistent across multiple drawing commands, static data must only 2355bd8deadSopenharmony_ci be copied to the object buffer once. 2365bd8deadSopenharmony_ci 2375bd8deadSopenharmony_ci To modify the data contained in the object buffer, the client may 2385bd8deadSopenharmony_ci use the command 2395bd8deadSopenharmony_ci 2405bd8deadSopenharmony_ci void UpdateObjectBufferATI(uint buffer, uint offset, 2415bd8deadSopenharmony_ci sizei size, const void *pointer, 2425bd8deadSopenharmony_ci enum preserve); 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ci <buffer> identifies the object buffer to be updated. <offset> and 2455bd8deadSopenharmony_ci <size> indicate the range of data in the object buffer that is to 2465bd8deadSopenharmony_ci be updated. <pointer> specifies a region of client memory that 2475bd8deadSopenharmony_ci contains data to update the object buffer. 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci The client can use the <preserve> parameter of 2505bd8deadSopenharmony_ci UpdateObjectBufferATI to indicate whether data outside the region 2515bd8deadSopenharmony_ci being updated must be preserved. <preserve> must be one of 2525bd8deadSopenharmony_ci PRESERVE_ATI or DISCARD_ATI. If a client specifies that data 2535bd8deadSopenharmony_ci outside the range being updated may be discarded, the 2545bd8deadSopenharmony_ci implementation may be able process updates in a more optimal 2555bd8deadSopenharmony_ci fashion. 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ci Whenever UpdateObjectBufferATI is called, the byte values in the 2585bd8deadSopenharmony_ci object buffer from <offset> to <offset> + <size> - 1 are updated 2595bd8deadSopenharmony_ci with the data referenced by <pointer>. If the client specifies 2605bd8deadSopenharmony_ci PRESERVE_ATI, all other byte values in the object buffer remain 2615bd8deadSopenharmony_ci unchanged. If the client specifies DISCARD_ATI, then all byte 2625bd8deadSopenharmony_ci values outside the range that has been updated become undefined. 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci Once created, an object buffer remains available for use until it 2655bd8deadSopenharmony_ci is destroyed by calling 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci void FreeObjectBufferATI(uint buffer); 2685bd8deadSopenharmony_ci 2695bd8deadSopenharmony_ci <buffer> identifies the object buffer to be destroyed. 2705bd8deadSopenharmony_ci 2715bd8deadSopenharmony_ci After creating an object buffer, the client can use the command 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci void ArrayObjectATI(enum array, int size, enum type, 2745bd8deadSopenharmony_ci sizei stride, uint buffer, uint offset); 2755bd8deadSopenharmony_ci 2765bd8deadSopenharmony_ci to allow a portion of the object buffer to be used as a vertex 2775bd8deadSopenharmony_ci array. <array> specifies the array to be defined. This must match 2785bd8deadSopenharmony_ci one of the allowable enumerants accepted by EnableClientState and 2795bd8deadSopenharmony_ci DisableClientState. <size>, <type>, and <stride> specify the 2805bd8deadSopenharmony_ci format and packing of the data stored in the array in the same 2815bd8deadSopenharmony_ci manner as the corresponding vertex array pointer command. <size> 2825bd8deadSopenharmony_ci and <type> must match the allowed sizes and types given for the 2835bd8deadSopenharmony_ci corresponding commands in table 2.4. 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci <buffer> specifies the object buffer that contains the data to be 2865bd8deadSopenharmony_ci used as a vertex array. <offset> specifies the offset in machine 2875bd8deadSopenharmony_ci units into the object buffer at which the vertex array data 2885bd8deadSopenharmony_ci begins. When a vertex array is specified in this manner, the 2895bd8deadSopenharmony_ci memory pointer that is part of the client state for the vertex 2905bd8deadSopenharmony_ci array is set to null to indicate that the vertex array has been 2915bd8deadSopenharmony_ci defined using ArrayObjectATI instead of one of the pointer 2925bd8deadSopenharmony_ci commands. 2935bd8deadSopenharmony_ci 2945bd8deadSopenharmony_ci Vertex arrays that are defined to reside within an object buffer 2955bd8deadSopenharmony_ci function in the same manner as normal vertex arrays. They are 2965bd8deadSopenharmony_ci enabled and disabled by using the commands EnableClientState and 2975bd8deadSopenharmony_ci DisableClientState. Primitives can be constructed using 2985bd8deadSopenharmony_ci ArrayElement, DrawArrays, DrawElements, and DrawRangeElements. 2995bd8deadSopenharmony_ci Clients may use mix of traditional vertex arrays and vertex array 3005bd8deadSopenharmony_ci objects to specify geometry. 3015bd8deadSopenharmony_ci 3025bd8deadSopenharmony_ci There is no explicit mechanism to define interleaved vertex arrays 3035bd8deadSopenharmony_ci in an object buffer. This can be implicitly done by storing the 3045bd8deadSopenharmony_ci arrays in an interleaved fashion during NewObjectBufferATI or 3055bd8deadSopenharmony_ci UpdateObjectBufferATI. 3065bd8deadSopenharmony_ci 3075bd8deadSopenharmony_ci If EXT_vertex_shader is defined, then a client can define an array 3085bd8deadSopenharmony_ci of variant data using the command: 3095bd8deadSopenharmony_ci 3105bd8deadSopenharmony_ci void VariantArrayObjectATI(uint id, enum type, sizei stride, 3115bd8deadSopenharmony_ci uint buffer, uint offset); 3125bd8deadSopenharmony_ci 3135bd8deadSopenharmony_ci <id> indicates the variant that this array should be associated 3145bd8deadSopenharmony_ci with. The <type>, <stride>, <buffer>, and <offset> parameters 3155bd8deadSopenharmony_ci have the same meaning as the corresponding parameters of 3165bd8deadSopenharmony_ci ArrayObjectATI. As always, variant arrays have a fixed size of 4 3175bd8deadSopenharmony_ci components. 3185bd8deadSopenharmony_ci 3195bd8deadSopenharmony_ci Variant arrays defined by VariantArrayObjectATI are enabled and 3205bd8deadSopenharmony_ci disabled in the same way as variant arrays defined by 3215bd8deadSopenharmony_ci VariantPointerATI, by using EnableVariantClientStateATI and 3225bd8deadSopenharmony_ci DisableVariantClientStateATI. 3235bd8deadSopenharmony_ci 3245bd8deadSopenharmony_ci 3255bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2.1 Specification (Rasterization) 3265bd8deadSopenharmony_ci 3275bd8deadSopenharmony_ci None 3285bd8deadSopenharmony_ci 3295bd8deadSopenharmony_ci 3305bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.2.1 Specification (Per-Fragment 3315bd8deadSopenharmony_ciOperations and the Frame Buffer) 3325bd8deadSopenharmony_ci 3335bd8deadSopenharmony_ci None 3345bd8deadSopenharmony_ci 3355bd8deadSopenharmony_ci 3365bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.2.1 Specification (Special Functions) 3375bd8deadSopenharmony_ci 3385bd8deadSopenharmony_ci Added to section 5.4, as part of the discussion of what commands 3395bd8deadSopenharmony_ci are compiled into display lists: 3405bd8deadSopenharmony_ci 3415bd8deadSopenharmony_ci The commands defined by this extension function in the same manner 3425bd8deadSopenharmony_ci as the traditional vertex array commands when they are compiled 3435bd8deadSopenharmony_ci into a display list. 3445bd8deadSopenharmony_ci 3455bd8deadSopenharmony_ci Commands that are used to create and manage memory for stored 3465bd8deadSopenharmony_ci arrays are not included in display lists, but are executed 3475bd8deadSopenharmony_ci immediately. These include NewObjectBufferATI, IsObjectBufferATI, 3485bd8deadSopenharmony_ci UpdateObjectBufferATI, GetObjectBufferfvATI, GetObjectBufferivATI, 3495bd8deadSopenharmony_ci and FreeObjectBufferATI. 3505bd8deadSopenharmony_ci 3515bd8deadSopenharmony_ci Commands that are used to define and query vertex arrays within an 3525bd8deadSopenharmony_ci object buffer are not included in display lists, but are executed 3535bd8deadSopenharmony_ci immediately. These include ArrayObjectATI, GetArrayObjectfvATI, 3545bd8deadSopenharmony_ci and GetArrayObjectivATI. 3555bd8deadSopenharmony_ci 3565bd8deadSopenharmony_ci 3575bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2.1 Specification (State and State 3585bd8deadSopenharmony_ciRequests) 3595bd8deadSopenharmony_ci 3605bd8deadSopenharmony_ci Added to section 6.1 in a subsection titled Object Buffer Queries: 3615bd8deadSopenharmony_ci 3625bd8deadSopenharmony_ci The command 3635bd8deadSopenharmony_ci 3645bd8deadSopenharmony_ci boolean IsObjectBufferATI(uint buffer) 3655bd8deadSopenharmony_ci 3665bd8deadSopenharmony_ci returns TRUE if <buffer> is the name of an object buffer. If 3675bd8deadSopenharmony_ci <buffer> is zero, or if <buffer> is a non-zero value that is not 3685bd8deadSopenharmony_ci the name of an object buffer, IsObjectBufferATI return FALSE. 3695bd8deadSopenharmony_ci 3705bd8deadSopenharmony_ci Added to the list of queries in section 6.1.3, Enumerated Queries: 3715bd8deadSopenharmony_ci 3725bd8deadSopenharmony_ci void GetObjectBuffer{if}vATI(uint buffer, enum value, T data); 3735bd8deadSopenharmony_ci void GetArrayObject{if}vATI(enum array, enum value, T data); 3745bd8deadSopenharmony_ci 3755bd8deadSopenharmony_ci If EXT_vertex_shader is defined: 3765bd8deadSopenharmony_ci 3775bd8deadSopenharmony_ci void GetVariantArrayObject{if}vATI(uint id, enum value, T data); 3785bd8deadSopenharmony_ci 3795bd8deadSopenharmony_ci Appended to the description of the queries in section 6.1.3, 3805bd8deadSopenharmony_ci Enumerated Queries: 3815bd8deadSopenharmony_ci 3825bd8deadSopenharmony_ci GetObjectBuffer is used to retrieve information about an object 3835bd8deadSopenharmony_ci buffer. <buffer> must identify a valid object buffer. <value> must 3845bd8deadSopenharmony_ci be one of OBJECT_BUFFER_SIZE_ATI or OBJECT_BUFFER_USAGE_ATI. 3855bd8deadSopenharmony_ci 3865bd8deadSopenharmony_ci If <value> is OBJECT_BUFFER_SIZE_ATI, then the size of the object 3875bd8deadSopenharmony_ci buffer in bytes is returned in <data>. The exact size of the 3885bd8deadSopenharmony_ci object buffer is an implementation dependent value, but is 3895bd8deadSopenharmony_ci guaranteed to be at least as large as the value specified by the 3905bd8deadSopenharmony_ci <size> parameter of NewObjectBufferATI. If <value> is 3915bd8deadSopenharmony_ci OBJECT_BUFFER_USAGE_ATI, then the value returned in <data> will be 3925bd8deadSopenharmony_ci either STATIC_ATI or DYNAMIC_ATI. The return value will match the 3935bd8deadSopenharmony_ci value specified by the <usage> parameter of NewObjectBufferATI. 3945bd8deadSopenharmony_ci 3955bd8deadSopenharmony_ci GetArrayObjectATI is used to retrieve information on a vertex 3965bd8deadSopenharmony_ci array located in an object buffer. <array> indicates the vertex 3975bd8deadSopenharmony_ci array that is to be queried. It must match one of the allowable 3985bd8deadSopenharmony_ci enumerants accepted by EnableClientState and DisableClientState. 3995bd8deadSopenharmony_ci 4005bd8deadSopenharmony_ci If EXT_vertex_shader is defined, GetVariantArrayObjectATI is used 4015bd8deadSopenharmony_ci to retrieve information on a variant array located in an object 4025bd8deadSopenharmony_ci buffer. <id> indicates the variant that is to be queried. 4035bd8deadSopenharmony_ci 4045bd8deadSopenharmony_ci For both queries, <value> must be one of ARRAY_OBJECT_BUFFER_ATI, 4055bd8deadSopenharmony_ci or ARRAY_OBJECT_OFFSET_ATI. For each of these enumerants, the 4065bd8deadSopenharmony_ci value returned in <data> represents the object buffer that 4075bd8deadSopenharmony_ci contains the vertex data, or the byte offset from the object 4085bd8deadSopenharmony_ci buffer at which the first vertex starts, respectively. If the 4095bd8deadSopenharmony_ci specified vertex array or variant array has not been defined to 4105bd8deadSopenharmony_ci reside in an object buffer, GetArrayObjectATI will return zero for 4115bd8deadSopenharmony_ci both enumerants. 4125bd8deadSopenharmony_ci 4135bd8deadSopenharmony_ci 4145bd8deadSopenharmony_ciErrors 4155bd8deadSopenharmony_ci 4165bd8deadSopenharmony_ci INVALID_ENUM is generated if the <usage> parameter of 4175bd8deadSopenharmony_ci NewObjectBufferATI is not STATIC_ATI or DYNAMIC_ATI. 4185bd8deadSopenharmony_ci 4195bd8deadSopenharmony_ci OUT_OF_MEMORY may be generated if an object buffer cannot be 4205bd8deadSopenharmony_ci allocated because the <size> argument of NewObjectBufferATI is 4215bd8deadSopenharmony_ci too large. 4225bd8deadSopenharmony_ci 4235bd8deadSopenharmony_ci INVALID_VALUE is generated if the <buffer> argument of 4245bd8deadSopenharmony_ci UpdateObjectBufferATI, GetObjectBufferfvATI, GetObjectBufferivATI, 4255bd8deadSopenharmony_ci FreeObjectBufferATI, and ArrayObjectATI does not identify a 4265bd8deadSopenharmony_ci valid object buffer. 4275bd8deadSopenharmony_ci 4285bd8deadSopenharmony_ci INVALID_VALUE is generated if the <offset> and <size> parameters 4295bd8deadSopenharmony_ci of UpdateObjectBufferATI would reference a region of memory 4305bd8deadSopenharmony_ci outside that allocated by the call to NewObjectBufferATI. 4315bd8deadSopenharmony_ci 4325bd8deadSopenharmony_ci INVALID_ENUM is generated if the <pname> parameter of 4335bd8deadSopenharmony_ci GetObjectBufferfvATI and GetObjectBufferivATI is not 4345bd8deadSopenharmony_ci OBJECT_BUFFER_SIZE_ATI or OBJECT_BUFFER_USAGE_ATI. 4355bd8deadSopenharmony_ci 4365bd8deadSopenharmony_ci INVALID_ENUM is generated if the <array> parameter of 4375bd8deadSopenharmony_ci ArrayObjectATI, GetArrayObjectfvATI, and GetArrayObjectivATI does 4385bd8deadSopenharmony_ci not match one of the enumerants allowed by EnableClientState and 4395bd8deadSopenharmony_ci DisableClientState. 4405bd8deadSopenharmony_ci 4415bd8deadSopenharmony_ci INVALID_VALUE is generated if the <id> parameter of 4425bd8deadSopenharmony_ci VariantArrayObjectATI, GetVariantArrayObjectfvATI, and 4435bd8deadSopenharmony_ci GetVariantArrayObjectivATI does not correspond to a previously 4445bd8deadSopenharmony_ci defined variant. 4455bd8deadSopenharmony_ci 4465bd8deadSopenharmony_ci INVALID_VALUE is generated if the <size> and <type> parameters of 4475bd8deadSopenharmony_ci ArrayObjectATI do not match the allowable sizes and types given 4485bd8deadSopenharmony_ci for the pointer command corresponding to the <array> parameter. 4495bd8deadSopenharmony_ci 4505bd8deadSopenharmony_ci INVALID_VALUE is generated if the <offset> parameter of 4515bd8deadSopenharmony_ci ArrayObjectATI is larger than the size of the object buffer as 4525bd8deadSopenharmony_ci specified by NewObjectBufferATI. 4535bd8deadSopenharmony_ci 4545bd8deadSopenharmony_ci INVALID_ENUM is generated if the <pname> parameter of 4555bd8deadSopenharmony_ci GetArrayObjectfvATI and GetArrayObjectivATI is not 4565bd8deadSopenharmony_ci ARRAY_OBJECT_BUFFER_ATI or ARRAY_OBJECT_OFFSET_ATI. 4575bd8deadSopenharmony_ci 4585bd8deadSopenharmony_ci 4595bd8deadSopenharmony_ciNew State 4605bd8deadSopenharmony_ci 4615bd8deadSopenharmony_ci In a new table, Object Buffers 4625bd8deadSopenharmony_ci 4635bd8deadSopenharmony_ci Get Value Get Command Type Initial Value Attrib 4645bd8deadSopenharmony_ci --------- ----------- ---- ------------- ------ 4655bd8deadSopenharmony_ci OBJECT_BUFFER_SIZE_ATI GetIntegerv Z+ 0 - 4665bd8deadSopenharmony_ci OBJECT_BUFFER_USAGE_ATI GetIntegerv Z4 STATIC_ATI - 4675bd8deadSopenharmony_ci 4685bd8deadSopenharmony_ci ARRAY_OBJECT_BUFFER_ATI GetIntegerv Z+ 0 - 4695bd8deadSopenharmony_ci ARRAY_OBJECT_OFFSET_ATI GetIntegerv Z+ 0 - 4705bd8deadSopenharmony_ci 4715bd8deadSopenharmony_ci 4725bd8deadSopenharmony_ciUsage Example 4735bd8deadSopenharmony_ci 4745bd8deadSopenharmony_ci Here is a simple example that demonstrates usage of the extension. 4755bd8deadSopenharmony_ci The example provides a comparison between traditional vertex 4765bd8deadSopenharmony_ci arrays and vertex array objects. Note that this is not a 4775bd8deadSopenharmony_ci particularly efficient use of vertex array objects, since the 4785bd8deadSopenharmony_ci array object are only used once before being destroyed. Typically 4795bd8deadSopenharmony_ci the client will create many array objects and transfer all of its 4805bd8deadSopenharmony_ci vertex data to the server before beginning any rendering. 4815bd8deadSopenharmony_ci 4825bd8deadSopenharmony_ci Traditional vertex arrays: 4835bd8deadSopenharmony_ci 4845bd8deadSopenharmony_ci // Define 4855bd8deadSopenharmony_ci VertexPointer(4, FLOAT, 16, data); 4865bd8deadSopenharmony_ci ColorPointer(4, UNSIGNED_BYTE, 4, data + 256); 4875bd8deadSopenharmony_ci 4885bd8deadSopenharmony_ci // Enable 4895bd8deadSopenharmony_ci EnableClientState(VERTEX_ARRAY); 4905bd8deadSopenharmony_ci EnableClientState(COLOR_ARRAY); 4915bd8deadSopenharmony_ci 4925bd8deadSopenharmony_ci // Draw 4935bd8deadSopenharmony_ci DrawArrays(TRIANGLES, 0, 16); 4945bd8deadSopenharmony_ci 4955bd8deadSopenharmony_ci // Disable 4965bd8deadSopenharmony_ci DisableClientState(VERTEX_ARRAY); 4975bd8deadSopenharmony_ci DisableClientState(COLOR_ARRAY); 4985bd8deadSopenharmony_ci 4995bd8deadSopenharmony_ci Vertex array objects: 5005bd8deadSopenharmony_ci 5015bd8deadSopenharmony_ci // Create object buffer 5025bd8deadSopenharmony_ci buffer = NewObjectBufferATI(320, data, STATIC_ATI); 5035bd8deadSopenharmony_ci 5045bd8deadSopenharmony_ci // Define 5055bd8deadSopenharmony_ci ArrayObjectATI(VERTEX_ARRAY, 4, FLOAT, 16, buffer, 0); 5065bd8deadSopenharmony_ci ArrayObjectATI(COLOR_ARRAY, 4, UNSIGNED_BYTE, 4, buffer, 256); 5075bd8deadSopenharmony_ci 5085bd8deadSopenharmony_ci // Enable 5095bd8deadSopenharmony_ci EnableClientState(VERTEX_ARRAY); 5105bd8deadSopenharmony_ci EnableClientState(COLOR_ARRAY); 5115bd8deadSopenharmony_ci 5125bd8deadSopenharmony_ci // Draw 5135bd8deadSopenharmony_ci DrawArrays(TRIANGLES, 0, 16); 5145bd8deadSopenharmony_ci 5155bd8deadSopenharmony_ci // Disable 5165bd8deadSopenharmony_ci DisableClientState(VERTEX_ARRAY); 5175bd8deadSopenharmony_ci DisableClientState(COLOR_ARRAY); 5185bd8deadSopenharmony_ci 5195bd8deadSopenharmony_ci // Free object buffer 5205bd8deadSopenharmony_ci FreeObjectBufferATI(buffer); 5215bd8deadSopenharmony_ci 5225bd8deadSopenharmony_ci 5235bd8deadSopenharmony_ciImplementation Notes 5245bd8deadSopenharmony_ci 5255bd8deadSopenharmony_ci For maximum hardware performance, all vertex arrays except for 5265bd8deadSopenharmony_ci color and secondary color should always be specified to use float 5275bd8deadSopenharmony_ci as the component type. Color and secondary color arrays may be 5285bd8deadSopenharmony_ci specified to use either float or 4-component unsigned byte as the 5295bd8deadSopenharmony_ci component type. 5305bd8deadSopenharmony_ci 5315bd8deadSopenharmony_ci Typically, an object buffer will contain all of the vertex 5325bd8deadSopenharmony_ci information associated with a given object in a scene. This can 5335bd8deadSopenharmony_ci include multiple arrays of geometry, color, and texture data. If 5345bd8deadSopenharmony_ci portions of this data are static, and portions are dynamic, 5355bd8deadSopenharmony_ci greater performance can be achieved by placing the dynamic vertex 5365bd8deadSopenharmony_ci data in a separate object buffer and updating the entire object 5375bd8deadSopenharmony_ci buffer at once. 5385bd8deadSopenharmony_ci 539