mesa: remove #include "mfeatures.h" from numerous source files
[mesa.git] / src / mesa / main / transformfeedback.h
1 /*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 2010 VMware, Inc. All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24
25 #ifndef TRANSFORM_FEEDBACK_H
26 #define TRANSFORM_FEEDBACK_H
27
28 #include <stdbool.h>
29 #include "compiler.h"
30 #include "glheader.h"
31 #include "mtypes.h"
32
33 struct _glapi_table;
34 struct dd_function_table;
35 struct gl_context;
36
37 extern void
38 _mesa_init_transform_feedback(struct gl_context *ctx);
39
40 extern void
41 _mesa_free_transform_feedback(struct gl_context *ctx);
42
43 extern GLboolean
44 _mesa_validate_transform_feedback_buffers(struct gl_context *ctx);
45
46
47 extern void
48 _mesa_init_transform_feedback_functions(struct dd_function_table *driver);
49
50 extern unsigned
51 _mesa_compute_max_transform_feedback_vertices(
52 const struct gl_transform_feedback_object *obj,
53 const struct gl_transform_feedback_info *info);
54
55
56 /*** GL_EXT_transform_feedback ***/
57
58 extern void GLAPIENTRY
59 _mesa_BeginTransformFeedback(GLenum mode);
60
61 extern void GLAPIENTRY
62 _mesa_EndTransformFeedback(void);
63
64 extern void
65 _mesa_bind_buffer_range_transform_feedback(struct gl_context *ctx,
66 GLuint index,
67 struct gl_buffer_object *bufObj,
68 GLintptr offset,
69 GLsizeiptr size);
70
71 extern void
72 _mesa_bind_buffer_base_transform_feedback(struct gl_context *ctx,
73 GLuint index,
74 struct gl_buffer_object *bufObj);
75
76 extern void GLAPIENTRY
77 _mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer,
78 GLintptr offset);
79
80 extern void GLAPIENTRY
81 _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count,
82 const GLchar * const *varyings,
83 GLenum bufferMode);
84
85 extern void GLAPIENTRY
86 _mesa_GetTransformFeedbackVarying(GLuint program, GLuint index,
87 GLsizei bufSize, GLsizei *length,
88 GLsizei *size, GLenum *type, GLchar *name);
89
90
91
92 /*** GL_ARB_transform_feedback2 ***/
93
94 struct gl_transform_feedback_object *
95 _mesa_lookup_transform_feedback_object(struct gl_context *ctx, GLuint name);
96
97 extern void GLAPIENTRY
98 _mesa_GenTransformFeedbacks(GLsizei n, GLuint *names);
99
100 extern GLboolean GLAPIENTRY
101 _mesa_IsTransformFeedback(GLuint name);
102
103 extern void GLAPIENTRY
104 _mesa_BindTransformFeedback(GLenum target, GLuint name);
105
106 extern void GLAPIENTRY
107 _mesa_DeleteTransformFeedbacks(GLsizei n, const GLuint *names);
108
109 extern void GLAPIENTRY
110 _mesa_PauseTransformFeedback(void);
111
112 extern void GLAPIENTRY
113 _mesa_ResumeTransformFeedback(void);
114
115 static inline bool
116 _mesa_is_xfb_active_and_unpaused(const struct gl_context *ctx)
117 {
118 return ctx->TransformFeedback.CurrentObject->Active &&
119 !ctx->TransformFeedback.CurrentObject->Paused;
120 }
121
122 #endif /* TRANSFORM_FEEDBACK_H */