1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * mesa 3-D graphics library
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
5bf215546Sopenharmony_ci *
6bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
7bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
8bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
9bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
11bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
12bf215546Sopenharmony_ci *
13bf215546Sopenharmony_ci * The above copyright notice and this permission notice shall be included
14bf215546Sopenharmony_ci * in all copies or substantial portions of the Software.
15bf215546Sopenharmony_ci *
16bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17bf215546Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20bf215546Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21bf215546Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22bf215546Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
23bf215546Sopenharmony_ci */
24bf215546Sopenharmony_ci
25bf215546Sopenharmony_ci/**
26bf215546Sopenharmony_ci * \brief Array type draw functions, the main workhorse of any OpenGL API
27bf215546Sopenharmony_ci * \author Keith Whitwell
28bf215546Sopenharmony_ci */
29bf215546Sopenharmony_ci
30bf215546Sopenharmony_ci
31bf215546Sopenharmony_ci#ifndef DRAW_H
32bf215546Sopenharmony_ci#define DRAW_H
33bf215546Sopenharmony_ci
34bf215546Sopenharmony_ci#include <stdbool.h>
35bf215546Sopenharmony_ci#include "main/glheader.h"
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_ci#ifdef __cplusplus
38bf215546Sopenharmony_ciextern "C" {
39bf215546Sopenharmony_ci#endif
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_cistruct gl_context;
42bf215546Sopenharmony_cistruct gl_vertex_array_object;
43bf215546Sopenharmony_cistruct _mesa_prim
44bf215546Sopenharmony_ci{
45bf215546Sopenharmony_ci   GLubyte mode;    /**< GL_POINTS, GL_LINES, GL_QUAD_STRIP, etc */
46bf215546Sopenharmony_ci
47bf215546Sopenharmony_ci   /**
48bf215546Sopenharmony_ci    * tnl: If true, line stipple emulation will reset the pattern walker.
49bf215546Sopenharmony_ci    * vbo: If false and the primitive is a line loop, the first vertex is
50bf215546Sopenharmony_ci    *      the beginning of the line loop and it won't be drawn.
51bf215546Sopenharmony_ci    *      Instead, it will be moved to the end.
52bf215546Sopenharmony_ci    */
53bf215546Sopenharmony_ci   bool begin;
54bf215546Sopenharmony_ci
55bf215546Sopenharmony_ci   /**
56bf215546Sopenharmony_ci    * tnl: If true and the primitive is a line loop, it will be closed.
57bf215546Sopenharmony_ci    * vbo: Same as tnl.
58bf215546Sopenharmony_ci    */
59bf215546Sopenharmony_ci   bool end;
60bf215546Sopenharmony_ci
61bf215546Sopenharmony_ci   GLuint start;
62bf215546Sopenharmony_ci   GLuint count;
63bf215546Sopenharmony_ci   GLint basevertex;
64bf215546Sopenharmony_ci   GLuint draw_id;
65bf215546Sopenharmony_ci};
66bf215546Sopenharmony_ci
67bf215546Sopenharmony_ci/* Would like to call this a "vbo_index_buffer", but this would be
68bf215546Sopenharmony_ci * confusing as the indices are not neccessarily yet in a non-null
69bf215546Sopenharmony_ci * buffer object.
70bf215546Sopenharmony_ci */
71bf215546Sopenharmony_cistruct _mesa_index_buffer
72bf215546Sopenharmony_ci{
73bf215546Sopenharmony_ci   GLuint count;
74bf215546Sopenharmony_ci   uint8_t index_size_shift; /* logbase2(index_size) */
75bf215546Sopenharmony_ci   struct gl_buffer_object *obj;
76bf215546Sopenharmony_ci   const void *ptr;
77bf215546Sopenharmony_ci};
78bf215546Sopenharmony_ci
79bf215546Sopenharmony_ci
80bf215546Sopenharmony_civoid
81bf215546Sopenharmony_ci_mesa_set_varying_vp_inputs(struct gl_context *ctx, GLbitfield varying_inputs);
82bf215546Sopenharmony_ci
83bf215546Sopenharmony_ci/**
84bf215546Sopenharmony_ci * Set the _DrawVAO and the net enabled arrays.
85bf215546Sopenharmony_ci */
86bf215546Sopenharmony_civoid
87bf215546Sopenharmony_ci_mesa_set_draw_vao(struct gl_context *ctx, struct gl_vertex_array_object *vao,
88bf215546Sopenharmony_ci                   GLbitfield filter);
89bf215546Sopenharmony_ci
90bf215546Sopenharmony_civoid
91bf215546Sopenharmony_ci_mesa_draw_gallium_fallback(struct gl_context *ctx,
92bf215546Sopenharmony_ci                            struct pipe_draw_info *info,
93bf215546Sopenharmony_ci                            unsigned drawid_offset,
94bf215546Sopenharmony_ci                            const struct pipe_draw_start_count_bias *draws,
95bf215546Sopenharmony_ci                            unsigned num_draws);
96bf215546Sopenharmony_ci
97bf215546Sopenharmony_civoid
98bf215546Sopenharmony_ci_mesa_draw_gallium_multimode_fallback(struct gl_context *ctx,
99bf215546Sopenharmony_ci                                     struct pipe_draw_info *info,
100bf215546Sopenharmony_ci                                     const struct pipe_draw_start_count_bias *draws,
101bf215546Sopenharmony_ci                                     const unsigned char *mode,
102bf215546Sopenharmony_ci                                     unsigned num_draws);
103bf215546Sopenharmony_ci
104bf215546Sopenharmony_ci#ifdef __cplusplus
105bf215546Sopenharmony_ci} // extern "C"
106bf215546Sopenharmony_ci#endif
107bf215546Sopenharmony_ci
108bf215546Sopenharmony_ci#endif
109