blob: d6935235db9c05f4dd2a4dbc44348cd1c4ae8306 [file] [log] [blame]
Brian Paul05a4b372002-10-29 20:28:36 +00001/* $Id: acache.h,v 1.4 2002/10/29 20:28:58 brianp Exp $ */
Gareth Hughes22144ab2001-03-12 00:48:37 +00002
Keith Whitwell770169f2000-12-26 15:14:04 +00003/*
4 * Mesa 3-D graphics library
Brian Paulb7752722002-04-21 18:49:18 +00005 * Version: 4.1
Keith Whitwell770169f2000-12-26 15:14:04 +00006 *
Brian Paulb7752722002-04-21 18:49:18 +00007 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
Keith Whitwell770169f2000-12-26 15:14:04 +00008 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 * Authors:
Brian Paul05a4b372002-10-29 20:28:36 +000027 * Keith Whitwell <keith@tungstengraphics.com>
Keith Whitwell770169f2000-12-26 15:14:04 +000028 */
29
30#ifndef _ARRAYCACHE_H
31#define _ARRAYCACHE_H
32
33#include "mtypes.h"
34
35
36extern GLboolean
37_ac_CreateContext( GLcontext *ctx );
38
39extern void
40_ac_DestroyContext( GLcontext *ctx );
41
42extern void
43_ac_InvalidateState( GLcontext *ctx, GLuint new_state );
44
45extern struct gl_client_array *
Gareth Hughes22144ab2001-03-12 00:48:37 +000046_ac_import_vertex( GLcontext *ctx,
Keith Whitwell770169f2000-12-26 15:14:04 +000047 GLenum type,
Gareth Hughes22144ab2001-03-12 00:48:37 +000048 GLuint reqstride,
Keith Whitwell770169f2000-12-26 15:14:04 +000049 GLuint reqsize,
50 GLboolean reqwritable,
51 GLboolean *writable );
52
53extern struct gl_client_array *
Gareth Hughes22144ab2001-03-12 00:48:37 +000054_ac_import_normal( GLcontext *ctx,
Keith Whitwell770169f2000-12-26 15:14:04 +000055 GLenum type,
Gareth Hughes22144ab2001-03-12 00:48:37 +000056 GLuint reqstride,
Keith Whitwell770169f2000-12-26 15:14:04 +000057 GLboolean reqwritable,
58 GLboolean *writable );
59
60extern struct gl_client_array *
Gareth Hughes22144ab2001-03-12 00:48:37 +000061_ac_import_color( GLcontext *ctx,
Keith Whitwell770169f2000-12-26 15:14:04 +000062 GLenum type,
Gareth Hughes22144ab2001-03-12 00:48:37 +000063 GLuint reqstride,
Keith Whitwell770169f2000-12-26 15:14:04 +000064 GLuint reqsize,
65 GLboolean reqwritable,
66 GLboolean *writable );
67
68extern struct gl_client_array *
Gareth Hughes22144ab2001-03-12 00:48:37 +000069_ac_import_index( GLcontext *ctx,
Keith Whitwell770169f2000-12-26 15:14:04 +000070 GLenum type,
Gareth Hughes22144ab2001-03-12 00:48:37 +000071 GLuint reqstride,
Keith Whitwell770169f2000-12-26 15:14:04 +000072 GLboolean reqwritable,
73 GLboolean *writable );
74
75extern struct gl_client_array *
Gareth Hughes22144ab2001-03-12 00:48:37 +000076_ac_import_secondarycolor( GLcontext *ctx,
Keith Whitwell770169f2000-12-26 15:14:04 +000077 GLenum type,
Gareth Hughes22144ab2001-03-12 00:48:37 +000078 GLuint reqstride,
Keith Whitwell770169f2000-12-26 15:14:04 +000079 GLuint reqsize,
80 GLboolean reqwritable,
81 GLboolean *writable );
82
83extern struct gl_client_array *
Gareth Hughes22144ab2001-03-12 00:48:37 +000084_ac_import_fogcoord( GLcontext *ctx,
Keith Whitwell770169f2000-12-26 15:14:04 +000085 GLenum type,
Gareth Hughes22144ab2001-03-12 00:48:37 +000086 GLuint reqstride,
Keith Whitwell770169f2000-12-26 15:14:04 +000087 GLboolean reqwritable,
88 GLboolean *writable );
89
90extern struct gl_client_array *
Gareth Hughes22144ab2001-03-12 00:48:37 +000091_ac_import_edgeflag( GLcontext *ctx,
Keith Whitwell770169f2000-12-26 15:14:04 +000092 GLenum type,
Gareth Hughes22144ab2001-03-12 00:48:37 +000093 GLuint reqstride,
Keith Whitwell770169f2000-12-26 15:14:04 +000094 GLboolean reqwritable,
95 GLboolean *writable );
96
Brian Paulb7752722002-04-21 18:49:18 +000097extern struct gl_client_array *
98_ac_import_texcoord( GLcontext *ctx,
99 GLuint unit,
100 GLenum type,
101 GLuint reqstride,
102 GLuint reqsize,
103 GLboolean reqwritable,
104 GLboolean *writable );
105
106extern struct gl_client_array *
107_ac_import_attrib( GLcontext *ctx,
108 GLuint index,
109 GLenum type,
110 GLuint reqstride,
111 GLuint reqsize,
112 GLboolean reqwritable,
113 GLboolean *writable );
114
Keith Whitwell770169f2000-12-26 15:14:04 +0000115
116/* Clients must call this function to validate state and set bounds
Gareth Hughes22144ab2001-03-12 00:48:37 +0000117 * before importing any data:
Keith Whitwell770169f2000-12-26 15:14:04 +0000118 */
Gareth Hughes22144ab2001-03-12 00:48:37 +0000119extern void
Keith Whitwell770169f2000-12-26 15:14:04 +0000120_ac_import_range( GLcontext *ctx, GLuint start, GLuint count );
121
122
123/* Additional convenience function:
124 */
125extern CONST void *
126_ac_import_elements( GLcontext *ctx,
127 GLenum new_type,
128 GLuint count,
129 GLenum old_type,
130 CONST void *indices );
131
132
133#endif