1b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick/* 2b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * (C) Copyright IBM Corporation 2004, 2005 3b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * All Rights Reserved. 4b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 5b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Permission is hereby granted, free of charge, to any person obtaining a 6b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * copy of this software and associated documentation files (the "Software"), 7b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * to deal in the Software without restriction, including without limitation 8b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * the rights to use, copy, modify, merge, publish, distribute, sub license, 9b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * and/or sell copies of the Software, and to permit persons to whom the 10b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Software is furnished to do so, subject to the following conditions: 11b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 12b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * The above copyright notice and this permission notice (including the next 13b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * paragraph) shall be included in all copies or substantial portions of the 14b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Software. 15b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 16b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 19b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * IBM, 20b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * SOFTWARE. 24b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 25b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 26b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick#ifndef _INDIRECT_VA_PRIVATE_ 27b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick#define _INDIRECT_VA_PRIVATE_ 28b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 29b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick/** 30b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \file indirect_va_private.h 31b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 32b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \author Ian Romanick <idr@us.ibm.com> 33b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 34b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 35b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick#include <inttypes.h> 36b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 37b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick#include "glxclient.h" 38b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick#include "indirect.h" 39b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick#include <GL/glxproto.h> 40b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 41b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 42b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick/** 43b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * State descriptor for a single array of vertex data. 44b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 451c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristófstruct array_state 461c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf{ 47b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 48b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Pointer to the application supplied data. 49b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 501c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf const void *data; 511c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf 52b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 53b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Enum representing the type of the application supplied data. 54b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 551c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLenum data_type; 56b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 57b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 58b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Stride value supplied by the application. This value is not used 59b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * internally. It is only kept so that it can be queried by the 60b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * application using glGet*v. 61b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 621c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLsizei user_stride; 63b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 64b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 65b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Calculated size, in bytes, of a single element in the array. This 66b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * is calculated based on \c count and the size of the data type 67b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * represented by \c data_type. 68b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 691c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLsizei element_size; 70b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 71b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 72b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Actual byte-stride from one element to the next. This value will 73b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * be equal to either \c user_stride or \c element_stride. 74b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 751c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLsizei true_stride; 76b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 77b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 78b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Number of data values in each element. 79b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 801c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLint count; 81b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 82b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 83b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * "Normalized" data is on the range [0,1] (unsigned) or [-1,1] (signed). 84b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * This is used for mapping integral types to floating point types. 85b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 861c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLboolean normalized; 87b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 88b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 89b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Pre-calculated GLX protocol command header. 90b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 911c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf uint32_t header[2]; 921c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf 93b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 94b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Size of the header data. For simple data, like glColorPointerfv, 95b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * this is 4. For complex data that requires either a count (e.g., 96b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * glWeightfvARB), an index (e.g., glVertexAttrib1fvARB), or a 97b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * selector enum (e.g., glMultiTexCoord2fv) this is 8. 98b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 991c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf unsigned header_size; 1001c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf 101b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 102b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Set to \c GL_TRUE if this array is enabled. Otherwise, it is set 103b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * to \c GL_FALSE. 104b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1051c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLboolean enabled; 106b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 107b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 108b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * For multi-arrayed data (e.g., texture coordinates, generic vertex 109b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * program attributes, etc.), this specifies which array this is. 110b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1111c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf unsigned index; 1121c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf 113b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 114b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Per-array-type key. For most arrays, this will be the GL enum for 115b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * that array (e.g., GL_VERTEX_ARRAY for vertex data, GL_NORMAL_ARRAY 116b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * for normal data, GL_TEXTURE_COORD_ARRAY for texture coordinate data, 117b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * etc.). 118b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1191c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLenum key; 120b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 121b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 122b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * If this array can be used with the "classic" \c glDrawArrays protocol, 123b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * this is set to \c GL_TRUE. Otherwise, it is set to \c GL_FALSE. 124b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1251c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLboolean old_DrawArrays_possible; 126b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick}; 127b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 128b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 129b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick/** 130b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Array state that is pushed / poped by \c glPushClientAttrib and 131b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \c glPopClientAttrib. 132b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1331c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristófstruct array_stack_state 1341c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf{ 135b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 136b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Pointer to the application supplied data. 137b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1381c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf const void *data; 1391c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf 140b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 141b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Enum representing the type of the application supplied data. 142b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1431c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLenum data_type; 144b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 145b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 146b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Stride value supplied by the application. This value is not used 147b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * internally. It is only kept so that it can be queried by the 148b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * application using glGet*v. 149b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1501c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLsizei user_stride; 151b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 152b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 153b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Number of data values in each element. 154b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1551c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLint count; 156b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 157b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 158b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Per-array-type key. For most arrays, this will be the GL enum for 159b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * that array (e.g., GL_VERTEX_ARRAY for vertex data, GL_NORMAL_ARRAY 160b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * for normal data, GL_TEXTURE_COORD_ARRAY for texture coordinate data, 161b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * etc.). 162b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1631c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLenum key; 164b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 165b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 166b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * For multi-arrayed data (e.g., texture coordinates, generic vertex 167b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * program attributes, etc.), this specifies which array this is. 168b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1691c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf unsigned index; 170b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 171b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 172b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Set to \c GL_TRUE if this array is enabled. Otherwise, it is set 173b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * to \c GL_FALSE. 174b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1751c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLboolean enabled; 176b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick}; 177b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 178b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 179b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick/** 180b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Collection of all the vertex array state. 181b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1821c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristófstruct array_state_vector 1831c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf{ 184b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 185b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Number of arrays tracked by \c ::arrays. 186b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1871c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf size_t num_arrays; 188b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 189b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 190b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Array of vertex array state. This array contains all of the valid 191b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * vertex arrays. If a vertex array isn't in this array, then it isn't 192b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * valid. For example, if an implementation does not support 193b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * EXT_fog_coord, there won't be a GL_FOG_COORD_ARRAY entry in this 194b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * array. 195b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 1961c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf struct array_state *arrays; 197b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 198b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 199b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Number of currently enabled client-side arrays. The value of this 200b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * field is only valid if \c array_info_cache_valid is true. 201b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 2021c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf size_t enabled_client_array_count; 203b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 204b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 205b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \name ARRAY_INFO cache. 206b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 207b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * These fields track the state of the ARRAY_INFO cache. The 208b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \c array_info_cache_size is the size of the actual data stored in 209b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \c array_info_cache. \c array_info_cache_buffer_size is the size of 210b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * the buffer. This will always be greater than or equal to 211b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \c array_info_cache_size. 212b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 213b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \note 214979f35fb78f39cec5de53795ce91f674bfb9df52Ian Romanick * There are some bytes of extra data before \c array_info_cache that is 215979f35fb78f39cec5de53795ce91f674bfb9df52Ian Romanick * used to hold the header for RenderLarge commands. This is 216979f35fb78f39cec5de53795ce91f674bfb9df52Ian Romanick * \b not included in \c array_info_cache_size or 2172ae5645115124ecc97bf4a0ba9f5542cf2409845Ian Romanick * \c array_info_cache_buffer_size. \c array_info_cache_base stores a 2182ae5645115124ecc97bf4a0ba9f5542cf2409845Ian Romanick * pointer to the true start of the buffer (i.e., what malloc returned). 219b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 2201c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf /*@{ */ 2211c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf size_t array_info_cache_size; 2221c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf size_t array_info_cache_buffer_size; 2231c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf void *array_info_cache; 2241c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf void *array_info_cache_base; 2251c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf /*@} */ 226b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 227b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 228b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 229b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Is the cache of ARRAY_INFO data valid? The cache can become invalid 230b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * when one of several state changes occur. Among these chages are 231b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * modifying the array settings for an enabled array and enabling / 232b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * disabling an array. 233b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 2341c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLboolean array_info_cache_valid; 235b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 236b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 237b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Is it possible to use the GL 1.1 / EXT_vertex_arrays protocol? Use 238b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * of this protocol is disabled with really old servers (i.e., servers 239b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * that don't support GL 1.1 or EXT_vertex_arrays) or when an environment 240b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * variable is set. 241b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 242b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \todo 243b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * GL 1.1 and EXT_vertex_arrays use identical protocol, but have different 244b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * opcodes for \c glDrawArrays. For servers that advertise one or the 245b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * other, there should be a way to select which opcode to use. 246b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 2471c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLboolean old_DrawArrays_possible; 248b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 249b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 250b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Is it possible to use the new GL X.X / ARB_vertex_buffer_object 251b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * protocol? 252b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 253b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \todo 254b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * This protocol has not yet been defined by the ARB, but is currently a 255b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * work in progress. This field is a place-holder. 256b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 2571c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf GLboolean new_DrawArrays_possible; 258b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 259b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 260b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Active texture unit set by \c glClientActiveTexture. 261b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 262b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \sa __glXGetActiveTextureUnit 263b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 2641c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf unsigned active_texture_unit; 2651c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf 266b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 267b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Number of supported texture units. Even if ARB_multitexture / 268b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * GL 1.3 are not supported, this will be at least 1. When multitexture 269b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * is supported, this will be the value queried by calling 270b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \c glGetIntegerv with \c GL_MAX_TEXTURE_UNITS. 271b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 272b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \todo 273b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Investigate if this should be the value of \c GL_MAX_TEXTURE_COORDS 274b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * instead (if GL 2.0 / ARB_fragment_shader / ARB_fragment_program / 275b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * NV_fragment_program are supported). 276b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 2771c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf unsigned num_texture_units; 278b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 279b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 280b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Number of generic vertex program attribs. If GL_ARB_vertex_program 281b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * is not supported, this will be zero. Otherwise it will be the value 282b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * queries by calling \c glGetProgramiv with \c GL_VERTEX_PROGRAM_ARB 283b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * and \c GL_MAX_PROGRAM_ATTRIBS_ARB. 284b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 2851c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf unsigned num_vertex_program_attribs; 286b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 287b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick /** 288b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \n Methods for implementing various GL functions. 289b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 290b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * These method pointers are only valid \c array_info_cache_valid is set. 291b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * When each function starts, it much check \c array_info_cache_valid. 292b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * If it is not set, it must call \c fill_array_info_cache and call 293b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * the new method. 294b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 295b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \sa fill_array_info_cache 296b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * 297b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * \todo 298b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick * Write code to plug these functions directly into the dispatch table. 299b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick */ 3001c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf /*@{ */ 3011c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf void (*DrawArrays) (GLenum, GLint, GLsizei); 3021c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf void (*DrawElements) (GLenum mode, GLsizei count, GLenum type, 3031c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf const GLvoid * indices); 3041c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf /*@} */ 3051c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf 3061c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf struct array_stack_state *stack; 3071c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf unsigned active_texture_unit_stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; 3081c916736b88ff30d478d5ed1857c6ea5137af2a5RALOVICH, Kristóf unsigned stack_index; 309b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick}; 310b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick 311b81efaaa1ac8676a1092e4354079ffcbe7960af2Ian Romanick#endif /* _INDIRECT_VA_PRIVATE_ */ 312